Skip to content

Commit fc3b707

Browse files
author
xqt
committed
stripped trailing whitespace
1 parent b8e7242 commit fc3b707

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+591
-591
lines changed

archivebot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
Trancluded template may contain the following parameters:
1919
20-
{{TEMPLATE_PAGE
20+
{{TEMPLATE_PAGE
2121
|archive =
2222
|algo =
2323
|counter =
@@ -253,13 +253,13 @@ def generateTransclusions(Site, template, namespaces=[], eicontinue=''):
253253
}
254254
if eicontinue:
255255
qdata['eicontinue'] = eicontinue
256-
256+
257257
pywikibot.output(u'Fetching template transclusions...')
258258
response, result = query.GetData(qdata, Site, back_response = True)
259-
259+
260260
for page_d in result['query']['embeddedin']:
261261
yield pywikibot.Page(Site, page_d['title'])
262-
262+
263263
if 'query-continue' in result:
264264
eicontinue = result['query-continue']['embeddedin']['eicontinue']
265265
for page in generateTransclusions(Site, template, namespaces,

blockreview.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BlockreviewBot:
3131
note_admin = {
3232
'de': u"\n\n== Sperrprüfungswunsch ==\nHallo %(admin)s, \n\n[[%(user)s]] wünscht diePrüfung seiner/ihrer Sperre vom %(time)s über die Dauer von %(duration)s. Kommentar war ''%(comment)s''. Bitte äußere Dich dazu auf der [[%(usertalk)s#%(section)s|Diskussionsseite]]. -~~~~"
3333
}
34-
34+
3535
note_project = {
3636
'de': u"\n\n== [[%(user)s]] ==\n* gesperrt am %(time)s durch {{Benutzer|%(admin)s}} für eine Dauer von %(duration)s.\n* Kommentar war ''%(comment)s''.\n* [[Benutzer:%(admin)s]] wurde [[Benutzer Diskussion:%(admin)s#Sperrprüfungswunsch|benachrichtigt]].\n* [[%(usertalk)s#%(section)s|Link zur Diskussion]]\n:<small>-~~~~</small>\n;Antrag entgegengenommen"
3737
}
@@ -133,13 +133,13 @@ def treat(self, userPage):
133133
gen = pg.PreloadingGenerator(self.SysopGenerator())
134134
for sysop in gen:
135135
print sysop.title()
136-
136+
137137
talkText = talkText.replace(u'{{%s}}' % unblock_tpl,
138138
u'{{%s|2}}' % unblock_tpl)
139139
talkText = talkText.replace(u'{{%s|1}}' % unblock_tpl,
140140
u'{{%s|2}}' % unblock_tpl)
141141
talkComment = pywikibot.translate(self.site.lang, self.msg_user % self.parts)
142-
142+
143143
# some test stuff
144144
if pywikibot.debug and self.site().loggedInAs() == u'Xqbot:':
145145
testPage = pywikibot.Page(self.site, 'Benutzer:Xqt/Test')

botlist.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -*- coding: utf-8 -*-
22
"""
33
Allows access to the site's bot user list.
4-
4+
55
The function refresh() downloads the current bot user list and saves
66
it to disk. It is run automatically when a bot first tries to get this
77
data.
88
"""
9-
9+
1010
# (C) Daniel Herding, 2005
1111
# (C) Dr. Trigon, 2009-2010
1212
#
@@ -16,14 +16,14 @@
1616
#
1717
__version__='$Id$'
1818
#
19-
19+
2020
import re, sys, pickle
2121
import os.path
2222
import time
2323
import wikipedia as pywikibot
24-
24+
2525
cache = {}
26-
26+
2727
def get(site = None):
2828
if site is None:
2929
site = pywikibot.getSite()
@@ -49,27 +49,27 @@ def get(site = None):
4949
# create cached copy
5050
cache[site] = botlist
5151
return botlist
52-
52+
5353
def isBot(user, site=None):
5454
botlist = get(site)
5555
return user in botlist
56-
56+
5757
def refresh(site, sysop=False, witheditsonly=True):
5858
#if not site.has_api() or site.versionnumber() < 10:
5959
# _refreshOld(site)
60-
60+
6161
# get botlist special page's URL
6262
if not site.loggedInAs(sysop=sysop):
6363
site.forceLogin(sysop=sysop)
64-
64+
6565
params = {
6666
'action': 'query',
6767
'list': 'allusers',
6868
'augroup': 'bot',
6969
}
7070
if witheditsonly:
7171
params['auwitheditsonly'] = ''
72-
72+
7373
pywikibot.output(u'Retrieving bot user list for %s via API.' % repr(site))
7474
pywikibot.put_throttle() # It actually is a get, but a heavy one.
7575
botlist = []
@@ -78,7 +78,7 @@ def refresh(site, sysop=False, witheditsonly=True):
7878
if 'error' in data:
7979
raise RuntimeError('ERROR: %s' % data)
8080
botlist.extend([w['name'] for w in data['query']['allusers']])
81-
81+
8282
if 'query-continue' in data:
8383
params['aufrom'] = data['query-continue']['allusers']['aufrom']
8484
else:
@@ -112,13 +112,13 @@ def refresh(site, sysop=False, witheditsonly=True):
112112
# The file is stored in the botlists subdir. Create if necessary.
113113
if sysop:
114114
f = open(pywikibot.config.datafilepath('botlists',
115-
'botlist-%s-%s-sysop.dat' % (site.family.name, site.lang)), 'w')
115+
'botlist-%s-%s-sysop.dat' % (site.family.name, site.lang)), 'w')
116116
else:
117117
f = open(pywikibot.config.datafilepath('botlists',
118118
'botlist-%s-%s.dat' % (site.family.name, site.lang)), 'w')
119119
pickle.dump(botlist, f)
120120
f.close()
121-
121+
122122
#def refresh_all(new = False, sysop=False):
123123
# if new:
124124
# import config
@@ -170,5 +170,5 @@ def refresh(site, sysop=False, witheditsonly=True):
170170
# main()
171171
# finally:
172172
# pywikibot.stopme()
173-
173+
174174

capitalize_redirects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-always Don't prompt to make changes, just do them.
1313
1414
-titlecase creates a titlecased redirect version of a given page
15-
where all words of the title start with an uppercase
15+
where all words of the title start with an uppercase
1616
character and the remaining characters are lowercase.
1717
1818
Example: "python capitalize_redirects.py -start:B -always"

category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ def main(*args):
13741374
gen = genFactory.getCombinedGenerator()
13751375
if not gen:
13761376
#default for backwords compatibility
1377-
genFactory.handleArg('-links')
1377+
genFactory.handleArg('-links')
13781378
# The preloading generator is responsible for downloading multiple
13791379
# pages from the wiki simultaneously.
13801380
gen = pagegenerators.PreloadingGenerator(

catlib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _parseCategory(self, purge=False, startFrom=None):
185185
for tag, page in self._oldParseCategory(purge, startFrom):
186186
yield tag, page
187187
return
188-
188+
189189
currentPageOffset = None
190190
params = {
191191
'action': 'query',
@@ -349,7 +349,7 @@ def subcategories(self, recurse=False, startFrom=None, cacheResults=False):
349349
equivalent to recurse = False, recurse = 1 gives first-level
350350
subcategories of subcategories but no deeper, etcetera).
351351
352-
cacheResults - cache the category contents: useful if you need to
352+
cacheResults - cache the category contents: useful if you need to
353353
do several passes on the category members list. The simple cache
354354
system is *not* meant to be memory or cpu efficient for large
355355
categories
@@ -386,7 +386,7 @@ def articles(self, recurse=False, startFrom=None, cacheResults=False):
386386
Recurse can be a number to restrict the depth at which subcategories
387387
are included.
388388
389-
cacheResults - cache the category contents: useful if you need to
389+
cacheResults - cache the category contents: useful if you need to
390390
do several passes on the category members list. The simple cache
391391
system is *not* meant to be memory or cpu efficient for large
392392
categories
@@ -602,7 +602,7 @@ def categoryAllElementsAPI(CatName, cmlimit = 5000, categories_parsed = [], site
602602
Category to load all the elements in a category using the APIs. Limit: 5000 elements.
603603
"""
604604
wikipedia.output("Loading %s..." % CatName)
605-
605+
606606
params = {
607607
'action' :'query',
608608
'list' :'categorymembers',

censure.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@
4545
del ownWordList[0]
4646
del ownWordList[len(ownWordList) - 1]
4747

48-
def seekbpos(str1, str2):
49-
i = 0
50-
while i < len(str1):
51-
if str1[i] != str2[i]:
52-
return i
53-
i += 1
54-
return i
55-
56-
def seekepos(str1, str2, bpos):
57-
i1 = len(str1) - 1
58-
i2 = len(str2) - 1
59-
while i1 > -1 and i2 > -1:
60-
if i1 == bpos:
61-
return i2
62-
elif i1 < bpos or str1[i1] != str2[i2]:
63-
return i2 + 1
64-
i1 -= 1
65-
i2 -= 1
66-
return -1
48+
def seekbpos(str1, str2):
49+
i = 0
50+
while i < len(str1):
51+
if str1[i] != str2[i]:
52+
return i
53+
i += 1
54+
return i
55+
56+
def seekepos(str1, str2, bpos):
57+
i1 = len(str1) - 1
58+
i2 = len(str2) - 1
59+
while i1 > -1 and i2 > -1:
60+
if i1 == bpos:
61+
return i2
62+
elif i1 < bpos or str1[i1] != str2[i2]:
63+
return i2 + 1
64+
i1 -= 1
65+
i2 -= 1
66+
return -1
6767

6868
def checkPage(title, onlyLastDiff = False):
6969
if title == logPages[site.language() + '.' + site.family.name]:
@@ -79,7 +79,7 @@ def checkPage(title, onlyLastDiff = False):
7979
pywikibot.output(u'Page %s has no version history, skipping' %title)
8080
return
8181
if len(text) > len(oldver):
82-
bpos = seekbpos(oldver, text)
82+
bpos = seekbpos(oldver, text)
8383
epos = seekepos(oldver, text, bpos)
8484
diff = text[bpos:epos]
8585
text = diff

0 commit comments

Comments
 (0)