Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282460

Change subject: [tox] Shorten some lines
......................................................................

[tox] Shorten some lines

Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d
---
M checkvotes.py
M tox.ini
2 files changed, 13 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/xqbot 
refs/changes/60/282460/1

diff --git a/checkvotes.py b/checkvotes.py
index 7e61cc0..0c7ff9f 100644
--- a/checkvotes.py
+++ b/checkvotes.py
@@ -133,7 +133,6 @@
     urlRegex = re.compile(
         r'\[(?:http:)?//tools.wmflabs.org/(%s)\?([^ ]*?) +.*?\]' % SB_TOOL)
     url = urlRegex.findall(text)[1]  # zweites Auftreten nehmen
-    # R = re.compile(r'\* *\[\[Wikipedia:Schiedsgericht/Wahl/Mai 
2010/(.+?)\|.+?\]\] \**')
     R = re.compile(r'[#\*] *\[\[/(.+?)/\]\]')
     for pagename in R.findall(text):
         if votepage == '' or votepage == pagename:
@@ -161,7 +160,8 @@
                     d['stunde'] = d['stunde1']
                 if 'minute1' in d:
                     d['minute'] = d['minute1']
-                s = 
'day=%(tag1)s&mon=%(monat1)s&year=%(jahr1)s&hour=%(stunde)s&min=%(minute)s' % d
+                s = ('day=%(tag1)s&mon=%(monat1)s&year=%(jahr1)s'
+                     '&hour=%(stunde)s&min=%(minute)s' % d)
                 return (SB_TOOL, s)
         return
     elif url:
@@ -233,10 +233,12 @@
                 return
         # regex = 
re.compile(ur"^#[^#:]*?\[\[Benutzer:(?P<user>[^/]+?)[\||\]]", re.MULTILINE)
         # regex = 
re.compile(ur"^#[^#:]*?\[\[(?:[b|B]enutzer|[u|U]ser):(?P<user>[^/]+?)[\||\]].*?(?P<hour>\d\d):(?P<min>\d\d),
 (?P<day>\d\d?)\. (?P<month>\w+)\.? (?P<year>\d\d\d\d) \(CES?T\)",
-##        regex = 
re.compile(ur"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P<talk>[_
 ]Diskussion|[_ 
]talk)?:(?:Beiträge/)?(?P<user>[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P<hour>\d\d):(?P<min>\d\d),
 (?P<day>\d\d?)\. (?P<month>\w+)\.? (?P<year>\d\d\d\d) \(CES?T\)",
-##                           re.MULTILINE|re.UNICODE)
-        regex = 
re.compile(r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P<talk>[_
 ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P<user>[^/#]+?) 
*(?:/[^\\\]])?[\||\]].*?(?P<hour>\d\d):(?P<min>\d\d), (?P<day>\d\d?)\. 
(?P<month>\w+)\.? (?P<year>\d\d\d\d) \(CES?T\)',
-                           re.MULTILINE | re.UNICODE)
+##        regex = re.compile(
+##            
r"^#[^#:]*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P<talk>[_
 ]Diskussion|[_ 
]talk)?:(?:Beiträge/)?(?P<user>[^/#]+?)(?:/[^\\\]])?[\||\]].*?(?P<hour>\d\d):(?P<min>\d\d),
 (?P<day>\d\d?)\. (?P<month>\w+)\.? (?P<year>\d\d\d\d) \(CES?T\)",
+##            re.MULTILINE|re.UNICODE)
+        regex = re.compile(
+            
r'^#(?!:).*?(?:\[http:.+?\])?[^#:]*?(?:<.+?>)?\[\[(?:[bB]enutzer(?:in)?|[uU]ser|BD|Spezial)(?P<talk>[_
 ]Diskussion|[_ ]talk)?:(?:Beiträge/)?(?P<user>[^/#]+?) 
*(?:/[^\\\]])?[\||\]].*?(?P<hour>\d\d):(?P<min>\d\d), (?P<day>\d\d?)\. 
(?P<month>\w+)\.? (?P<year>\d\d\d\d) \(CES?T\)',
+            re.MULTILINE | re.UNICODE)
         i = 0
         pywikibot.output('\nCheck votings for %s' % page.title(asLink=True))
         self.summary = pywikibot.translate(self.site, self.msg)
@@ -291,9 +293,11 @@
             target_user = user
             while not target_user.exists() or not target_user.editCount():
                 if target_user.getUserPage().isRedirectPage():
-                    target_username = 
user.getUserPage().getRedirectTarget().title(withNamespace=False)
+                    target_username = 
user.getUserPage().getRedirectTarget().title(
+                        withNamespace=False)
                     if target_username in seen and last != target_username:
-                        pywikibot.output('%s already seen on this page' % 
target_username)
+                        pywikibot.output('%s already seen on this page'
+                                         % target_username)
                         break
                     seen.add(target_username)
                     target_user = pywikibot.User(self.site, target_username)
diff --git a/tox.ini b/tox.ini
index 77eb0e0..6db3873 100644
--- a/tox.ini
+++ b/tox.ini
@@ -31,4 +31,4 @@
 ; E402 module level import not at top of file (T87409)
 ignore = E115,E266,E402
 exclude = .tox,.git,./*.egg,ez_setup.py,build
-max_line_length = 304
+max_line_length = 289

-- 
To view, visit https://gerrit.wikimedia.org/r/282460
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I514df5e5664faccdb7e2424d9f829aaa5c38e55d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/xqbot
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to