示例#1
0
 def load(self):
     """Load preferences from scratch, discarding any mods and deletions."""
     self.user = Preferences(os.path.join(utils.getgraildir(),
                                          USERPREFSFILENAME))
     self.sys = Preferences(os.path.join(utils.get_grailroot(),
                                         SYSPREFSFILENAME),
                            1)
示例#2
0
 def load(self):
     """Load preferences from scratch, discarding any mods and deletions."""
     self.user = Preferences(os.path.join(utils.getgraildir(),
                                          USERPREFSFILENAME))
     self.sys = Preferences(os.path.join(utils.get_grailroot(),
                                         SYSPREFSFILENAME),
                            1)
示例#3
0
文件: app.py 项目: ashumeow/grail
 def __init__(self, prefs=None):
     utils._grail_app = self
     if prefs is None:
         import GrailPrefs
         self.prefs = GrailPrefs.AllPreferences()
     else:
         self.prefs = prefs
     self.graildir = utils.getgraildir()
     user_icons = os.path.join(self.graildir, 'icons')
     utils.establish_dir(self.graildir)
     utils.establish_dir(user_icons)
     self.iconpath = [
         user_icons, os.path.join(utils.get_grailroot(), 'icons')]
     #
     self.__loaders = {}
     #
     # Add our type map file to the set used to initialize the shared map:
     #
     typefile = os.path.join(self.graildir, "mime.types") 
     mimetypes.init(mimetypes.knownfiles + [typefile])
示例#4
0
 def __init__(self, prefs=None):
     utils._grail_app = self
     if prefs is None:
         import GrailPrefs
         self.prefs = GrailPrefs.AllPreferences()
     else:
         self.prefs = prefs
     self.graildir = utils.getgraildir()
     user_icons = os.path.join(self.graildir, 'icons')
     utils.establish_dir(self.graildir)
     utils.establish_dir(user_icons)
     self.iconpath = [
         user_icons,
         os.path.join(utils.get_grailroot(), 'icons')
     ]
     #
     self.__loaders = {}
     #
     # Add our type map file to the set used to initialize the shared map:
     #
     typefile = os.path.join(self.graildir, "mime.types")
     mimetypes.init(mimetypes.knownfiles + [typefile])