Logo Search packages:      
Sourcecode: sabayon version File versions  Download package

def lib::userdb::UserDatabase::__init__ (   self,
  db_file = None 
)

Create a UserDatabase object.

@db_file: an (optional) path which specifes the location
of the database file. If not specified, the default
location of /etc/desktop-profiles/users.xml is used.

Definition at line 88 of file userdb.py.

00088                                        :
        """Create a UserDatabase object.

        @db_file: an (optional) path which specifes the location
        of the database file. If not specified, the default
        location of /etc/desktop-profiles/users.xml is used.
        """
        if db_file is None:
            file = os.path.join (config.PROFILESDIR, "users.xml")
      elif db_file[0] != '/':
            file = os.path.join (config.PROFILESDIR, db_file)
      else:
          file = db_file
      self.file = file;
      self.modified = 0
      dprint("New UserDatabase(%s) object\n" % self.file)

      try:
          self.doc = libxml2.readFile(file, None, libxml2.XML_PARSE_NOBLANKS)
          # Process XInclude statements
          self.doc.xincludeProcess()
      except:
          # TODO add fallback to last good database
          dprint("failed to parse %s falling back to default conf\n" %
                 self.file)
          self.doc = None
      if self.doc == None:
          self.doc = libxml2.readMemory(defaultConf, len(defaultConf),
                                        None, None,
                                        libxml2.XML_PARSE_NOBLANKS);

    def __del__ (self):


Generated by  Doxygen 1.6.0   Back to index