Utente:Sirbot/Script: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
|||
Riga 96:
</source>
==
<source lang="python">
#!/usr/bin/env python
Line 122 ⟶ 121:
always = True
site = wikipedia.getSite()
category_name = '
categoria = catlib.Category(site, category_name)
discussioni = categoria.articles()
Line 154 ⟶ 153:
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non ci sono immagini: valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Ii]mmagini= ?d\n', '|immagini= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Trovate immagini: rimuovo valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\<ref.*)', pageText, re.IGNORECASE)
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
Line 223 ⟶ 200:
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non ci sono fonti: valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Ff]onti= ?d\n', '|fonti= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Trovate fonti: rimuovo valutazione "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Vv]etrina)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= *?\n', '|accuratezza=a\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce in vetrina: completezza "a"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Ss]\|)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza=.*?\n', '|accuratezza=c\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Stub: completezza "c"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= ?c\n', '|accuratezza= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Non stub: rimuovo completezza "c"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Aa]\|)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= *?\n', '|accuratezza=d\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce da aiutare: completezza "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
if match == None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Aa]ccuratezza= ?d\n', '|accuratezza= \n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce non da aiutare: rimuovo completezza "d"')
except wikipedia.Error, e:
print e # Print the error and skip
continue
match = re.search('(\{\{[Dd]a correggere)', pageText, re.IGNORECASE)
if match is not None:
wikipedia.output(">>>>> %s <<<<<" % associatedPage.title())
try:
talkText = page.get()
except wikipedia.Error, e:
print e # Print the error and skip
continue
newTalkText = re.sub('\|\n? *?[Ss]crittura= *?\n', '|scrittura=d\n', talkText)
if talkText != newTalkText:
wikipedia.showDiff(talkText, newTalkText)
if not always:
choice = wikipedia.inputChoice(u"Apply the changes?", ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
else:
choice = 'y'
if choice in ['A', 'a']:
always = True
choice = 'y'
if choice in ['Y', 'y']:
try:
page.put(newTalkText, u'[[WP:BOT|Bot]]: Voce da correggere: scrittura "d"')
except wikipedia.Error, e:
print e # Print the error and skip
|