XZise has uploaded a new change for review.

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

Change subject: [IMPROV] Make deprecation messages consistent
......................................................................

[IMPROV] Make deprecation messages consistent

Some deprecation messages use a semicolon while others use a normal comma. This
is changing them into semicolons.

Change-Id: I92cebffe9f746ede03da3851a19e812f3ce155a9
---
M pywikibot/site.py
M pywikibot/tools/__init__.py
M tests/aspects.py
M tests/deprecation_tests.py
M tests/exceptions_tests.py
M tests/family_tests.py
M tests/logentry_tests.py
M tests/site_tests.py
M tests/tools_ip_tests.py
9 files changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/24/228424/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index e77315c..8208363 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3634,7 +3634,7 @@
                     filterredir = None
             else:
                 filterredir = False
-            warn('The value "{0!r}" for "filterredir" is deprecated, use '
+            warn('The value "{0!r}" for "filterredir" is deprecated; use '
                  '{1} instead.'.format(old, filterredir), DeprecationWarning, 
3)
 
         apgen = self._generator(api.PageGenerator, type_arg="allpages",
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index bd96771..9d06087 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -1098,7 +1098,7 @@
 def issue_deprecation_warning(name, instead, depth):
     """Issue a deprecation warning."""
     if instead:
-        warn(u'{0} is deprecated, use {1} instead.'.format(name, instead),
+        warn(u'{0} is deprecated; use {1} instead.'.format(name, instead),
              DeprecationWarning, depth + 1)
     else:
         warn(u'{0} is deprecated.'.format(name), _NotImplementedWarning,
@@ -1433,7 +1433,7 @@
 
         if not warning_message:
             if replacement_name:
-                warning_message = u"{0}.{1} is deprecated, use {2} instead."
+                warning_message = u"{0}.{1} is deprecated; use {2} instead."
             else:
                 warning_message = u"{0}.{1} is deprecated."
 
diff --git a/tests/aspects.py b/tests/aspects.py
index a0209c8..ab6df6f 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1315,7 +1315,7 @@
 
     """Test cases for deprecation function in the tools module."""
 
-    _generic_match = re.compile(r'.* is deprecated(, use .* instead)?\.')
+    _generic_match = re.compile(r'.* is deprecated(; use .* instead)?\.')
 
     skip_list = [
         unittest.case._AssertRaisesContext,
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index c13a229..9553c51 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -260,7 +260,7 @@
         rv = deprecated_func_instead('a')
         self.assertEqual(rv, 'a')
         self.assertDeprecation(
-            __name__ + '.deprecated_func_instead is deprecated, use baz 
instead.')
+            __name__ + '.deprecated_func_instead is deprecated; use baz 
instead.')
 
     def test_deprecated_function_bad_args(self):
         rv = deprecated_func_bad_args(None)
diff --git a/tests/exceptions_tests.py b/tests/exceptions_tests.py
index 9fa8041..1b66f8b 100644
--- a/tests/exceptions_tests.py
+++ b/tests/exceptions_tests.py
@@ -35,7 +35,7 @@
         cls = pywikibot.exceptions.UploadWarning
 
         self.assertDeprecation(
-            'pywikibot.exceptions.UploadWarning is deprecated, '
+            'pywikibot.exceptions.UploadWarning is deprecated; '
             'use pywikibot.data.api.UploadWarning instead.')
 
         self._reset_messages()
diff --git a/tests/family_tests.py b/tests/family_tests.py
index 6fe8823..cabe833 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -197,7 +197,7 @@
         f = pywikibot.site.Family('osm')
         self.assertEqual(f.name, 'osm')
         self.assertDeprecation(
-            'pywikibot.site.Family is deprecated, use 
pywikibot.family.Family.load instead.')
+            'pywikibot.site.Family is deprecated; use 
pywikibot.family.Family.load instead.')
 
         # @deprecated warning occurs within redirect_func's call
         # invoking the method instead of this test module.
@@ -206,7 +206,7 @@
         f = pywikibot.site.Family('i18n', fatal=False)
         self.assertEqual(f.name, 'i18n')
         self.assertDeprecation(
-            'pywikibot.site.Family is deprecated, use 
pywikibot.family.Family.load instead.')
+            'pywikibot.site.Family is deprecated; use 
pywikibot.family.Family.load instead.')
         self.assertDeprecation('fatal argument of pywikibot.family.Family.load 
is deprecated.')
 
     def test_old_site_family_function_invalid(self):
@@ -218,7 +218,7 @@
                           fatal=False)
         self.assertRaises(UnknownFamily, pywikibot.site.Family, 'unknown')
         self.assertDeprecation(
-            'pywikibot.site.Family is deprecated, use 
pywikibot.family.Family.load instead.')
+            'pywikibot.site.Family is deprecated; use 
pywikibot.family.Family.load instead.')
         self.assertDeprecation('fatal argument of pywikibot.family.Family.load 
is deprecated.')
 
 
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py
index 0678510..03f080b 100644
--- a/tests/logentry_tests.py
+++ b/tests/logentry_tests.py
@@ -224,9 +224,9 @@
         self.assertEqual(logentry.new_title(), logentry.target_page)
 
         self.assertDeprecation('pywikibot.logentries.MoveEntry.new_ns is '
-                               'deprecated, use target_ns.id instead.')
+                               'deprecated; use target_ns.id instead.')
         self.assertDeprecation('pywikibot.logentries.MoveEntry.new_title is '
-                               'deprecated, use target_page instead.')
+                               'deprecated; use target_page instead.')
 
     def test_LogEntry_title(self, key):
         """Test title and page return the same instance."""
@@ -255,7 +255,7 @@
         self.assertEqual(mainpage, target.getMovedTarget())
 
         self.assertDeprecation('pywikibot.page.BasePage.getMovedTarget is '
-                               'deprecated, use moved_target() instead.')
+                               'deprecated; use moved_target() instead.')
 
     def test_moved_target_fail_old(self):
         """Test getMovedTarget method failing on older wiki."""
@@ -264,7 +264,7 @@
             self.get_mainpage(site).getMovedTarget()
 
         self.assertDeprecation('pywikibot.page.BasePage.getMovedTarget is '
-                               'deprecated, use moved_target() instead.')
+                               'deprecated; use moved_target() instead.')
 
     def test_moved_target_fail_de(self):
         """Test getMovedTarget method failing on de-wiki."""
@@ -273,7 +273,7 @@
             page.getMovedTarget()
 
         self.assertDeprecation('pywikibot.page.BasePage.getMovedTarget is '
-                               'deprecated, use moved_target() instead.')
+                               'deprecated; use moved_target() instead.')
 
 
 if __name__ == '__main__':
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 89bc964..ed7396f 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -62,7 +62,7 @@
         else:
             self.assertEqual(token, mysite.token(mainpage, ttype))
             self.assertDeprecation("pywikibot.site.APISite.token is deprecated"
-                                   ", use the 'tokens' property instead.")
+                                   "; use the 'tokens' property instead.")
 
 
 class TestSiteObjectDeprecatedFunctions(DefaultSiteTestCase, 
DeprecationTestCase):
@@ -99,12 +99,12 @@
         old = self.site.siteinfo('general')
         self.assertIn('DUMMY', old)
         self.assertNotEqual(self.site.siteinfo('general', force=True), old)
-        self.assertDeprecation('Calling siteinfo is deprecated, use itself 
instead.')
+        self.assertDeprecation('Calling siteinfo is deprecated; use itself 
instead.')
 
     def test_siteinfo_dump(self):
         """Test calling the Siteinfo with dump=True."""
         self.assertIn('statistics', self.site.siteinfo('statistics', 
dump=True))
-        self.assertDeprecation('Calling siteinfo is deprecated, use itself 
instead.')
+        self.assertDeprecation('Calling siteinfo is deprecated; use itself 
instead.')
 
     def test_language_method(self):
         """Test if the language method returns the same as the lang 
property."""
@@ -137,7 +137,7 @@
         """Test that namespaces is callable and returns itself."""
         site = self.get_site()
         self.assertIs(site.namespaces(), site.namespaces)
-        self.assertDeprecation('Calling the namespaces property is deprecated, 
'
+        self.assertDeprecation('Calling the namespaces property is deprecated; 
'
                                'use it directly instead.')
 
 
diff --git a/tests/tools_ip_tests.py b/tests/tools_ip_tests.py
index 80cd776..b5e7b15 100644
--- a/tests/tools_ip_tests.py
+++ b/tests/tools_ip_tests.py
@@ -651,7 +651,7 @@
         self._test_T105443_failures()
         self.assertEqual(self.fail, 0)
         self.assertDeprecation(
-            'page.ip_regexp is deprecated, use tools.ip.is_IP instead.')
+            'page.ip_regexp is deprecated; use tools.ip.is_IP instead.')
 
 
 class IPAddressModuleTestCase(TestIPBase):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92cebffe9f746ede03da3851a19e812f3ce155a9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to