importpywikibot,re,roman,timefrompywikibotimportpagegeneratorsfrompywikibot.botimportExistingPageBotclassMyBot(ExistingPageBot):deftreat_page(self):"""Saca los enlaces de cada página. Si hay un enlace en español, para todo. Si no hay, agrega a la lista."""links=self.current_page.langlinks()NOT_ES=Trueforlinkinlinks:ifstr(link.site)=="wiktionary:es":NOT_ES=FalsebreakifNOT_ES:print('BOOP')withopen('LIST','a')asf:f.write('*[['+self.current_page.title()+']]<small>([[:en:'+self.current_page.title()+'|en]])</small>\n')defmain(*args:str):"""Parse command line arguments and invoke bot."""options={}gen_factory=pagegenerators.GeneratorFactory()# Option parsinglocal_args=pywikibot.handle_args(args)# global optionslocal_args=gen_factory.handle_args(local_args)# generators optionsforarginlocal_args:opt,sep,value=arg.partition(':')ifoptin('-summary','-text'):options[opt[1:]]=valueMyBot(generator=gen_factory.getCombinedGenerator(),**options).run()if__name__=='__main__':main()