2016-11-28 | Paul Boddie | file changeset files shortlog | Allow null contexts in retrieved attributes to override accessor contexts. This allows the use of functions as methods by instances. Make sure that methods which cannot be initialised in class structures are assigned with their context intact. |
paul@6 | 1 | #!/usr/bin/env python |
paul@6 | 2 | |
paul@6 | 3 | class struct_passwd: |
paul@6 | 4 | |
paul@6 | 5 | def __init__(self, pw_dir, pw_gecos, pw_gid, pw_name, pw_passwd, pw_shell, pw_uid): |
paul@6 | 6 | self.pw_dir = pw_dir |
paul@6 | 7 | self.pw_gecos = pw_gecos |
paul@6 | 8 | self.pw_gid = pw_gid |
paul@6 | 9 | self.pw_name = pw_name |
paul@6 | 10 | self.pw_passwd = pw_passwd |
paul@6 | 11 | self.pw_shell = pw_shell |
paul@6 | 12 | self.pw_uid = pw_uid |
paul@6 | 13 | |
paul@6 | 14 | n_fields = 7 |
paul@6 | 15 | n_sequence_fields = 7 |
paul@6 | 16 | n_unnamed_fields = 0 |
paul@6 | 17 | |
paul@6 | 18 | def getpwall(): pass |
paul@6 | 19 | def getpwnam(name): pass |
paul@6 | 20 | def getpwuid(uid): pass |
paul@6 | 21 | |
paul@6 | 22 | # vim: tabstop=4 expandtab shiftwidth=4 |