def __init__(self): gedit.Plugin.__init__(self) self._instances = {} self._config = None self._bookmarks = None # Setup configuration file path conf_path = os.path.join(os.path.expanduser("~/.gnome2/gedit/plugins/"), "advanced-bookmarks/plugin.conf") try: # Check if configuration file does not exists if not os.path.exists(conf_path): # Create configuration file (and directory) if not( os.path.exists(os.path.dirname(conf_path)) ): os.makedirs( os.path.dirname(conf_path) ) conf_file = file(conf_path, "wt") conf_file.close() # Create configuration dictionary self.read_config(conf_path) # Create bookmark list self._bookmarks = bookmarks.bookmark_list(self._config) except (IOError, OSError), e: print "could not read config file (%s)" % e
def __init__(self): gedit.Plugin.__init__(self) self._instances = {} # Setup configuration file path conf_path = os.path.join(os.path.expanduser("~/.gnome2/gedit/plugins/"), "advanced-bookmarks/plugin.conf") # Check if configuration file does not exists if not os.path.exists(conf_path): # Create configuration file conf_file = file(conf_path, "wt") conf_file.close() # Create configuration dictionary self.read_config(conf_path) # Create bookmark list self._bookmarks = bookmarks.bookmark_list(self._config)