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

def lib::userdb::UserDatabase::set_default_profile (   self,
  profile 
)

Set the default profile to be used for all users.

@profile: the location of the profile.

Definition at line 356 of file userdb.py.

00356                                            :
        """Set the default profile to be used for all users.

        @profile: the location of the profile.
        """
        if profile is None:
            profile = ""
      self.modified = 0
      try:
          default = self.doc.xpathEval("/profiles/default")[0]
          oldprofile = default.prop("profile")
          if oldprofile != profile:
              default.setProp("profile", profile)
            self.modified = 1
        except:
          try:
            profiles = self.doc.xpathEval("/profiles")[0]
          except:
            raise UserDatabaseException(
                    _("File %s is not a profile configuration") %
                                           (self.file))
          try:
            default = profiles.newChild(None, "default", None)
            default.setProp("profile", profile)
          except:
            raise UserDatabaseException(
                    _("Failed to add default profile %s to configuration") %
                                           (profile))
          self.modified = 1
      if self.modified == 1:
          self.__save_as()

    def set_profile (self, username, profile):


Generated by  Doxygen 1.6.0   Back to index