File: group.py

package info (click to toggle)
python-reconfigure 0.1.59%2Bgit20140824-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 708 kB
  • ctags: 692
  • sloc: python: 4,139; makefile: 181
file content (15 lines) | stat: -rw-r--r-- 388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from reconfigure.items.bound import BoundData


class GroupsData (BoundData):
    pass


class GroupData (BoundData):
    fields = ['name', 'password', 'gid', 'users']


GroupsData.bind_collection('groups', item_class=GroupData)
for i in range(0, len(GroupData.fields)):
    path = lambda i: lambda x: x.children[i]
    GroupData.bind_property('value', GroupData.fields[i], path=path(i))