def dl(dbq): pointer = Parser.parse_dl(dbq) dlurl = pointer[0] dldir = pointer[1] dlpath = pointer[2] m = pointer[3] DirCreator.dirExistCheck(dldir) print(m) with urllib.request.urlopen(dlurl) as resp, open(dlpath, 'wb') as file: shutil.copyfileobj(resp, file) print('done')
def dl(dbq): pointer = Parser.parse_dl(dbq) dlurl = pointer[0] dldir = pointer[1] dlpath = pointer [2] m = pointer [3] DirCreator.dirExistCheck(dldir) print (m) with urllib.request.urlopen(dlurl) as resp, open(dlpath, 'wb') as file: shutil.copyfileobj(resp, file) print ('done')
def local(): # walk the downloads dir # build the local database gdldir = Const.gdldir() DirCreator.dirExistCheck(gdldir) dirs = os.listdir(gdldir) localdb = [] i = 0 for d in dirs: fpath = gdldir + d try: files = os.listdir(fpath) except: files = [] for f in files: localdb = Parser.parse_lcldb(localdb, d, f, i) i += 1 return localdb
def local(): # walk the downloads dir # build the local database gdldir = Const.gdldir() DirCreator.dirExistCheck(gdldir) dirs = os.listdir(gdldir) localdb = [] i = 0 for d in dirs: fpath = gdldir + d try: files = os.listdir(fpath) except: files = [] for f in files: localdb = Parser.parse_lcldb(localdb, d, f, i) i += 1 return (localdb)