def updateCache(*args): config.initialize() # A file is outdated if it does not exists or if its modification date is # older than now - update_interval isOutDated = lambda fn: not (os.path.exists(fn) and os.path.getmtime(fn) > int(time()) - config.update_interval * 3600) eggs_index_proxy = IndexProxy(config) if isOutDated(os.path.join(config.eggs_directory, 'index.html')): eggs_index_proxy.updateBaseIndex() for package_name in os.listdir(config.eggs_directory): dir_path = os.path.join(config.eggs_directory, package_name) if not os.path.isdir(dir_path): continue if isOutDated(os.path.join(dir_path, 'index.html')): try: eggs_index_proxy.updatePackageIndex(package_name) except PackageNotFound, msg: # FIXME: use logging print msg