Lichen

lib/pwd.py

90:c7ddfc4525da
2016-10-08 Paul Boddie Added some support for eliminating accessor class types where the provided attributes are invoked and are unbound methods. This uses a more sophisticated method involving usage observations that incorporate invocation information, permitting classes as accessors if paths through the code support them, even if other paths require instances as accessors to invoke methods.
     1 #!/usr/bin/env python     2      3 class struct_passwd:     4      5     def __init__(self, pw_dir, pw_gecos, pw_gid, pw_name, pw_passwd, pw_shell, pw_uid):     6         self.pw_dir = pw_dir     7         self.pw_gecos = pw_gecos     8         self.pw_gid = pw_gid     9         self.pw_name = pw_name    10         self.pw_passwd = pw_passwd    11         self.pw_shell = pw_shell    12         self.pw_uid = pw_uid    13     14     n_fields = 7    15     n_sequence_fields = 7    16     n_unnamed_fields = 0    17         18 def getpwall(): pass    19 def getpwnam(name): pass    20 def getpwuid(uid): pass    21     22 # vim: tabstop=4 expandtab shiftwidth=4