def interface_file(path, TD): if TD == "pick": TD = Private.TD_picker(path) folder = path TeamDrive = TD response = False files = list() while True: filter = interface_filter(path) files = Private.search_folder(folder, TD=TeamDrive, pickmode="multi", filter=filter, Print=False) if files == False: print("Query returned no files") input('\nPress any key to continue...') clear_Screen() About() return True else: response = interface_menu(files, TeamDrive) if str(response) == "False": return response elif str(response) == "CHANGE": return True
def scrape_lib_worker(db,entry,filter=''): results=[]; path=db[entry]['path'] TD=db[entry]['TD_name'] from Drive import Private as DrivePrivate response=DrivePrivate.search_folder(path,TD=TD,filter=filter,Pick=False) if response!=False: results+=response return results
def scrape_remote_libs(): db=libraries(remote_lib_file) if db==False: return results=[]; for entry in db: path=db[entry]['path'] TD=db[entry]['TD_name'] from Drive import Private as DrivePrivate response=DrivePrivate.search_folder(path,TD=TD,filter="",Pick=False) if response!=False: results+=response remote_lib_2html(entry,response) remote_lib_2html('all',results)
def search_remote_lib(value,library): if library=='None': html='<p style="margin-bottom: 2px;margin-top: 3px"><strong style="margin-left: 12px">You need to create a library config file first</strong></p>' eel.load_remote_results(html) return try: db=libraries(remote_lib_file) if db==False: eel.load_remote_results(False) return if not library.lower()=='all': results=[] path=db[library]['path'] TD=db[library]['TD_name'] print("* Searching library {}".format(library)) sys.stdout.flush() response=DrivePrivate.search_folder(path,TD=TD,filter=value,Pick=False) if response!=False: results+=response send_results=[] try: for entry in results: send_results.append('{}/{}'.format(entry[2],entry[0])) sr=sortbyname(send_results) except:pass html='<ul style="margin-bottom: 2px;margin-top: 3px; list-style-type: none;">' i=0 for it in sorted(sr.keys()): i+=1;type='' item=sr[it] item2=' '+it if item2.endswith('.nsp'): type='<span class="bg-darkBlue fg-white"> nsp </span>' elif item2.endswith('.xci'): type='<span class="bg-darkRed fg-white"> xci  </span>' var='remote_res_'+str(i) html+='<li style="margin-bottom: 2px;margin-top: 3px" onclick="start_from_remote_library({})"><span id="{}" style="display:none">{}</span>{}<strong>{}</strong></li>'.format(var,var,item,type,item2) html+='</ul>' else: results=[] for entry in db: path=db[entry]['path'] TD=db[entry]['TD_name'] print("* Searching library {}".format(entry)) sys.stdout.flush() response=DrivePrivate.search_folder(path,TD=TD,filter=value,Pick=False) if response!=False: results+=response send_results=[] try: for entry in results: send_results.append('{}/{}'.format(entry[2],entry[0])) sr=sortbyname(send_results) except:pass html='<ul style="margin-bottom: 2px;margin-top: 3px; list-style-type: none;">' i=0 for it in sorted(sr.keys()): i+=1;type='' item=sr[it] item2=' '+it if item2.endswith('.nsp'): type='<span class="bg-darkBlue fg-white"> nsp </span>' elif item2.endswith('.xci'): type='<span class="bg-darkRed fg-white"> xci  </span>' var='remote_res_'+str(i) html+='<li style="margin-bottom: 2px;margin-top: 3px" onclick="start_from_remote_library({})"><span id="{}" style="display:none">{}</span>{}<strong>{}</strong></li>'.format(var,var,item,type,item2) html+='</ul>' eel.load_remote_results(html) return except BaseException as e: Print.error('Exception: ' + str(e)) sys.stdout.flush()