jenkins-bot has submitted this change and it was merged.
Change subject: PEP257 on pywikibot folder part I ......................................................................
PEP257 on pywikibot folder part I
files: bot, date and editor. Checked by hand and added some suggestions based on this change: I910fdd7ce36752fa44b9a6654d7b8509e5020dee
Change-Id: I59a2b271bee8c0a9a37db28ef0fa66f69ad30412 --- M pywikibot/bot.py M pywikibot/date.py M pywikibot/editor.py 3 files changed, 27 insertions(+), 24 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 2417922..bdf5915 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -""" -User-interface related functions for building bots -""" +"""User-interface related functions for building bots""" # # (C) Pywikibot team, 2008-2013 # diff --git a/pywikibot/date.py b/pywikibot/date.py index c6b1944..1d39f77 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -79,63 +79,69 @@ # Various filters are item dependent. # def dh_noConv(value, pattern, limit): - """decoding helper for a single integer value, no conversion, no rounding""" + """Helper for decoding a single integer value, no conversion, no rounding.""" return dh(value, pattern, encNoConv, decSinglVal, limit)
def dh_dayOfMnth(value, pattern): - """decoding helper for a single integer value <=31, no conversion, - no rounding (used in days of month) + """ + Helper for decoding a single integer value.
+ The single integer should be <=31, no conversion, + no rounding (used in days of month). """ # For now use January because it has all 31 days return dh_noConv(value, pattern, formatLimits[dayMnthFmts[0]][0])
def dh_mnthOfYear(value, pattern): - """decoding helper for a single integer value >=1000, no conversion, - no rounding (used in month of the year) + """ + Helper for decoding a single integer value.
+ The value should be >=1000, no conversion, + no rounding (used in month of the year) """ return dh_noConv(value, pattern, _formatLimit_MonthOfYear[0])
def dh_decAD(value, pattern): - """decoding helper for a single integer value, no conversion, - round to decimals (used in decades) + """ + Helper for decoding a single integer value.
+ It should be no conversion, round to decimals (used in decades) """ return dh(value, pattern, encDec0, decSinglVal, formatLimits['DecadeAD'][0])
def dh_decBC(value, pattern): - """decoding helper for a single integer value, no conversion, - round to decimals (used in decades) + """ + Helper for decoding a single integer value.
+ It should be no conversion, round to decimals (used in decades) """ return dh(value, pattern, encDec0, decSinglVal, formatLimits['DecadeBC'][0])
def dh_yearBC(value, pattern): - """decoding helper for a year value, no conversion, no rounding, - limits to 3000 + """Helper for decoding a year value.
+ The value should have no conversion, no rounding, limits to 3000. """ return dh_noConv(value, pattern, formatLimits['YearBC'][0])
def dh_yearAD(value, pattern): - """decoding helper for a year value, no conversion, no rounding, - limits to 3000 + """Helper for decoding a year value.
+ The value should have no conversion, no rounding, limits to 3000. """ return dh_noConv(value, pattern, formatLimits['YearAD'][0])
def dh_simpleYearAD(value): - """decoding helper for a single integer value representing a year with - no extra symbols + """Helper for decoding a single integer value.
+ This value should be representing a year with no extra symbols. """ return dh_yearAD(value, u'%d')
@@ -332,10 +338,11 @@
def escapePattern2(pattern): - """Convert a string pattern into a regex expression and cache. - Allows matching of any _digitDecoders inside the string. - Returns a compiled regex object and a list of digit decoders + """ + Convert a string pattern into a regex expression and cache.
+ Allows matching of any _digitDecoders inside the string. + Returns a compiled regex object and a list of digit decoders. """
if pattern not in _escPtrnCache2: diff --git a/pywikibot/editor.py b/pywikibot/editor.py index e921d49..1b6b1b5 100644 --- a/pywikibot/editor.py +++ b/pywikibot/editor.py @@ -1,8 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -""" -Text editor class for your favourite editor. -""" +"""Text editor class for your favourite editor."""
# # (C) Gerrit Holl, 2004
pywikibot-commits@lists.wikimedia.org