jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] changes in checkimages.py
......................................................................
[PEP8] changes in checkimages.py
Change-Id: Ibd16e389f99252eaf80a33fb2a823df5dcb7d6c0
---
M checkimages.py
1 file changed, 63 insertions(+), 29 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/checkimages.py b/checkimages.py
index 4f48382..da98deb 100644
--- a/checkimages.py
+++ b/checkimages.py
@@ -290,12 +290,16 @@
'ur': u"\n== تصویر بدون اجازہ ==\n",
}
# That's the text that the bot will add if it doesn't find the license.
-# Note: every __botnick__ will be repleaced with your bot's nickname (feel free not to use if you don't need it)
+# Note: every __botnick__ will be repleaced with your bot's nickname
+# (feel free not to use if you don't need it)
nothing_notification = {
- 'commons': u"\n{{subst:User:Filnik/untagged|File:%s}}\n\n''This message was '''added automatically by " + \
- u"__botnick__''', if you need some help about it, please read the text above again and follow the links in it," + \
- u"if you still need help ask at the [[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] '''[[Commons:Help desk|->]]" + \
- u"[[Commons:Help desk]]''' in any language you like to use.'' --__botnick__ ~~~~~""",
+ 'commons': (u"\n{{subst:User:Filnik/untagged|File:%s}}\n\n''This message "
+ u"was '''added automatically by __botnick__''', if you need "
+ u"some help about it, please read the text above again and "
+ u"follow the links in it, if you still need help ask at the "
+ u"[[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] "
+ u"'''[[Commons:Help desk|->]][[Commons:Help desk]]''' in any "
+ u"language you like to use.'' --__botnick__ ~~~~~"""),
'ar': u"{{subst:مصدر الصورة|File:%s}} --~~~~",
'en': u"{{subst:image source|File:%s}} --~~~~",
'fa': u"{{جا:اخطار نگاره|%s}}",
@@ -407,7 +411,9 @@
# Warning 3: the part that use this regex is case-insensitive (just to let you
# know..)
HiddenTemplate = {
- 'commons': [u'Template:Information'], # Put the other in the page on the project defined below
+ # Put the other in the page on the project defined below
+ 'commons': [u'Template:Information'],
+
'ar': [u'Template:معلومات'],
'de': [u'Template:Information'],
'en': [u'Template:Information'],
@@ -415,9 +421,11 @@
'fr': [u'Template:Information'],
'ga': [u'Template:Information'],
'hu': [u'Template:Információ', u'Template:Enwiki', u'Template:Azonnali'],
+ # Put the other in the page on the project defined below
'it': [u'Template:EDP', u'Template:Informazioni file',
u'Template:Information', u'Template:Trademark',
- u'Template:Permissionotrs'], # Put the other in the page on the project defined below
+ u'Template:Permissionotrs'],
+
'ja': [u'Template:Information'],
'ko': [u'Template:그림 정보'],
'ta': [u'Template:Information'],
@@ -444,7 +452,13 @@
# Note: every __botnick__ will be repleaced with your bot's nickname
# (feel free not to use if you don't need it)
HiddenTemplateNotification = {
- 'commons': u"""\n{{subst:User:Filnik/whitetemplate|File:%s}}\n\n''This message was added automatically by __botnick__, if you need some help about it please read the text above again and follow the links in it, if you still need help ask at the [[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] '''[[Commons:Help desk|→]] [[Commons:Help desk]]''' in any language you like to use.'' --__botnick__ ~~~~~""",
+ 'commons': (u"\n{{subst:User:Filnik/whitetemplate|File:%s}}\n\n''This "
+ u"message was added automatically by __botnick__, if you need "
+ u"some help about it please read the text above again and "
+ u"follow the links in it, if you still need help ask at the "
+ u"[[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]]"
+ u" '''[[Commons:Help desk|→]] [[Commons:Help desk]]''' in any "
+ u"language you like to use.'' --__botnick__ ~~~~~"),
'it': u"{{subst:Progetto:Coordinamento/Immagini/Bot/Messaggi/Template_insufficiente|%s|__botnick__}} --~~~~",
'ko': u"\n{{subst:User:Kwj2772/whitetemplates|%s}} --~~~~",
}
@@ -827,15 +841,20 @@
URL = u'http://toolserver.org/~daniel/WikiSense/UntaggedImages.php?'
if lang == 'commons':
- link = URL + \
- 'wikifam=commons.wikimedia.org&since=-100d&until=&img_user_text=&order=img_timestamp&max=100&order=img_timestamp&format=html'
+ link = (
+ URL +
+ 'wikifam=commons.wikimedia.org&since=-100d&until=&img_user_text=&order=img_timestamp&max=100&order=img_timestamp&format=html'
+ )
else:
- link = URL + \
- 'wikilang=%s&wikifam=%s&order=img_timestamp&max=%s&ofs=0&max=%s' \
- % (lang, project, limit, limit)
+ link = (
+ URL +
+ 'wikilang=%s&wikifam=%s&order=img_timestamp&max=%s&ofs=0&max=%s'
+ % (lang, project, limit, limit)
+ )
text = self.site.getUrl(link, no_hostname=True)
- results = re.findall(r"<td valign='top' title='Name'><a href='http://.*?\.org/w/index\.php\?title=(.*?)'>.*?</a></td>",
- text)
+ results = re.findall(
+ r"<td valign='top' title='Name'><a href='http://.*?\.org/w/index\.php\?title=(.*?)'>.*?</a></td>",
+ text)
if results:
for result in results:
wikiPage = pywikibot.ImagePage(self.site, result)
@@ -944,7 +963,8 @@
if not hash_found:
return # Image deleted, no hash found. Skip the image.
- commons_image_with_this_hash = commons_site.getFilesFromAnHash(hash_found)
+ commons_image_with_this_hash = commons_site.getFilesFromAnHash(
+ hash_found)
if commons_image_with_this_hash and \
commons_image_with_this_hash is not 'None':
servTMP = pywikibot.translate(self.site, serviceTemplates,
@@ -961,7 +981,8 @@
pywikibot.output(u'%s is on commons!' % self.imageName)
on_commons_text = self.image.getImagePageHtml()
- if re.search(ur"\<div class\=(?:'|\")sharedUploadNotice(?:'|\")\>",on_commons_text):
+ if re.search(ur"\<div class\=(?:'|\")sharedUploadNotice(?:'|\")\>",
+ on_commons_text):
pywikibot.output(
u"But, the file doesn't exist on your project! Skip...")
# We have to skip the check part for that image because
@@ -973,7 +994,8 @@
pywikibot.output(
u'%s has "stemma" inside, means that it\'s ok.'
% self.imageName)
- return True # It's not only on commons but the image needs a check
+ return True
+ # It's not only on commons but the image needs a check
# the second usually is a url or something like that.
# Compare the two in equal way, both url.
if self.convert_to_url(self.imageName) \
@@ -1009,7 +1031,7 @@
duplicates = self.site.getFilesFromAnHash(hash_found)
if not duplicates:
- return # Error, image deleted, no hash found. Skip the image.
+ return # Error, image deleted, no hash found. Skip the image.
if len(duplicates) > 1:
if len(duplicates) == 2:
@@ -1042,7 +1064,8 @@
for duplicate in duplicates:
if pywikibot.ImagePage(self.site, duplicate) \
== pywikibot.ImagePage(self.site, older_image):
- continue # the older image, not report also this as duplicate
+ # the older image, not report also this as duplicate
+ continue
DupePage = pywikibot.ImagePage(self.site, duplicate)
try:
DupPageText = DupePage.get()
@@ -1056,11 +1079,12 @@
u'%s is a duplicate and has to be tagged...'
% duplicate)
images_to_tag_list.append(duplicate)
- #if duplicate != duplicates[-1]:
+## if duplicate != duplicates[-1]:
string += u"*[[:%s%s]]\n" % (self.image_namespace,
duplicate)
- #else:
- # string += "*[[:%s%s]]" % (self.image_namespace, duplicate)
+## else:
+## string += "*[[:%s%s]]" \
+## % (self.image_namespace, duplicate)
else:
pywikibot.output(
u"Already put the dupe-template in the files's page"
@@ -1068,7 +1092,9 @@
return # Ok - Let's continue the checking phase
older_image_ns = u'%s%s' % (self.image_namespace, older_image)
- only_report = False # true if the image are not to be tagged as dupes
+
+ # true if the image are not to be tagged as dupes
+ only_report = False
# put only one image or the whole list according to the request
if u'__images__' in dupText:
@@ -1105,7 +1131,8 @@
u'File:%s' % images_to_tag_list[-1], self.botolist)
image_to_resub = images_to_tag_list[-1]
from_regex = r'\n\*\[\[:File:%s\]\]' \
- % re.escape(self.convert_to_url(self.imageName))
+ % re.escape(self.convert_to_url(
+ self.imageName))
# Delete the image in the list where we're write on
text_for_the_report = re.sub(from_regex, '',
text_for_the_report)
@@ -1130,7 +1157,8 @@
for duplicate in duplicates:
if self.convert_to_url(duplicate) == \
self.convert_to_url(self.imageName):
- continue # the image itself, not report also this as duplicate
+ # the image itself, not report also this as duplicate
+ continue
repme += u"\n**[[:File:%s]]" \
% self.convert_to_url(duplicate)
@@ -1141,7 +1169,9 @@
return True # If Errors, exit (but continue the check)
if older_image != self.imageName:
- return # The image is a duplicate, it will be deleted. So skip the check-part, useless
+ # The image is a duplicate, it will be deleted. So skip the
+ # check-part, useless
+ return
return True # Ok - No problem. Let's continue the checking phase
def report_image(self, image_to_report, rep_page=None, com=None,
@@ -1176,7 +1206,10 @@
pywikibot.output(
u"The log page (%s) is full! Please delete the old files "
u" reported. Skip!" % another_page.title())
- return True # Don't report, but continue with the check (we don't now if this is the first time we check this file or not)
+ # Don't report, but continue with the check
+ # (we don't now if this is the first time we check this file
+ # or not)
+ return True
# The talk page includes "_" between the two names, in this way I
# replace them to " "
@@ -1372,7 +1405,8 @@
self.imageCheckText)
if not self.licenses_found and templatesInTheImageRaw:
- # {{nameTemplate|something <- this is not a template, be sure that we haven't catch something like that.
+ # {{nameTemplate|something <- this is not a template, be sure
+ # that we haven't catch something like that.
licenses_TEST = regex_are_licenses.findall(self.imageCheckText)
if not self.licenses_found and licenses_TEST:
raise pywikibot.Error(
--
To view, visit https://gerrit.wikimedia.org/r/95759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd16e389f99252eaf80a33fb2a823df5dcb7d6c0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] for cfd.py
......................................................................
[PEP8] for cfd.py
Change-Id: I3b7a82579d4cc37cd4f3f5081118e9329de29144
---
M cfd.py
1 file changed, 50 insertions(+), 25 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/cfd.py b/cfd.py
index 8da3657..17d77c5 100644
--- a/cfd.py
+++ b/cfd.py
@@ -21,25 +21,34 @@
cfdPage = 'Wikipedia:Categories for discussion/Working'
# A list of templates that are used on category pages as part of the CFD
-# process that contain information such as the link to the per-day discussion page.
+# process that contain information such as the link to the per-day discussion
+# page.
cfdTemplates = ['Cfd full', 'Cfr full']
# Regular expression declarations
-# See the en-wiki CFD working page at [[Wikipedia:Categories for discussion/Working]]
-# to see how these work in context. To get this bot working on other wikis you will
-# need to adjust these regular expressions at the very least.
+# See the en-wiki CFD working page at
+# [[Wikipedia:Categories for discussion/Working]]
+# to see how these work in context. To get this bot working on other wikis you
+# will need to adjust these regular expressions at the very least.
nobots = re.compile(r"NO\s*BOTS", re.IGNORECASE)
example = re.compile(r"\[\[\:Category\:(.)\1\1\1\1\]\]", re.IGNORECASE)
speedymode = re.compile(r"^===*\s*Speedy Moves\s*===*\s*$", re.IGNORECASE)
-movemode = re.compile(r"^===*\s*Move\/Merge then delete\s*===*\s*$", re.IGNORECASE)
+movemode = re.compile(r"^===*\s*Move\/Merge then delete\s*===*\s*$",
+ re.IGNORECASE)
emptymode = re.compile(r"^===*\s*Empty then delete\s*===*\s*$", re.IGNORECASE)
deletemode = re.compile(r"^===*\s*Ready for deletion\s*===*\s*$", re.IGNORECASE)
-maintenance = re.compile(r"^===*\s*Old by month categories with entries\s*===*\s*$", re.IGNORECASE)
-dateheader = re.compile(r"(\[\[Wikipedia\:Categories[_ ]for[_ ](?:discussion|deletion)\/Log\/([^\]]*?)\]\])",
- re.IGNORECASE)
-movecat = re.compile(r"\[\[\:Category\:([^\]]*?)\]\][^\]]*?\[\[\:Category\:([^\]]*?)\]\]", re.IGNORECASE)
+maintenance = re.compile(
+ r"^===*\s*Old by month categories with entries\s*===*\s*$", re.IGNORECASE)
+dateheader = re.compile(
+ r"(\[\[Wikipedia\:Categories[_ ]for[_ ](?:discussion|deletion)\/Log\/([^\]]*?)\]\])",
+ re.IGNORECASE)
+movecat = re.compile(
+ r"\[\[\:Category\:([^\]]*?)\]\][^\]]*?\[\[\:Category\:([^\]]*?)\]\]",
+ re.IGNORECASE)
deletecat = re.compile(r"\[\[\:Category\:([^\]]*?)\]\]", re.IGNORECASE)
-findday = re.compile(r"\[\[(Wikipedia\:Categories for (?:discussion|deletion)\/Log\/\d{4} \w+ \d+)#", re.IGNORECASE)
+findday = re.compile(
+ r"\[\[(Wikipedia\:Categories for (?:discussion|deletion)\/Log\/\d{4} \w+ \d+)#",
+ re.IGNORECASE)
class ReCheck:
@@ -86,7 +95,8 @@
mode = "Delete"
day = "None"
elif maintenance.search(line):
- # It's probably best not to try to handle these in an automated fashion.
+ # It's probably best not to try to handle these in an automated
+ # fashion.
mode = "None"
day = "None"
elif m.check(dateheader, line):
@@ -97,9 +107,12 @@
dest = m.result.group(2)
thisDay = findDay(src, day)
if mode == "Move" and thisDay != "None":
- summary = "Robot - Moving category " + src + " to [[:Category:" + dest + "]] per [[WP:CFD|CFD]] at " + thisDay + "."
+ summary = ("Robot - Moving category %s to [[:Category:%s]] per "
+ "[[WP:CFD|CFD]] at %s.") % (src, dest, thisDay)
elif mode == "Speedy":
- summary = "Robot - Speedily moving category " + src + " to [[:Category:" + dest + "]] per [[WP:CFDS|CFDS]]."
+ summary = ("Robot - Speedily moving category %s to "
+ "[[:Category:%s]] per [[WP:CFDS|CFDS]].") % (src,
+ dest)
else:
continue
# If the category is redirect, we do NOT want to move articles to
@@ -112,23 +125,33 @@
pywikibot.output(summary, toStdout=True)
robot = None
else:
- robot = category.CategoryMoveRobot(oldCatTitle=src, newCatTitle=dest, batchMode=True,
- editSummary=summary, inPlace=True, moveCatPage=True,
- deleteEmptySourceCat=True, useSummaryForDeletion=True)
+ robot = category.CategoryMoveRobot(oldCatTitle=src,
+ newCatTitle=dest,
+ batchMode=True,
+ editSummary=summary,
+ inPlace=True,
+ moveCatPage=True,
+ deleteEmptySourceCat=True,
+ useSummaryForDeletion=True)
elif m.check(deletecat, line):
src = m.result.group(1)
- # I currently don't see any reason to handle these two cases separately, though
- # if are guaranteed that the category in the "Delete" case is empty, it might be
- # easier to call delete.py on it.
+ # I currently don't see any reason to handle these two cases
+ # separately, though if are guaranteed that the category in the
+ # "Delete" case is empty, it might be easier to call delete.py on
+ # it.
thisDay = findDay(src, day)
if (mode == "Empty" or mode == "Delete") and thisDay != "None":
- summary = "Robot - Removing category " + src + " per [[WP:CFD|CFD]] at " + thisDay + "."
+ summary = ("Robot - Removing category %s per [[WP:CFD|CFD]] "
+ "at %s.") % (src, thisDay)
else:
continue
- robot = category.CategoryRemoveRobot(catTitle=src, batchMode=True, editSummary=summary,
- useSummaryForDeletion=True, inPlace=True)
+ robot = category.CategoryRemoveRobot(catTitle=src, batchMode=True,
+ editSummary=summary,
+ useSummaryForDeletion=True,
+ inPlace=True)
else:
- # This line does not fit any of our regular expressions, so ignore it.
+ # This line does not fit any of our regular expressions, so ignore
+ # it.
pass
if summary != "" and robot is not None:
pywikibot.output(summary, toStdout=True)
@@ -169,12 +192,14 @@
elif paramName == 'year':
year = paramVal
if day and month and year:
- return "[[Wikipedia:Categories for discussion/Log/%s %s %s]]" % (year, month, day)
+ return (
+ "[[Wikipedia:Categories for discussion/Log/%s %s %s]]"
+ % (year, month, day))
return oldDay
+
if __name__ == "__main__":
try:
main()
finally:
pywikibot.stopme()
-
--
To view, visit https://gerrit.wikimedia.org/r/95758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3b7a82579d4cc37cd4f3f5081118e9329de29144
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8]ify censure.py
......................................................................
[PEP8]ify censure.py
Change-Id: I099529ab6a61291d3b0bd60da6813b7765684da5
---
M censure.py
1 file changed, 32 insertions(+), 19 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/censure.py b/censure.py
index 5d0754a..856d765 100644
--- a/censure.py
+++ b/censure.py
@@ -21,29 +21,34 @@
logPages = {
'hu.wikipedia': u'Wikipédia:Potenciálisan vandalizmus áldozatául esett szócikkek',
- }
+}
# To add a new language, create or find the bad word page
-# similarly to the 'hu.wikipedia' one (one word per line, starting with <pre> and ending with </pre> lines),
-# and add to the badWordList lines below.
+# similarly to the 'hu.wikipedia' one (one word per line, starting with <pre>
+# and ending with </pre> lines), and add to the badWordList lines below.
badWordList = {
'hu.wikipedia': u'User:Cenzúrabot/lista',
- }
+}
site = pywikibot.getSite()
-if not (site.language() + '.' + site.family.name) in badWordList or not (site.language() + '.' + site.family.name) in logPages:
- pywikibot.error('your language isn\'t supported, see the source code for further details')
+if not (site.language() + '.' + site.family.name) in badWordList or \
+ not (site.language() + '.' + site.family.name) in logPages:
+ pywikibot.error('your language isn\'t supported, see the source code for '
+ 'further details')
sys.exit(1)
-ownWordPage = pywikibot.Page(site, badWordList[site.language() + '.' + site.family.name])
+ownWordPage = pywikibot.Page(site, badWordList[site.language() + '.' +
+ site.family.name])
try:
- ownWordList = ownWordPage.get(get_redirect = True)
+ ownWordList = ownWordPage.get(get_redirect=True)
except pywikibot.NoPage:
- pywikibot.error('the page containing the bad word list of your language doesn\'t exist')
+ pywikibot.error('the page containing the bad word list of your language '
+ 'doesn\'t exist')
sys.exit(1)
ownWordList = ownWordList.split('\n')
del ownWordList[0]
del ownWordList[len(ownWordList) - 1]
+
def seekbpos(str1, str2):
i = 0
@@ -52,6 +57,7 @@
return i
i += 1
return i
+
def seekepos(str1, str2, bpos):
i1 = len(str1) - 1
@@ -65,10 +71,11 @@
i2 -= 1
return -1
-def checkPage(title, onlyLastDiff = False):
+
+def checkPage(title, onlyLastDiff=False):
if title == logPages[site.language() + '.' + site.family.name]:
return
- pywikibot.output(u'Checking %s for bad word list' %title)
+ pywikibot.output(u'Checking %s for bad word list' % title)
page = pywikibot.Page(site, title)
try:
text = page.get()
@@ -76,7 +83,8 @@
try:
oldver = page.getOldVersion(page.previousRevision())
except IndexError:
- pywikibot.output(u'Page %s has no version history, skipping' %title)
+ pywikibot.output(u'Page %s has no version history, skipping'
+ % title)
return
if len(text) > len(oldver):
bpos = seekbpos(oldver, text)
@@ -84,10 +92,10 @@
diff = text[bpos:epos]
text = diff
except pywikibot.NoPage:
- pywikibot.output(u'Page %s doesn\'t exist, skipping' %title)
+ pywikibot.output(u'Page %s doesn\'t exist, skipping' % title)
return
except pywikibot.IsRedirectPage:
- pywikibot.output(u'Page %s is a redirect, skipping' %title)
+ pywikibot.output(u'Page %s is a redirect, skipping' % title)
return
report = False
@@ -97,24 +105,29 @@
wordsIn.append(badWord)
report = True
if report:
- logPage = pywikibot.Page(site, logPages[site.language() + '.' + site.family.name])
+ logPage = pywikibot.Page(site, logPages[site.language() + '.' +
+ site.family.name])
try:
log = logPage.get()
except:
pass
- pywikibot.output(u'%s matches the bad word list' %title)
- log = '* [' + page.permalink()+ ' ' + title + '] - ' + ' '.join(wordsIn) + '\n' + log
+ pywikibot.output(u'%s matches the bad word list' % title)
+ log = '* [%s %s] - ' % (page.permalink(),
+ title) + ' '.join(wordsIn) + '\n' + log
logPage.put(log, title)
else:
- pywikibot.output(u'%s doesn\'t match any of the bad word list' %title)
+ pywikibot.output(u'%s doesn\'t match any of the bad word list' % title)
+
def main():
- pywikibot.warning('this script should not be run manually/directly, but automatically by maintainer.py')
+ pywikibot.warning('this script should not be run manually/directly, but '
+ 'automatically by maintainer.py')
if len(sys.argv) == 1:
pywikibot.output("Usage: censure.py <article title>")
sys.exit(1)
del sys.argv[0]
checkPage(' '.join(sys.argv).decode('utf-8'))
+
if __name__ == "__main__":
main()
--
To view, visit https://gerrit.wikimedia.org/r/95757
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I099529ab6a61291d3b0bd60da6813b7765684da5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: (Bug 56531): Ignore Version ID for SVN repository
......................................................................
(Bug 56531): Ignore Version ID for SVN repository
SVN repository does not replace ID keyword and searching for
the keyword ID does raise an exception.
Thus we ignore that part of code.
Maybe we could get this information from version.py but because
that code does not work properly yet, this could be a second
part.
Change-Id: Icd7384908ebc6409aee17c435f659681bd530f71
---
M pywikibot/bot.py
1 file changed, 10 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
Pyfisch: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index b885a6a..2db129f 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -3,7 +3,7 @@
User-interface related functions for building bots
"""
#
-# (C) Pywikibot team, 2008-2012
+# (C) Pywikibot team, 2008-2013
#
# Distributed under the terms of the MIT license.
#
@@ -20,6 +20,7 @@
import os
import os.path
import sys
+import re
_logger = "bot"
@@ -244,7 +245,7 @@
except AttributeError:
return
- log(u'=== Pywikipediabot framework v2.0 -- Logging header ===')
+ log(u'=== Pywikibot framework v2.0 -- Logging header ===')
# script call
log(u'COMMAND: %s' % unicode(sys.argv))
@@ -625,8 +626,6 @@
init_handlers()
if config.verbose_output:
- import re
- ver = pywikibot.__version__ # probably can be improved on
# Please don't change the regular expression here unless you really
# have to - some git versions (like 1.7.0.4) seem to treat lines
# containing just `$Id:` as if they were ident lines (see
@@ -634,8 +633,13 @@
# replacement with `$Id$`
# or `$Id$`.
m = re.search(r"\$Id"
- r": (\w+) \$", ver)
- pywikibot.output(u'Pywikipediabot r%s' % m.group(1))
+ r": (\w+) \$", pywikibot.__version__)
+ if m:
+ pywikibot.output(u'Pywikibot r%s' % m.group(1))
+ else:
+ # Version ID not availlable on SVN repository.
+ # Maybe these informations should be imported from version.py
+ pywikibot.output(u'Pywikibot SVN repository')
pywikibot.output(u'Python %s' % sys.version)
if do_help:
--
To view, visit https://gerrit.wikimedia.org/r/93313
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd7384908ebc6409aee17c435f659681bd530f71
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Pyfisch <pyfisch(a)googlemail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Show __doc__ if pwb.py is called without arguments
......................................................................
Show __doc__ if pwb.py is called without arguments
Change-Id: I96ee324611fdd77ef48ce78aafa9b7466cb7723f
---
M pwb.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
Pyfisch: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index 1c49181..d0e1aeb 100644
--- a/pwb.py
+++ b/pwb.py
@@ -124,3 +124,5 @@
else:
raise Exception("%s not found!" % fn)
run_python_file(fn, argv, argvu)
+elif __name__ == "__main__":
+ print __doc__
--
To view, visit https://gerrit.wikimedia.org/r/92832
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I96ee324611fdd77ef48ce78aafa9b7466cb7723f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Pyfisch <pyfisch(a)googlemail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot