def get_bookmarks(self): bookmarks = {} config = GlobalConfig() filename = config._get_filename() for name, value in config._get_parser().get("BOOKMARKS", {}).items(): bookmarks[name] = filename, value return bookmarks
def set_bookmark(self, name, location): config = GlobalConfig() parser = config._get_parser() if "BOOKMARKS" not in parser: parser["BOOKMARKS"] = {} parser["BOOKMARKS"][name] = location parser.write(file(config._get_filename(), 'wb'))
def unset_bookmark(self, name): config = GlobalConfig() parser = config._get_parser() del parser["BOOKMARKS"][name] parser.write(file(config._get_filename(), 'wb'))