def __init__(self, path): #print 'Build package repo from dir:',path # Holds are information self._db = PackageDatabase() # Make sure our path exists if not os.path.exists(path): raise Exception('Package repo path "%s" does not exist' % path) # Create our cache cache = FileParseCache(path, 'repo') # Get information on all the dicts found in the directory for full_path in util.match_files(path, '*.xpa'): # Load the data through the cache info = cache.load(full_path, lambda p: XPA(p).info) xpa = XPA(full_path, info=info) # Store the object in our repo self._db.store(name=xpa.name, version=xpa.version, data=xpa) # Save cached info cache.save_to_disk()
def __init__(self, path): # Holds the package information self._db = PackageDatabase() # Make sure our path exists if not os.path.exists(path): raise Exception('Package tree path "%s" does not exist' % path) # Create our cache self._cache = FileParseCache(path, 'tree') # Get information on all the dicts found in the directory for full_path in util.match_files(path, '*.xpd'): self._load_xpd(full_path) # Save cached info self._cache.save_to_disk()