def run(self): self.label_se = self.lycos(self.nom_base, \ conditions="traduction IS NULL", limite=self.limite_label_se) art_etrangers = self.lycos(self.nom_base, conditions="traduction IS NOT NULL") art_fr = self.lycos('contenu_de_qualite_fr') for page_et, infos_et in art_etrangers.items(): eq_fr = infos_et['traduction'] if art_fr.has_key(eq_fr): self.label_deux[page_et] = infos_et else: page_trad = BeBot.togglePageTrad(pywikibot.Page(self.site_fr, eq_fr)) if page_trad.exists(): self.label_trad[page_et] = infos_et self.label_trad[page_et]['souspage_trad'] = page_trad ipt = self.infos_page_suivi(page_trad) self.label_trad[page_et]['statut'] = ipt['statut'] self.label_trad[page_et]['progression'] = ipt['progression'] else: self.label_nofr[page_et] = infos_et self.label_nofr[page_et]['taille_fr'] = BeBot.taille_page( \ pywikibot.Page(self.site_fr, eq_fr)) self.total = len(self.label_se) + len(self.label_nofr) \ + len(self.label_deux) + len(self.label_trad)
def get_infos(self, page, cattoa): """ Recherche toutes les informations nécessaires associées à une page """ infos = { 'page': page.title(), \ 'label': cattoa, \ 'taille': BeBot.taille_page(page), \ 'traduction': self.traduction(page), \ } return infos