def __init__(self, root, **kwargs): FileManager.__init__(self, root, **kwargs) PackageDictManager.__init__(self) dicts_db = self.config + '/dicts.db' self._package_dict_db = db.open(dicts_db, 'c') for k in list(self._package_dict_db.keys()): v = self._package_dict_db[k] self.register_package_dict(pickle.loads(v))
def __init__ (self, root, **kwargs): FileManager.__init__ (self, root, **kwargs) PackageDictManager.__init__ (self) dicts_db = self.config + '/dicts.db' self._package_dict_db = db.open (dicts_db, 'c') for k in list (self._package_dict_db.keys ()): v = self._package_dict_db[k] self.register_package_dict (pickle.loads (v))
def __init__(self, root, dbdir=None, clean=False): self.root = os.path.normpath(root) if dbdir: self.config = dbdir else: self.config = self.root + '/etc/gup' self.config = os.path.normpath(self.config) self.verbose = True self.is_distro = False ## lock must be outside of root, otherwise we can't rm -rf root # UGH, /GUB self.lock_file = self.root + '.lock' self.lock = locker.Locker(self.lock_file) if clean: loggedos.system(gub_log.default_logger, 'rm -fr %s' % self.config) self.make_dirs() files_db = self.config + '/files.db' packages_db = self.config + '/packages.db' self._file_package_db = db.open(files_db, 'c') self._package_file_db = db.open(packages_db, 'c')
def __init__ (self, root, dbdir=None, clean=False): self.root = os.path.normpath (root) if dbdir: self.config = dbdir else: self.config = self.root + '/etc/gup' self.config = os.path.normpath (self.config) self.verbose = True self.is_distro = False ## lock must be outside of root, otherwise we can't rm -rf root # UGH, /GUB self.lock_file = self.root + '.lock' self.lock = locker.Locker (self.lock_file) if clean: loggedos.system (logging.default_logger, 'rm -fr %s' % self.config) self.make_dirs () files_db = self.config + '/files.db' packages_db = self.config + '/packages.db' self._file_package_db = db.open (files_db, 'c') self._package_file_db = db.open (packages_db, 'c')
def __init__(self, dir): self.db = db.open(os.path.join(dir, "tag.db"), "c")