def getUrls(): urls = [] for entry in os.listdir(STORAGE_PATH): path = os.path.join(STORAGE_PATH, entry, URL_BASENAME) if os.path.exists(path): fp = disk.fetchDataFile(path) urls.append(fp.read()) return urls
def load(path): fp = disk.fetchDataFile(path) map = cPickle.load(fp) fp.close() return map
def _fetchDataFile(url, basename): path = _getStoragePath(url, basename) return disk.fetchDataFile(path)