Next / Previous / Contents / TCC Help System / NM Tech homepage

26. class WebUser: Encapsulate user data

An instance of this class holds the relevant data about one user with a personal Web: basically just their name (from the gecos field in LDAP) and their account name.

homelist2
# - - - - -   c l a s s   W e b U s e r

class WebUser(object):
    '''Represents one user with a personal web.

      Exports:
        WebUser(login, gecos):
          [ (login is a user's account name) and
            (gecos is that user's GECOS name) ->
              return a new WebUser with those values ]
        .login:       [ as passed to the constructor, read-only ]
        .gecos:       [ as passed to the constructor, read-only ]
    '''
    def __init__(self, login, gecos):
        '''Constructor.
        '''
        self.login = login
        self.gecos = gecos