def doneForm(self): print("Uploading info!") self.title = self.titleString.get() #upload fichier MIDI upload.main('-always','-filename:' + self.title + '.mid', '-ignorewarn','-putthrottle:1',songname,'''{{Fichier|Concerne=''' + self.title +'''|Est un fichier du type=MIDI}}''') #upload fichier score upload.main('-always','-filename:' + self.title + '.png', '-ignorewarn','-putthrottle:1',scorename,'''{{Fichier|Concerne=''' + self.title +'''|Est un fichier du type=Score}}''') #Open page on wiki to input more info webbrowser.open("http://leviolondejos.wiki/index.php?title=Spécial:AjouterDonnées/Enregistrement/" + self.title) #close self.master.destroy()
def upload(data: Item): res = main(data.dict()) logger.info("上传情况", res) return res
def test(): main() return render_template('test.html')
cl.click_more_comment(driver=driver) cl.click_more_comment(driver=driver) cl.click_more_comment(driver=driver) print("COMMENT_DONE") # os.system("pause") cl.click_more_content(driver=driver) # print("CONTENT_DONE") # os.system("pause") htmltext = driver.page_source postlist = cl.make_post_dict(html_doc=htmltext, driver=driver) # os.system("pause") memberlist=cl.get_club_member_list(LINK,driver=driver) announcement_list = cl.get_club_announcement_list(LINK=LINK, driver=driver) dataset=cl.make_dataset(post_info=postlist,member_info=memberlist,announcement_info=announcement_list) cl.save_json_file(dataset=dataset) scratch_time = str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) time_pattern = r'\d{4}-(\d{2})-(\d{2})(\s)(\d{2}):(\d{2}):\d{2}' time_list = re.findall(time_pattern, scratch_time)[0] finishtime = str(time_list[0] + time_list[1]) upload.main(is_update_file_function=bool(True), update_drive_service_name=finishtime+'.json',update_file_path=os.getcwd() + '/')
def action(): upload.main()
keep = u'-keep' target = u"-noverify" ignorewarn1 = u'-abortonwarn:duplicate' ignorewarn2 = u'-abortonwarn:exists' nomFitxerDirectori = u'joan/%s - Joan Brull i Vinyoles (1863-1912).jpg' % ( file_name) nomFitxer = u'-filename:%s - Joan Brull i Vinyoles (1863-1912).jpg' % ( file_name) if not os.path.isfile(nomFitxerDirectori): numero = 0 while not os.path.isfile(nomFitxerDirectori) and numero < 8: nomFitxerDirectori = u'joan/%s - Joan Brull i Vinyoles (1863-1912) - %s.jpg' % ( file_name, numero) nomFitxer = u'-filename:%s - Joan Brull i Vinyoles (1863-1912) - %s.jpg' % ( file_name, numero) numero = numero + 1 if os.path.isfile(nomFitxerDirectori): descripcio = u'{{Artwork\n |artist\t= {{Creator:%s}}\n |title\t= {{ca|%s}}\n |description\t= {{ca|1=\'\'%s\'\'}}\n |date\t= %s\n |medium\t= \n |dimensions\t= %s \n |institution\t= \n |department\t=\n |references\t=\n |object history\t=\n |exhibition history = \n |credit line\t=\n |inscriptions\t=\n |notes\t=\n |accession number\t= \n |place of creation\t= \n |source\t=[http://joanbrull.com/ca/cataleg-de-obres-de-joan-brull-i-vinyoles.php Catàleg d\'obres de joan brull i vinyoles] \n |permission\t={{PD-Art|1=PD-old-auto-1996|deathyear=1912}} \n |other_versions\t= }}\n[[Category:Joan Brull i Vinyoles]]' % ( u'Joan Brull i Vinyoles', file_name, file_name, anys[contador].strip(), dimensions[contador].strip()) print descripcio try: upload.main(keep, nomFitxer, target, ignorewarn1, ignorewarn2, nomFitxerDirectori, descripcio) os.remove(nomFitxerDirectori) except (verification - error): linia = "Fitxer ja penjat anteriorment: %s" % linia else: print "NO TROBAT" contador = contador + 1
def test_main_loop(upload_tearup, capsys): import upload upload.main() out, err = capsys.readouterr() assert '7 file(s) uploaded.' in out
# post_list = fbapi.get_all_posts_by_type(dataset=dataset, type='Q&A') # print(post_list) # comment_list = fbapi.get_all_main_comments_by_post_id_user_id(dataset=dataset, post_id=1, user_id='Nicolas Hei') # print(comment_list) # comment_list=fbapi.get_all_below_comments_by_post_id_user_id(dataset=dataset, post_id=1, user_id='Nicolas Hei') # print(comment_list) # emoji_list = fbapi.get_post_emojis_by_post_id(dataset=dataset, post_id=1) # print(emoji_list) user_emojitimes = fbapi.get_all_posts_emojis_times_by_user_id( dataset=dataset, user_id='沈姵昕') print(user_emojitimes) data = fbapi.get_all_posts_all_user_comments_times(dataset=dataset) print(data) allemojitimes = fbapi.get_user_emoji_times_by_user_id(dataset=dataset, user_id='沈姵昕') print(allemojitimes) if (allemojitimes['LIKE'] > 76 and user_emojitimes['LIKE'] > 33): with open('fine_dataset.json', 'r', encoding='utf-8') as f: date_list = json.load(f) date_list.append(finishtime) with open('fine_dataset.json', 'w') as fp: json.dump(date_list, fp, indent=4) else: print("data : {} is fail".format(finishtime)) if __name__ == '__main__': save_json_file_for_fine_dataset() upload.main(is_update_file_function=bool(True), update_drive_service_name='fine_dataset.json', update_file_path=os.getcwd() + '/')