Package sabayon :: Module systemdb :: Class SystemDatabase
[hide private]
[frames] | no frames]

Class SystemDatabase

source code


An encapsulation of the database which maintains an association between users and profiles.

This database is stored by default in $(sysconfdir)/sabayon/profiles/users.xml and contains a list of users and the profile associated with each of those users.

A profile can be reference by either its name (in which case the profile is stored at /etc/sabayon/profiles/$(name).zip), an absolute path or a http/file URL.

Instance Methods [hide private]
  __init__(self, db_file=None)
Create a SystemDatabase object.
  __del__(self)
  __profile_name_to_location(self, profile, node)
  __open_ldap(self)
  __ldap_query(self, map, replace)
  get_default_profile(self, profile_location=True)
Look up the default profile.
  gen_get_profile(self, searchterm, replace, profile_location=True, ignore_default=False)
Look up the profile for a given searchterm.
  __save_as(self, filename=None)
  set_default_profile(self, profile)
Set the default profile to be used in this database.
  gen_set_profile(self, searchterm, child, profile)
Set the profile for a given searchterm.
  gen_is_sabayon_controlled(self, searchterm, replace)
Return True if user's configuration was ever under Sabayon's control.
  get_profiles(self)
Return the list of currently available profiles.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, db_file=None)
(Constructor)

source code 
Create a SystemDatabase object.
Overrides: object.__init__

__del__(self)
(Destructor)

source code 
None

__profile_name_to_location(self, profile, node)

source code 
None

__open_ldap(self)

source code 
None

__ldap_query(self, map, replace)

source code 
None

get_default_profile(self, profile_location=True)

source code 
Look up the default profile.

gen_get_profile(self, searchterm, replace, profile_location=True, ignore_default=False)

source code 
Look up the profile for a given searchterm.

__save_as(self, filename=None)

source code 
None

set_default_profile(self, profile)

source code 
Set the default profile to be used in this database.

gen_set_profile(self, searchterm, child, profile)

source code 
Set the profile for a given searchterm.

gen_is_sabayon_controlled(self, searchterm, replace)

source code 
Return True if user's configuration was ever under Sabayon's control.

get_profiles(self)

source code 
Return the list of currently available profiles. This is basically just list of zip files in /etc/sabayon/profiles, each without the .zip extension.