jenkins-bot has submitted this change and it was merged.
Change subject: Split too long lines ......................................................................
Split too long lines
Started with longest lines. Based on report of xZise
Change-Id: I4795cee52bcf76c8cff240b344df5be7febb851b --- M generate_family_file.py M pywikibot/botirc.py M pywikibot/families/wowwiki_family.py M pywikibot/fixes.py M scripts/blockreview.py M scripts/checkimages.py M scripts/clean_sandbox.py M scripts/version.py M scripts/welcome.py M tests/deprecation_tests.py M tox.ini 11 files changed, 131 insertions(+), 51 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/generate_family_file.py b/generate_family_file.py index 2dd21e4..8655513 100644 --- a/generate_family_file.py +++ b/generate_family_file.py @@ -129,7 +129,9 @@ if len(self.langs) > 1: if self.dointerwiki is None: makeiw = raw_input( - "\nThere are %i languages available.\nDo you want to generate interwiki links? This might take a long time. ([y]es/[N]o/[e]dit)" + "\nThere are %i languages available." + "\nDo you want to generate interwiki links?" + "This might take a long time. ([y]es/[N]o/[e]dit)" % len(self.langs)).lower() else: makeiw = self.dointerwiki diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py index 7ec9b99..ce5e1d3 100644 --- a/pywikibot/botirc.py +++ b/pywikibot/botirc.py @@ -56,7 +56,10 @@ self.api_url += '?action=query&meta=siteinfo&siprop=statistics&format=xml' self.api_found = re.compile(r'articles="(.*?)"') self.re_edit = re.compile( - r'^C14[[^C07(?P<page>.+?)^C14]]^C4 (?P<flags>.*?)^C10 ^C02(?P<url>.+?)^C ^C5*^C ^C03(?P<user>.+?)^C ^C5*^C (?^B?(?P<bytes>[+-]?\d+?)^B?) ^C10(?P<summary>.*)^C'.replace('^B', '\002').replace('^C', '\003').replace('^U', '\037')) + r'^C14[[^C07(?P<page>.+?)^C14]]^C4 (?P<flags>.*?)^C10 ^C02' + r'(?P<url>.+?)^C ^C5*^C ^C03(?P<user>.+?)^C ^C5*^C (?^B?' + r'(?P<bytes>[+-]?\d+?)^B?) ^C10(?P<summary>.*)^C' + .replace('^B', '\002').replace('^C', '\003').replace('^U', '\037'))
def on_nicknameinuse(self, c, e): c.nick(c.get_nickname() + "_") diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py index fbf820e..25289cc 100644 --- a/pywikibot/families/wowwiki_family.py +++ b/pywikibot/families/wowwiki_family.py @@ -55,7 +55,11 @@ self.disambcatname['en'] = "Disambiguations"
# Wikia's default CategorySelect extension always puts categories last - self.categories_last = ['cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it', 'ja', 'ko', 'lt', 'lv', 'nl', 'no', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sk', 'sr', 'sv', 'tr', 'zh-tw', 'zh'] + self.categories_last = [ + 'cs', 'da', 'de', 'el', 'en', 'es', 'fa', + 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it', 'ja', 'ko', 'lt', 'lv', + 'nl', 'no', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sk', 'sr', 'sv', + 'tr', 'zh-tw', 'zh']
def scriptpath(self, code): """Return the script path for this family.""" diff --git a/pywikibot/fixes.py b/pywikibot/fixes.py index 5a7f09e..e2e3e4e 100644 --- a/pywikibot/fixes.py +++ b/pywikibot/fixes.py @@ -113,14 +113,21 @@ # (u'([Ww]eder) ([^,.]+?), noch', r'\1 \2 noch'), # # Vorsicht bei Substantiven, z. B. 3-Jähriger! - (u'(\d+)(minütig|stündig|tägig|wöchig|jährig|minütlich|stündlich|täglich|wöchentlich|jährlich|fach|mal|malig|köpfig|teilig|gliedrig|geteilt|elementig|dimensional|bändig|eckig|farbig|stimmig)', r'\1-\2'), + (u'(\d+)(minütig|stündig|tägig|wöchig|jährig|minütlich|stündlich' + u'|täglich|wöchentlich|jährlich|fach|mal|malig|köpfig|teilig' + u'|gliedrig|geteilt|elementig|dimensional|bändig|eckig|farbig' + u'|stimmig)', r'\1-\2'), # zusammengesetztes Wort, Bindestrich wird durchgeschleift - (u'(?<!\w)(\d+|\d+[.,]\d+)($|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)([²³]?-[\w[])', r'\1-\2\3'), + (u'(?<!\w)(\d+|\d+[.,]\d+)($|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min' + u'|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal' + u'|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)([²³]?-[\w[])', r'\1-\2\3'), # Größenangabe ohne Leerzeichen vor Einheit # weggelassen wegen vieler falsch Positiver: s, A, V, C, S, J, % - (u'(?<!\w)(\d+|\d+[.,]\d+)($|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)(?=\W|²|³|$)', r'\1 \2'), + (u'(?<!\w)(\d+|\d+[.,]\d+)($|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min' + u'|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal' + u'|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)(?=\W|²|³|$)', r'\1 \2'), # Temperaturangabe mit falsch gesetztem Leerzeichen - (u'(?<!\w)(\d+|\d+[.,]\d+)° C(?=\W|²|³|$)', r'\1' + u' °C'), + (u'(?<!\w)(\d+|\d+[.,]\d+)° C(?=\W|²|³|$)', r'\1' + u' °C'), # Kein Leerzeichen nach Komma (u'([a-zäöüß](]])?,)(([[)?[a-zäöüA-ZÄÖÜ])', r'\1 \3'), # Leerzeichen und Komma vertauscht @@ -430,10 +437,15 @@ # and copying back the results.
# ur'ISBN (978|979) *[- −.‐-―] *(\d+) *[- −.‐-―] *(\d+) *[- −.‐-―] *(\d+) *[- −.‐-―] *(\d)(?!\d)' - (u'ISBN (978|979) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] *(\d)(?!\d)', r'ISBN \1-\2-\3-\4-\5'), # ISBN-13 + (u'ISBN (978|979) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- ' + u'\u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] ' + u'*(\d+) *[\- \u2212\.\u2010-\u2015] *(\d)(?!\d)', + r'ISBN \1-\2-\3-\4-\5'), # ISBN-13
# ur'ISBN (\d+) *[- −.‐-―] *(\d+) *[- −.‐-―] *(\d+) *[- −.‐-―] *(\d|X|x)(?!\d)' - (u'ISBN (\d+) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] *(\d|X|x)(?!\d)', r'ISBN \1-\2-\3-\4'), # ISBN-10 + (u'ISBN (\d+) *[\- \u2212\.\u2010-\u2015] *(\d+) *[\- ' + u'\u2212\.\u2010-\u2015] *(\d+) *[\- \u2212\.\u2010-\u2015] ' + '*(\d|X|x)(?!\d)', r'ISBN \1-\2-\3-\4'), # ISBN-10 # missing space before ISBN-10 or before ISBN-13, # or non-breaking space. (r'ISBN(| | )((\d(-?)){12}\d|(\d(-?)){9}[\dXx])', r'ISBN \2'), diff --git a/scripts/blockreview.py b/scripts/blockreview.py index 434afba..ec8f8ea 100644 --- a/scripts/blockreview.py +++ b/scripts/blockreview.py @@ -32,24 +32,20 @@
# notes note_admin = { - 'de': u""" - -== Sperrprüfungswunsch == -Hallo %(admin)s, - -[[%(user)s]] wünscht die Prü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]]. -~~~~""" + 'de': u"\n\n== Sperrprüfungswunsch ==\nHallo %(admin)s,\n\n[[%(user)s]]" + u" wünscht die Prüfung seiner/ihrer Sperre vom %(time)s über die " + u"Dauer von %(duration)s. Kommentar war ''%(comment)s''. " + u"Bitte äußere Dich dazu auf der [[%(usertalk)s#%(section)s|" + u"Diskussionsseite]]. -~~~~""" }
note_project = { - 'de': u""" - -== [[%(user)s]] == -* gesperrt am %(time)s durch {{Benutzer|%(admin)s}} für eine Dauer von %(duration)s. -* Kommentar war ''%(comment)s''. -* [[Benutzer:%(admin)s]] wurde [[Benutzer Diskussion:%(admin)s#Sperrprüfungswunsch|benachrichtigt]]. -* [[%(usertalk)s#%(section)s|Link zur Diskussion]] -:<small>-~~~~</small> -;Antrag entgegengenommen""" + 'de': u"\n\n== [[%(user)s]] ==\n* gesperrt am %(time)s durch " + u"{{Benutzer|%(admin)s}} für eine Dauer von %(duration)s.\n" + u"* Kommentar war ''%(comment)s''.\n* [[Benutzer:%(admin)s]]" + u" wurde [[Benutzer Diskussion:%(admin)s#Sperrprüfungswunsch|" + u"benachrichtigt]].\n* [[%(usertalk)s#%(section)s|Link zur " + u"Diskussion]]\n\n:<small>-~~~~</small>\n\n;Antrag entgegengenommen" }
# edit summaries diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 66b1aee..11cdf22 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -331,8 +331,12 @@ # The message that the bot will add the second time that find another license # problem. second_message_without_license = { - 'hu': u'\nSzia! Úgy tűnik a [[:Kép:%s]] képpel is hasonló a probléma, mint az előbbivel. Kérlek olvasd el a [[WP:KÉPLIC|feltölthető képek]]ről szóló oldalunk, és segítségért fordulj a [[WP:KF-JO|Jogi kocsmafalhoz]]. Köszönöm --~~~~', - 'it': u':{{subst:Progetto:Coordinamento/Immagini/Bot/Messaggi/Senza licenza2|%s|__botnick__}} --~~~~', + 'hu': u'\nSzia! Úgy tűnik a [[:Kép:%s]] képpel is hasonló a probléma, ' + u'mint az előbbivel. Kérlek olvasd el a [[WP:KÉPLIC|feltölthető ' + u'képek]]ről szóló oldalunk, és segítségért fordulj a [[WP:KF-JO|' + u'Jogi kocsmafalhoz]]. Köszönöm --~~~~', + 'it': u':{{subst:Progetto:Coordinamento/Immagini/Bot/Messaggi/Senza' + u'licenza2|%s|__botnick__}} --~~~~', }
# You can add some settings to a wiki page. In this way, you can change them diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index bf43e9b..597b0a2 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -58,14 +58,22 @@ content = { 'commons': u'{{Sandbox}}\n<!-- Please edit only below this line. -->', 'als': u'{{subst:/Vorlage}}', - 'ar': u'{{عنوان الملعب}}\n<!-- مرحبا! خذ راحتك في تجربة مهارتك في التنسيق والتحرير أسفل هذا السطر. هذه الصفحة لتجارب التعديل ، سيتم تفريغ هذه الصفحة كل 12 ساعة. -->', - 'arz': '{{عنوان السبوره}}\n<!-- مرحبا! خد راحتك فى تجريب مهاراتك فى\nالتحرير تحت الخط ده. بما إن الصفحه دى لتجارب التعديل، فالصفحه دى حيتم تنضيفها\nاوتوماتيكيا كل 12 ساعه. -->', - 'az': u'<!--- LÜTFƏN, BU SƏTRƏ TOXUNMAYIN --->\n{{Qaralama dəftəri}}\n<!-- AŞAĞIDAKI XƏTTİN ALTINDAN YAZA BİLƏRSİNİZ --->', + 'ar': u'{{عنوان الملعب}}\n<!-- مرحبا! خذ راحتك في تجربة مهارتك في التنسيق ' + u'والتحرير أسفل هذا السطر. هذه الصفحة لتجارب التعديل ، سيتم تفريغ ' + u'هذه الصفحة كل 12 ساعة. -->', + 'arz': u'{{عنوان السبوره}}\n<!-- مرحبا! خد راحتك فى تجريب مهاراتك فى\n' + u'التحرير تحت الخط ده. بما إن الصفحه دى لتجارب التعديل، فالصفحه دى ' + u'حيتم تنضيفها\nاوتوماتيكيا كل 12 ساعه. -->', + 'az': u'<!--- LÜTFƏN, BU SƏTRƏ TOXUNMAYIN --->\n{{Qaralama dəftəri}}\n' + u'<!-- AŞAĞIDAKI XƏTTİN ALTINDAN YAZA BİLƏRSİNİZ --->', 'bar': u'{{Bitte erst NACH dieser Zeile schreiben! (Begrüßungskasten)}}\r\n', 'cs': u'{{subst:/uhrabat}}', 'da': u'{{subst:Sandkasse tekst}}', 'de': u'{{subst:Wikipedia:Spielwiese/Vorlage}}', - 'en': u'{{Sandbox heading}}\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->', + 'en': u'{{Sandbox heading}}\n<!-- Hello! Feel free to try your formatting ' + u'and editing skills below this line. As this page is for editing ' + u'experiments, this page will automatically be cleaned every 12 ' + u'hours. -->', 'fa': u'{{subst:User:Amirobot/sandbox}}', 'fi': u'{{subst:Hiekka}}', 'he': u'{{ארגז חול}}\n<!-- נא לערוך מתחת לשורה זו בלבד, תודה. -->', @@ -74,11 +82,18 @@ 'ja': u'{{subst:サンドボックス}}', 'ko': u'{{연습장 안내문}}', 'ksh': u'{{subst:/Schablon}}', - 'mzn': u'{{ویکیپدیا:چنگمویی صفحه/پیغوم}}\n<!-- سلام!اگه خواننی شه دچیین مهارتون وسه تمرین هاکنین بتوننی اینتا صفحه جا ایستفاده هاکنین، اته لطف هاکنین اینتا پیغوم ره شه بقیه رفقون وسه بیلین. اینتا صفحه هرچند ساعت ربوت جا پاک بونه.-->', + 'mzn': u'{{ویکیپدیا:چنگمویی صفحه/پیغوم}}\n<!-- سلام!اگه ' + u'خواننی شه دچیین مهارتون وسه تمرین هاکنین بتوننی اینتا صفحه جا ' + u'ایستفاده هاکنین، اته لطف هاکنین اینتا پیغوم ره شه بقیه رفقون وسه ' + u'بیلین. اینتا صفحه هرچند ساعت ربوت جا پاک بونه.-->', 'nds': u'{{subst:/Vörlaag}}', 'nl': u'{{subst:Wikipedia:Zandbak/schoon zand}}', - 'nn': u'{{sandkasse}}\n<!-- Ver snill og IKKJE FJERN DENNE LINA OG LINA OVER ({{sandkasse}}) Nedanføre kan du derimot ha det artig og prøve deg fram! Lykke til! :-) -->', - 'no': u'{{Sandkasse}}\n<!-- VENNLIGST EKSPERIMENTER NEDENFOR DENNE SKJULTE TEKSTLINJEN! SANDKASSEMALEN {{Sandkasse}} SKAL IKKE FJERNES! -->}}', + 'nn': u'{{sandkasse}}\n<!-- Ver snill og IKKJE FJERN DENNE LINA OG LINA ' + u'OVER ({{sandkasse}}) Nedanføre kan du derimot ha det artig og ' + u'prøve deg fram! Lykke til! :-) -->', + 'no': u'{{Sandkasse}}\n<!-- VENNLIGST EKSPERIMENTER NEDENFOR DENNE ' + u'SKJULTE TEKSTLINJEN! SANDKASSEMALEN {{Sandkasse}} SKAL IKKE ' + u'FJERNES! -->}}', 'pl': u'{{Prosimy - NIE ZMIENIAJ, NIE KASUJ, NIE PRZENOŚ tej linijki - pisz niżej}}', 'pt': u'<!--não apague esta linha-->{{página de testes}}<!--não apagar-->\r\n', 'ru': u'{{/Пишите ниже}}\n<!-- Не удаляйте, пожалуйста, эту строку, тестируйте ниже -->', @@ -86,7 +101,8 @@ 'sco': u'Feel free tae test here', 'sr': u'{{песак}}\n<!-- Молимо, испробавајте испод ове линије. Хвала. -->', 'sv': u'{{subst:Sandlådan}}', - 'th': u'{{กระบะทราย}}\n<!-- กรุณาอย่าแก้ไขบรรทัดนี้ ขอบคุณครับ/ค่ะ -- Please leave this line as they are. Thank you! -->', + 'th': u'{{กระบะทราย}}\n<!-- กรุณาอย่าแก้ไขบรรทัดนี้ ขอบคุณครับ/ค่ะ -- ' + u'Please leave this line as they are. Thank you! -->', 'tr': u'{{/Bu satırı değiştirmeden bırakın}}', 'zh': u'{{subst:User:Sz-iwbot/sandbox}}\r\n', } diff --git a/scripts/version.py b/scripts/version.py index fa6af52..e50a0b6 100755 --- a/scripts/version.py +++ b/scripts/version.py @@ -40,7 +40,10 @@ has_wikimedia_cert = True pywikibot.output(u' certificate test: %s' % ('ok' if has_wikimedia_cert else 'not ok')) pywikibot.output('Python: %s' % sys.version) - if not __import__('unicodedata').normalize('NFC', u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917') == u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917': + normalize_text = u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917' + + if normalize_text != __import__('unicodedata').normalize( + 'NFC', normalize_text): pywikibot.output(u' unicode test: triggers problem #3081100') else: pywikibot.output(u' unicode test: ok') diff --git a/scripts/welcome.py b/scripts/welcome.py index 3bf43a4..bfe0bec 100644 --- a/scripts/welcome.py +++ b/scripts/welcome.py @@ -391,9 +391,15 @@ # # logpage_header = { - '_default': u'{|border="2" cellpadding="4" cellspacing="0" style="margin: 0.5em 0.5em 0.5em 1em; padding: 0.5em; background: #bfcda5; border: 1px #b6fd2c solid; border-collapse: collapse; font-size: 95%;"', + '_default': u'{|border="2" cellpadding="4" cellspacing="0" style="margin: ' + u'0.5em 0.5em 0.5em 1em; padding: 0.5em; background: #bfcda5; ' + u'border: 1px #b6fd2c solid; border-collapse: collapse; ' + u'font-size: 95%;"', 'no': u'[[Kategori:Velkomstlogg|{{PAGENAME}}]]\n{| class="wikitable"', - 'it': u'[[Categoria:Benvenuto log|{{subst:PAGENAME}}]]\n{|border="2" cellpadding="4" cellspacing="0" style="margin: 0.5em 0.5em 0.5em 1em; padding: 0.5em; background: #bfcda5; border: 1px #b6fd2c solid; border-collapse: collapse; font-size: 95%;"' + 'it': u'[[Categoria:Benvenuto log|{{subst:PAGENAME}}]]\n{|border="2" ' + u'cellpadding="4" cellspacing="0" style="margin: 0.5em 0.5em 0.5em ' + u'1em; padding: 0.5em; background: #bfcda5; border: 1px #b6fd2c ' + u'solid; border-collapse: collapse; font-size: 95%;"' }
# Ok, that's all. What is below, is the rest of code, now the code is fixed @@ -919,7 +925,10 @@ if len(str(globalvar.offset)) != 14: # upon request, we might want to check for software version here raise ValueError( - "Mediawiki has changed, -offset:# is not supported anymore, but -offset:TIMESTAMP is, assuming TIMESTAMP is yyyymmddhhmmss. -timeoffset is now also supported. Please read this script source header for documentation.") + "Mediawiki has changed, -offset:# is not supported " + "anymore, but -offset:TIMESTAMP is, assuming TIMESTAMP " + "is yyyymmddhhmmss. -timeoffset is now also supported. " + "Please read this script source header for documentation.") elif arg.startswith('-file:'): globalvar.randomSign = True if len(arg) == 6: diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py index a7a27bc..2b13e38 100644 --- a/tests/deprecation_tests.py +++ b/tests/deprecation_tests.py @@ -434,25 +434,37 @@
rv = deprecated_all(foo=42) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".deprecated_all are deprecated. The value(s) provided for 'foo' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of %s.deprecated_all are " + "deprecated. The value(s) provided for 'foo' have been " + "dropped." % __name__)
self._reset_messages()
rv = deprecated_all(42) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".deprecated_all are deprecated. The value(s) provided for 'foo' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of %s.deprecated_all are " + "deprecated. The value(s) provided for 'foo' have been " + "dropped." % __name__)
self._reset_messages()
rv = deprecated_all(foo=42, bar=47) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".deprecated_all are deprecated. The value(s) provided for 'foo', 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of %s.deprecated_all are " + "deprecated. The value(s) provided for 'foo', 'bar' have been " + "dropped." % __name__)
self._reset_messages()
rv = deprecated_all(42, 47) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".deprecated_all are deprecated. The value(s) provided for 'foo', 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of %s.deprecated_all are " + "deprecated. The value(s) provided for 'foo', 'bar' have been " + "dropped." % __name__)
self._reset_messages()
@@ -466,7 +478,10 @@
rv = deprecated_all2(42, bar=47) self.assertEqual(rv, 42) - self.assertDeprecation("The trailing arguments ('bar') of " + __name__ + ".deprecated_all2 are deprecated. The value(s) provided for 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('bar') of %s.deprecated_all2 are " + "deprecated. The value(s) provided for 'bar' have been " + "dropped." % __name__)
self._reset_messages()
@@ -480,25 +495,37 @@
rv = f.deprecated_all(foo=42) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".DeprecatedMethodClass.deprecated_all are deprecated. The value(s) provided for 'foo' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of " + "%s.DeprecatedMethodClass.deprecated_all are deprecated. " + "The value(s) provided for 'foo' have been dropped." % __name__)
self._reset_messages()
rv = f.deprecated_all(42) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".DeprecatedMethodClass.deprecated_all are deprecated. The value(s) provided for 'foo' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of " + "%s.DeprecatedMethodClass.deprecated_all are deprecated. " + "The value(s) provided for 'foo' have been dropped." % __name__)
self._reset_messages()
rv = f.deprecated_all(foo=42, bar=47) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".DeprecatedMethodClass.deprecated_all are deprecated. The value(s) provided for 'foo', 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of " + "%s.DeprecatedMethodClass.deprecated_all are deprecated. The " + "value(s) provided for 'foo', 'bar' have been dropped." % __name__)
self._reset_messages()
rv = f.deprecated_all(42, 47) self.assertEqual(rv, None) - self.assertDeprecation("The trailing arguments ('foo', 'bar') of " + __name__ + ".DeprecatedMethodClass.deprecated_all are deprecated. The value(s) provided for 'foo', 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('foo', 'bar') of " + "%s.DeprecatedMethodClass.deprecated_all are deprecated. The " + "value(s) provided for 'foo', 'bar' have been dropped." % __name__)
self._reset_messages()
@@ -512,7 +539,10 @@
rv = f.deprecated_all2(42, bar=47) self.assertEqual(rv, 42) - self.assertDeprecation("The trailing arguments ('bar') of " + __name__ + ".DeprecatedMethodClass.deprecated_all2 are deprecated. The value(s) provided for 'bar' have been dropped.") + self.assertDeprecation( + "The trailing arguments ('bar') of " + "%s.DeprecatedMethodClass.deprecated_all2 are deprecated. " + "The value(s) provided for 'bar' have been dropped." % __name__)
def test_remove_last_args_invalid(self): self.assertRaisesRegex( @@ -577,7 +607,8 @@ self.assertEqual(rv, 'b') self.assertEqual(f.foo, 'b') self.assertDeprecation( - 'bah argument of ' + __name__ + '.DeprecatedMethodClass.deprecated_instance_method_arg is deprecated; use foo instead.') + 'bah argument of %s.DeprecatedMethodClass.deprecated_instance_' + 'method_arg is deprecated; use foo instead.' % __name__)
DeprecatorTestCase._reset_messages()
diff --git a/tox.ini b/tox.ini index c040f75..5acd0e3 100644 --- a/tox.ini +++ b/tox.ini @@ -123,10 +123,10 @@ [flake8] ignore = E122,E127,E241,E265 exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*,./pywikibot/date.py -max_line_length = 256 +max_line_length = 200
[pep8] ignore = E122,E127,E241 exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*,./pywikibot/date.py -max_line_length = 256 +max_line_length = 200