def __init__ (self, name):
        """Create a ProfileStorage.

        @name: the name of the profile - translates to
        /etc/desktop-profiles/$(name).zip.
        """
        self.name = name
        self.readonly = 0

        if not os.path.isabs (self.name):
            try:
                protocol = urlparse.urlparse(self.name)[0]
                if protocol == "":
                    self.path = os.path.join (PROFILESDIR, self.name + ".zip")
                else:
                    # if someone uses file:/// they deserve to have troubles
                    self.readonly == 1
                    cachou = cache.get_default_cache()
                    self.path = cachou.get_resource(self.name)
                    if self.path == None:
                        self.path = self.name

            except:
                self.path = os.path.join (PROFILESDIR, self.name + ".zip")
        else:
            self.path = name

        self.metadata         = None
        self.zip              = None
        self.temp_path        = None
        self.needs_saving     = False

        dprint ("Creating profile '%s' from '%s'", self.name, self.path)
Beispiel #2
0
    def __init__( self ):

        self.cache = cache.get_default_cache()
Beispiel #3
0
    def __init__( self, db, session_id ):

        self.__cache = cache.get_default_cache()
        self.__db = db
        self.__session_id = session_id
Beispiel #4
0
    def __init__(self, db, session_id):

        self.__cache = cache.get_default_cache()
        self.__db = db
        self.__session_id = session_id