jenkins-bot has submitted this change and it was merged.
Change subject: throttle.py: Make sure opened files are closed properly
......................................................................
throttle.py: Make sure opened files are closed properly
Previously, if there was an IOError during file opening, the
file would not have been closed.
Bug: T95111
Change-Id: I6af4adae0e731cbcc8ff0c002b7d188f4e874520
---
M pywikibot/throttle.py
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index d125df1..9a38e46 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -204,12 +204,13 @@
self.checktime = 0
processes = []
try:
- f = open(self.ctrlfilename, 'r')
+ with open(self.ctrlfilename, 'r') as f:
+ lines = f.readlines()
except IOError:
return
else:
now = time.time()
- for line in f.readlines():
+ for line in lines:
try:
line = line.split(' ')
this_pid = int(line[0])
@@ -225,12 +226,11 @@
'site': this_site})
processes.sort(key=lambda p: p['pid'])
try:
- f = open(self.ctrlfilename, 'w')
- for p in processes:
- f.write("%(pid)s %(time)s %(site)s\n" % p)
+ with open(self.ctrlfilename, 'w') as f:
+ for p in processes:
+ f.write("%(pid)s %(time)s %(site)s\n" % p)
except IOError:
return
- f.close()
def wait(self, seconds):
"""Wait for seconds seconds.
--
To view, visit https://gerrit.wikimedia.org/r/321727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6af4adae0e731cbcc8ff0c002b7d188f4e874520
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [doc] remove duplicate spaces inside doc strings
......................................................................
[doc] remove duplicate spaces inside doc strings
Change-Id: I4e73880640996311e629a87330802e76e2dee594
---
M generate_user_files.py
M pwb.py
M pywikibot/__init__.py
M pywikibot/_wbtypes.py
M pywikibot/backports.py
M pywikibot/bot.py
M pywikibot/botirc.py
M pywikibot/comms/__init__.py
M pywikibot/comms/http.py
M pywikibot/comms/rcstream.py
M pywikibot/comms/threadedhttp.py
M pywikibot/compat/__init__.py
M pywikibot/compat/catlib.py
M pywikibot/compat/query.py
M pywikibot/compat/userlib.py
M pywikibot/config2.py
M pywikibot/cosmetic_changes.py
M pywikibot/daemonize.py
M pywikibot/data/__init__.py
M pywikibot/data/api.py
M pywikibot/data/mysql.py
M pywikibot/data/sparql.py
M pywikibot/data/wikidataquery.py
M pywikibot/data/wikistats.py
M pywikibot/date.py
M pywikibot/diff.py
M pywikibot/echo.py
M pywikibot/exceptions.py
M pywikibot/families/__init__.py
M pywikibot/families/anarchopedia_family.py
M pywikibot/families/battlestarwiki_family.py
M pywikibot/families/commons_family.py
M pywikibot/families/i18n_family.py
M pywikibot/families/incubator_family.py
M pywikibot/families/lyricwiki_family.py
M pywikibot/families/mediawiki_family.py
M pywikibot/families/meta_family.py
M pywikibot/families/omegawiki_family.py
M pywikibot/families/osm_family.py
M pywikibot/families/outreach_family.py
M pywikibot/families/species_family.py
M pywikibot/families/strategy_family.py
M pywikibot/families/test_family.py
M pywikibot/families/vikidia_family.py
M pywikibot/families/wikibooks_family.py
M pywikibot/families/wikidata_family.py
M pywikibot/families/wikinews_family.py
M pywikibot/families/wikipedia_family.py
M pywikibot/families/wikiquote_family.py
M pywikibot/families/wikisource_family.py
M pywikibot/families/wikitech_family.py
M pywikibot/families/wikiversity_family.py
M pywikibot/families/wiktionary_family.py
M pywikibot/families/wowwiki_family.py
M pywikibot/family.py
M pywikibot/fixes.py
M pywikibot/flow.py
M pywikibot/i18n.py
M pywikibot/interwiki_graph.py
M pywikibot/logentries.py
M pywikibot/logging.py
M pywikibot/login.py
M pywikibot/page.py
M pywikibot/pagegenerators.py
M pywikibot/plural.py
M pywikibot/proofreadpage.py
M pywikibot/site.py
M pywikibot/site_detect.py
M pywikibot/textlib.py
M pywikibot/throttle.py
M pywikibot/titletranslate.py
M pywikibot/tools/__init__.py
M pywikibot/tools/_logging.py
M pywikibot/tools/djvu.py
M pywikibot/tools/formatter.py
M pywikibot/tools/ip.py
M pywikibot/userinterfaces/__init__.py
M pywikibot/userinterfaces/cgi_interface.py
M pywikibot/userinterfaces/gui.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/terminal_interface_unix.py
M pywikibot/userinterfaces/transliteration.py
M pywikibot/userinterfaces/win32_unicode.py
M pywikibot/version.py
M pywikibot/weblib.py
M pywikibot/xmlreader.py
M scripts/__init__.py
M scripts/add_text.py
M scripts/archive/__init__.py
M scripts/blockpageschecker.py
M scripts/blockreview.py
M scripts/capitalize_redirects.py
M scripts/casechecker.py
M scripts/category.py
M scripts/cfd.py
M scripts/checkimages.py
M scripts/clean_sandbox.py
M scripts/commons_link.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/data_ingestion.py
M scripts/delete.py
M scripts/disambredir.py
M scripts/djvutext.py
M scripts/fixing_redirects.py
M scripts/flickrripper.py
M scripts/freebasemappingupload.py
M scripts/image.py
M scripts/imageharvest.py
M scripts/imagerecat.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/isbn.py
M scripts/listpages.py
M scripts/login.py
M scripts/lonelypages.py
M scripts/maintenance/__init__.py
M scripts/maintenance/cache.py
M scripts/maintenance/compat2core.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/wikimedia_sites.py
M scripts/match_images.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/panoramiopicker.py
M scripts/patrol.py
M scripts/protect.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/script_wui.py
M scripts/selflink.py
M scripts/solve_disambiguation.py
M scripts/standardize_interwiki.py
M scripts/states_redirect.py
M scripts/template.py
M scripts/templatecount.py
M scripts/touch.py
M scripts/transferbot.py
M scripts/unusedfiles.py
M scripts/version.py
M scripts/weblinkchecker.py
M scripts/welcome.py
M scripts/wikisourcetext.py
M setup.py
M tests/__init__.py
M tests/api_tests.py
M tests/archivebot_tests.py
M tests/aspects.py
M tests/basepage_tests.py
M tests/bot_tests.py
M tests/cache_tests.py
M tests/category_bot_tests.py
M tests/category_tests.py
M tests/checkimages_tests.py
M tests/cosmetic_changes_tests.py
M tests/data/fixes.py
M tests/data/set-fixes.py
M tests/data_ingestion_tests.py
M tests/date_tests.py
M tests/deletionbot_tests.py
M tests/deprecation_tests.py
M tests/diff_tests.py
M tests/disambredir_tests.py
M tests/djvu_tests.py
M tests/dry_api_tests.py
M tests/dry_site_tests.py
M tests/edit_failure_tests.py
M tests/edit_tests.py
M tests/exceptions_tests.py
M tests/family_tests.py
M tests/file_tests.py
M tests/fixes_tests.py
M tests/flow_edit_tests.py
M tests/flow_tests.py
M tests/http_tests.py
M tests/i18n/__init__.py
M tests/i18n_tests.py
M tests/interwiki_link_tests.py
M tests/interwikidata_tests.py
M tests/isbn_tests.py
M tests/l10n_tests.py
M tests/link_tests.py
M tests/logentry_tests.py
M tests/login_tests.py
M tests/mediawikiversion_tests.py
M tests/namespace_tests.py
M tests/oauth_tests.py
M tests/page_tests.py
M tests/pagegenerators_tests.py
M tests/paraminfo_tests.py
M tests/patrolbot_tests.py
M tests/plural_tests.py
M tests/proofreadpage_tests.py
M tests/protectbot_tests.py
M tests/pwb/__init__.py
M tests/pwb_tests.py
M tests/python_tests.py
M tests/reflinks_tests.py
M tests/replacebot_tests.py
M tests/script_tests.py
M tests/site_detect_tests.py
M tests/site_tests.py
M tests/sparql_tests.py
M tests/template_bot_tests.py
M tests/tests_tests.py
M tests/textlib_tests.py
M tests/thread_tests.py
M tests/timestamp_tests.py
M tests/timestripper_tests.py
M tests/tk_tests.py
M tests/tools_chars_tests.py
M tests/tools_formatter_tests.py
M tests/tools_ip_tests.py
M tests/tools_tests.py
M tests/ui_options_tests.py
M tests/ui_tests.py
M tests/upload_tests.py
M tests/uploadbot_tests.py
M tests/user_tests.py
M tests/utils.py
M tests/weblib_tests.py
M tests/weblinkchecker_tests.py
M tests/wikibase_edit_tests.py
M tests/wikibase_tests.py
M tests/wikidataquery_tests.py
M tests/wikistats_tests.py
M tests/xmlreader_tests.py
M user-config.py.sample
233 files changed, 429 insertions(+), 433 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/generate_user_files.py b/generate_user_files.py
index 8e59c8b..fae93b2 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -1,8 +1,8 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Script to create user-config.py."""
#
-# (C) Pywikibot team, 2010-2015
+# (C) Pywikibot team, 2010-2016
#
# Distributed under the terms of the MIT license.
#
@@ -159,7 +159,7 @@
username = username.replace("'", "\\'")
return fam.name, mylang, username
-EXTENDED_CONFIG = u"""# -*- coding: utf-8 -*-
+EXTENDED_CONFIG = """# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# This is an automatically generated file. You can find more configuration
@@ -206,7 +206,7 @@
{config_text}"""
-SMALL_CONFIG = (u"# -*- coding: utf-8 -*-\n"
+SMALL_CONFIG = ('# -*- coding: utf-8 -*-\n'
u"from __future__ import absolute_import, unicode_literals\n"
u"family = '{main_family}'\n"
u"mylang = '{main_lang}'\n"
diff --git a/pwb.py b/pwb.py
index 96de789..92c3584 100755
--- a/pwb.py
+++ b/pwb.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Wrapper script to use Pywikibot in 'directory' mode.
Run scripts using:
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 37f03bb..3a60dbf 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2016
@@ -136,7 +136,7 @@
"""Class for handling MediaWiki timestamps.
This inherits from datetime.datetime, so it can use all of the methods
- and operations of a datetime object. To ensure that the results of any
+ and operations of a datetime object. To ensure that the results of any
operation are also a Timestamp object, be sure to use only Timestamp
objects (and datetime.timedeltas) in any operation.
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index c59a5b8..b0db7bf 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Wikibase data type classes."""
#
# (C) Pywikibot team, 2013-2015
diff --git a/pywikibot/backports.py b/pywikibot/backports.py
index 39b904c..86c8de7 100644
--- a/pywikibot/backports.py
+++ b/pywikibot/backports.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This module contains backports to support older Python versions.
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index e48a797..fcd1a22 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
User-interface related functions for building bots.
@@ -179,7 +179,7 @@
# The UserInterface object must define its own init_handlers() method
# which takes the root logger as its only argument, and which adds to that
# logger whatever handlers and formatters are needed to process output and
-# display it to the user. The default (terminal) interface sends level
+# display it to the user. The default (terminal) interface sends level
# STDOUT to sys.stdout (as all interfaces should) and sends all other
# levels to sys.stderr; levels WARNING and above are labeled with the
# level name.
@@ -1218,7 +1218,7 @@
This also prevents the same title from being printed twice.
@param page: the working page
- @type page: pywikibot.Page
+ @type page: pywikibot.Page
"""
if page != self._current_page:
self._current_page = page
@@ -1513,7 +1513,7 @@
# self.site causes bugs in subclasses.
# If the subclass has set self.site before run(), it may be that the
# bot processes pages on sites other than self.site, and therefore
- # this method cant alter self.site. To use this functionality, don't
+ # this method cant alter self.site. To use this functionality, don't
# set self.site in __init__, and use page.site in treat().
self._auto_update_site = not self._site
if not self._auto_update_site:
diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py
index 1d9f13a..6b10b0c 100644
--- a/pywikibot/botirc.py
+++ b/pywikibot/botirc.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
User-interface related functions for building bots.
diff --git a/pywikibot/comms/__init__.py b/pywikibot/comms/__init__.py
index f34f5e9..f3313f5 100644
--- a/pywikibot/comms/__init__.py
+++ b/pywikibot/comms/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Communication layer."""
#
# (C) Pywikibot team, 2007-2008
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index c3acdbc..908f3f1 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Basic HTTP access interface.
@@ -400,7 +400,7 @@
Callbacks, including the default error handler if enabled, are run in the
HTTP thread, where exceptions are logged but are not able to be caught.
The default error handler is called first, then 'callback' (singular),
- followed by each callback in 'callbacks' (plural). All callbacks are
+ followed by each callback in 'callbacks' (plural). All callbacks are
invoked, even if the default error handler detects a problem, so they
must check request.exception before using the response data.
diff --git a/pywikibot/comms/rcstream.py b/pywikibot/comms/rcstream.py
index 823597a..bb9ed7b 100644
--- a/pywikibot/comms/rcstream.py
+++ b/pywikibot/comms/rcstream.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
SocketIO-based rcstream client.
@@ -49,8 +49,8 @@
@param rcport: the port to connect to (default: 80)
@param rcpath: the sockets.io path. For Wikimedia wikis, this is '/rc'.
(default: '/rc')
- @param total: the maximum number of entries to return. The underlying
- thread is shut down then this number is reached.
+ @param total: the maximum number of entries to return. The underlying
+ thread is shut down then this number is reached.
This part of the rc listener runs in a Thread. It makes the actual
socketIO/websockets connection to the rc stream server, subscribes
diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index 2ae6ed5..a166929 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Http backend layer, formerly providing a httplib2 wrapper."""
from __future__ import absolute_import, unicode_literals
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/compat/__init__.py b/pywikibot/compat/__init__.py
index fe93354..1f9845b 100644
--- a/pywikibot/compat/__init__.py
+++ b/pywikibot/compat/__init__.py
@@ -1,2 +1,2 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Package to provide compatibility with compat scripts."""
diff --git a/pywikibot/compat/catlib.py b/pywikibot/compat/catlib.py
index acecd29..689fb26 100644
--- a/pywikibot/compat/catlib.py
+++ b/pywikibot/compat/catlib.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
diff --git a/pywikibot/compat/query.py b/pywikibot/compat/query.py
index 4fc0033..0d8179a 100644
--- a/pywikibot/compat/query.py
+++ b/pywikibot/compat/query.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
diff --git a/pywikibot/compat/userlib.py b/pywikibot/compat/userlib.py
index 07dbaa5..ad50038 100644
--- a/pywikibot/compat/userlib.py
+++ b/pywikibot/compat/userlib.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 3679506..9451eb5 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -5,12 +5,12 @@
User preferences are loaded from a python file called user-config.py, which
may be located in directory specified by the environment variable
PYWIKIBOT2_DIR, or the same directory as pwb.py, or in a directory within
-the users home. See get_base_dir for more information.
+the users home. See get_base_dir for more information.
If user-config.py can not be found in any of those locations, this module
will fail to load unless the environment variable PYWIKIBOT2_NO_USER_CONFIG
-is set to a value other than '0'. i.e. PYWIKIBOT2_NO_USER_CONFIG=1 will
-allow config to load without a user-config.py. However, warnings will be
+is set to a value other than '0'. i.e. PYWIKIBOT2_NO_USER_CONFIG=1 will
+allow config to load without a user-config.py. However, warnings will be
shown if user-config.py was not loaded.
To prevent these warnings, set PYWIKIBOT2_NO_USER_CONFIG=2.
@@ -87,7 +87,7 @@
# Note: all variables defined in this module are made available to bots as
# configuration settings, *except* variable names beginning with an
-# underscore (example: _variable). Be sure to use an underscore on any
+# underscore (example: _variable). Be sure to use an underscore on any
# variables that are intended only for internal use and not to be exported
# to other modules.
@@ -199,7 +199,7 @@
#
# Secure connection overrides
#
-# These settings are deprecated. They existed to support the Wikimedia
+# These settings are deprecated. They existed to support the Wikimedia
# family which only served HTTPS on https://secure.wikimedia.org/<site>/<uri>
# Use Family.protocol()
use_SSL_onlogin = False # if available, use SSL when logging in
@@ -591,7 +591,7 @@
# but never more than 'maxthrottle' seconds. However - if you are running
# more than one bot in parallel the times are lengthened.
# By default, the get_throttle is turned off, and 'maxlag' is used to
-# control the rate of server access. Set minthrottle to non-zero to use a
+# control the rate of server access. Set minthrottle to non-zero to use a
# throttle on read access.
minthrottle = 0
maxthrottle = 60
@@ -604,7 +604,7 @@
# than 'noisysleep' seconds, it is logged on the screen.
noisysleep = 3.0
-# Defer bot edits during periods of database server lag. For details, see
+# Defer bot edits during periods of database server lag. For details, see
# https://www.mediawiki.org/wiki/Maxlag_parameter
# You can set this variable to a number of seconds, or to None (or 0) to
# disable this behavior. Higher values are more aggressive in seeking
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 8405bec..1a90183 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This module can do slight modifications to tidy a wiki page's source code.
@@ -151,7 +151,7 @@
import scripts.isbn as scripts_isbn
except ImportError:
raise NotImplementedError(
- 'ISBN functionality not available. Install stdnum package.')
+ 'ISBN functionality not available. Install stdnum package.')
warn('package stdnum.isbn not found; using scripts.isbn',
ImportWarning)
diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py
index af5b323..e77f8e3 100644
--- a/pywikibot/daemonize.py
+++ b/pywikibot/daemonize.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/data/__init__.py b/pywikibot/data/__init__.py
index 5cfbaaa..66fd7c8 100644
--- a/pywikibot/data/__init__.py
+++ b/pywikibot/data/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module providing several layers of data access to the wiki."""
#
# (C) Pywikibot team, 2007-2014
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 29f81e8..c087bb5 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Interface to Mediawiki's api.php."""
#
# (C) Pywikibot team, 2007-2016
@@ -882,7 +882,7 @@
# output of v1.25, and cant removed from previous API versions.
# There should be an option to remove this verbose data from the cached
# version, for earlier versions of the API, and/or extract any useful
- # data and discard the entire received paraminfo structure. There are
+ # data and discard the entire received paraminfo structure. There are
# also params which are common to many modules, such as those provided
# by the ApiPageSet php class: titles, pageids, redirects, etc.
try:
@@ -1062,7 +1062,7 @@
If it is instantiated with the associated site, module and parameter it
will only allow valid names as options. If instantiated 'lazy loaded' it
- won't checks if the names are valid until the site has been set (which
+ won't checks if the names are valid until the site has been set (which
isn't required, but recommended). The site can only be set once if it's not
None and after setting it, any site (even None) will fail.
"""
@@ -1279,7 +1279,7 @@
Attributes of this object (except for the special parameters listed
below) get passed as commands to api.php, and can be get or set using
- the dict interface. All attributes must be strings (or unicode). Use
+ the dict interface. All attributes must be strings (or unicode). Use
an empty string for parameters that don't require a value. For example,
Request(action="query", titles="Foo bar", prop="info", redirects="")
corresponds to the API request
@@ -1296,7 +1296,7 @@
Returns a dict containing the JSON data returned by the wiki. Normally,
one of the dict keys will be equal to the value of the 'action'
- parameter. Errors are caught and raise an APIError exception.
+ parameter. Errors are caught and raise an APIError exception.
Example:
@@ -1661,7 +1661,7 @@
def http_params(self):
"""Return the parameters formatted for inclusion in an HTTP request.
- DEPRECATED. See _encoded_items for explanation of encoding used.
+ DEPRECATED. See _encoded_items for explanation of encoding used.
"""
self._add_defaults()
return self._http_param_string()
@@ -1987,7 +1987,7 @@
result = json.loads(rawdata)
except ValueError:
# if the result isn't valid JSON, there must be a server
- # problem. Wait a few seconds and try again
+ # problem. Wait a few seconds and try again
pywikibot.warning(
"Non-JSON response received from server %s; the server may be down."
% self.site)
@@ -2082,7 +2082,7 @@
continue
elif code == 'help' and self.action == 'help':
# The help module returns an error result with the complete
- # API information. As this data was requested, return the
+ # API information. As this data was requested, return the
# data instead of raising an exception.
return {'help': {'mime': 'text/plain',
'help': result['error']['help']}}
@@ -2482,7 +2482,7 @@
By default, the iterator will iterate each item in the query response,
and use the (query-)continue element, if present, to continue iterating as
- long as the wiki returns additional values. However, if the iterator's
+ long as the wiki returns additional values. However, if the iterator's
limit attribute is set to a positive int, the iterator will stop after
iterating that many values. If limit is negative, the limit parameter
will not be passed to the API at all.
@@ -2646,7 +2646,7 @@
@param namespaces: namespace identifiers to limit query results
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers. An empty iterator clears any
namespace restriction.
@raises KeyError: a namespace identifier was not resolved
@@ -2956,13 +2956,13 @@
"""Iterator for queries of type action=query&list=foo.
- See the API documentation for types of lists that can be queried. Lists
+ See the API documentation for types of lists that can be queried. Lists
include both side-wide information (such as 'allpages') and page-specific
information (such as 'backlinks').
This iterator yields a dict object for each member of the list returned
by the API, with the format of the dict depending on the particular list
- command used. For those lists that contain page information, it may be
+ command used. For those lists that contain page information, it may be
easier to use the PageGenerator class instead, as that will convert the
returned information into a Page object.
diff --git a/pywikibot/data/mysql.py b/pywikibot/data/mysql.py
index afe5993..0f9a969 100644
--- a/pywikibot/data/mysql.py
+++ b/pywikibot/data/mysql.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Miscellaneous helper functions for mysql queries."""
#
# (C) Pywikibot team, 2016
diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py
index 12ba695..70c6563 100644
--- a/pywikibot/data/sparql.py
+++ b/pywikibot/data/sparql.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""SPARQL Query interface."""
#
# Distributed under the terms of the MIT license.
diff --git a/pywikibot/data/wikidataquery.py b/pywikibot/data/wikidataquery.py
index c52f3a1..f28a376 100644
--- a/pywikibot/data/wikidataquery.py
+++ b/pywikibot/data/wikidataquery.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Objects representing WikidataQuery query syntax and API."""
#
# (C) Pywikibot team, 2013
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index 86d9a72..7402944 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Objects representing WikiStats API."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 23009fe..05bc837 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -1,12 +1,12 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Date data and manipulation module."""
#
# (C) Rob W.W. Hooft, 2003
# (C) Daniel Herding, 2004
# (C) Ævar Arnfjörð Bjarmason, 2004
# (C) Andre Engels, 2004-2005
-# (C) Yuri Astrakhan, 2005-2006 (<Firstname><Lastname>@gmail.com)
-# (years/decades/centuries/millenniums str <=> int conversions)
+# (C) Yuri Astrakhan, 2005-2006 (<Firstname><Lastname>@gmail.com)
+# (years/decades/centuries/millenniums str <=> int conversions)
# (C) Pywikibot team, 2004-2016
#
# Distributed under the terms of the MIT license.
@@ -322,7 +322,7 @@
"""Convert roman numeral to integer."""
return _romanNumbers.index(v)
-# Each tuple must 3 parts: a list of all possible digits (symbols), encoder
+# Each tuple must 3 parts: a list of all possible digits (symbols), encoder
# (from int to a u-string) and decoder (from u-string to an int)
_digitDecoders = {
# %% is a %
@@ -356,8 +356,7 @@
_reParameters = re.compile(u'|'.join(u'(%%[1-9]?%s)' % s
for s in _digitDecoders))
-# A map of sitecode+pattern to (re matching object and corresponding
-# decoders)
+# A map of sitecode+pattern to (re matching object and corresponding decoders)
_escPtrnCache2 = {}
_listTypes = [list, tuple]
@@ -586,10 +585,9 @@
'cy': lambda v: slh(v, [u"Ionawr", u"Chwefror", u"Mawrth", u"Ebrill",
u"Mai", u"Mehefin", u"Gorffennaf", u"Awst",
u"Medi", u"Hydref", u"Tachwedd", u"Rhagfyr"]),
- 'da': lambda v: slh(v, [u"januar", u"februar", u"marts", u"april",
- u"maj", u"juni", u"juli", u"august",
- u"september", u"oktober", u"november",
- u"december"]),
+ 'da': lambda v: slh(v, ['januar', 'februar', 'marts', 'april', 'maj',
+ 'juni', 'juli', 'august', 'september',
+ 'oktober', 'november', 'december']),
'de': lambda v: slh(v, [u"Januar", u"Februar", u"März", u"April",
u"Mai", u"Juni", u"Juli", u"August",
u"September", u"Oktober", u"November",
@@ -1016,7 +1014,7 @@
'scn': dh_simpleYearAD,
'se': dh_simpleYearAD,
'sh': dh_simpleYearAD,
- 'simple': dh_simpleYearAD,
+ 'simple': dh_simpleYearAD,
'sk': dh_simpleYearAD,
'sl': dh_simpleYearAD,
'sm': dh_simpleYearAD,
@@ -2011,7 +2009,7 @@
return [pattern % f(monthName(lang, m)) for m in range(1, 13)]
#
-# Add day of the month formats to the formatting table: "en:May 15"
+# Add day of the month formats to the formatting table: "en:May 15"
#
addFmt2('af', False, u"%%d %s", True)
addFmt2('als', False, u"%%d. %s", True)
diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 4a1872c..12fe490 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Diff module."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index 2cd92c2..ba311ed 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index 2f5adb5..921ce86 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Exception and warning classes used throughout the framework.
diff --git a/pywikibot/families/__init__.py b/pywikibot/families/__init__.py
index ef884ae..e40db21 100644
--- a/pywikibot/families/__init__.py
+++ b/pywikibot/families/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Families package."""
#
# (C) Pywikibot team, 2007
diff --git a/pywikibot/families/anarchopedia_family.py b/pywikibot/families/anarchopedia_family.py
index 31d7323..acdf1ce 100644
--- a/pywikibot/families/anarchopedia_family.py
+++ b/pywikibot/families/anarchopedia_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Anarchopedia wiki."""
#
# (C) Pywikibot team, 2006-2015
diff --git a/pywikibot/families/battlestarwiki_family.py b/pywikibot/families/battlestarwiki_family.py
index 64ce010..1a12f79 100644
--- a/pywikibot/families/battlestarwiki_family.py
+++ b/pywikibot/families/battlestarwiki_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Battlestar Wiki."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py
index 06d82af..f367001 100644
--- a/pywikibot/families/commons_family.py
+++ b/pywikibot/families/commons_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikimedia Commons."""
#
# (C) Pywikibot team, 2005-2015
diff --git a/pywikibot/families/i18n_family.py b/pywikibot/families/i18n_family.py
index 9e8a206..0e205cd 100644
--- a/pywikibot/families/i18n_family.py
+++ b/pywikibot/families/i18n_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Translate Wiki."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/incubator_family.py b/pywikibot/families/incubator_family.py
index 9b64784..266d5e7 100644
--- a/pywikibot/families/incubator_family.py
+++ b/pywikibot/families/incubator_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Incubator Wiki."""
#
# (C) Pywikibot team, 2006-2015
diff --git a/pywikibot/families/lyricwiki_family.py b/pywikibot/families/lyricwiki_family.py
index 3417b4a..c4dc48e 100644
--- a/pywikibot/families/lyricwiki_family.py
+++ b/pywikibot/families/lyricwiki_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for LyricWiki."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/mediawiki_family.py b/pywikibot/families/mediawiki_family.py
index 9d2d27f..5fd30f4 100644
--- a/pywikibot/families/mediawiki_family.py
+++ b/pywikibot/families/mediawiki_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for MediaWiki wiki."""
#
# (C) Pywikibot team, 2006-2015
diff --git a/pywikibot/families/meta_family.py b/pywikibot/families/meta_family.py
index e33933b..46a58c1 100644
--- a/pywikibot/families/meta_family.py
+++ b/pywikibot/families/meta_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Meta Wiki."""
#
# (C) Pywikibot team, 2005-2016
diff --git a/pywikibot/families/omegawiki_family.py b/pywikibot/families/omegawiki_family.py
index 7f64150..534b645 100644
--- a/pywikibot/families/omegawiki_family.py
+++ b/pywikibot/families/omegawiki_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Omega Wiki."""
#
# (C) Pywikibot team, 2006-2015
diff --git a/pywikibot/families/osm_family.py b/pywikibot/families/osm_family.py
index 01a6f22..b0255b9 100644
--- a/pywikibot/families/osm_family.py
+++ b/pywikibot/families/osm_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for OpenStreetMap wiki."""
#
# (C) Pywikibot team, 2009-2015
diff --git a/pywikibot/families/outreach_family.py b/pywikibot/families/outreach_family.py
index bf08b84..5afe6e5 100644
--- a/pywikibot/families/outreach_family.py
+++ b/pywikibot/families/outreach_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikimedia outreach wiki."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/pywikibot/families/species_family.py b/pywikibot/families/species_family.py
index 7b3b78e..e4718f0 100644
--- a/pywikibot/families/species_family.py
+++ b/pywikibot/families/species_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikimedia species wiki."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/strategy_family.py b/pywikibot/families/strategy_family.py
index ebdaf6c..054df60 100644
--- a/pywikibot/families/strategy_family.py
+++ b/pywikibot/families/strategy_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikimedia Strategy Wiki."""
#
# (C) Pywikibot team, 2009-2015
diff --git a/pywikibot/families/test_family.py b/pywikibot/families/test_family.py
index 8a37be0..49d169e 100644
--- a/pywikibot/families/test_family.py
+++ b/pywikibot/families/test_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for test.wikipedia.org."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/vikidia_family.py b/pywikibot/families/vikidia_family.py
index 76b5e03..58dc145 100644
--- a/pywikibot/families/vikidia_family.py
+++ b/pywikibot/families/vikidia_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Vikidia."""
#
# (C) Pywikibot team, 2010-2016
diff --git a/pywikibot/families/wikibooks_family.py b/pywikibot/families/wikibooks_family.py
index 1daac8a..de4108e 100644
--- a/pywikibot/families/wikibooks_family.py
+++ b/pywikibot/families/wikibooks_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikibooks."""
#
# (C) Pywikibot team, 2005-2016
diff --git a/pywikibot/families/wikidata_family.py b/pywikibot/families/wikidata_family.py
index f5593f1..b2f8d44 100644
--- a/pywikibot/families/wikidata_family.py
+++ b/pywikibot/families/wikidata_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikidata."""
#
# (C) Pywikibot team, 2012-2016
diff --git a/pywikibot/families/wikinews_family.py b/pywikibot/families/wikinews_family.py
index c6b642f..3faeb7b 100644
--- a/pywikibot/families/wikinews_family.py
+++ b/pywikibot/families/wikinews_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikinews."""
#
# (C) Pywikibot team, 2005-2016
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index 03955c4..5d08026 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikipedia."""
#
# (C) Pywikibot team, 2004-2016
diff --git a/pywikibot/families/wikiquote_family.py b/pywikibot/families/wikiquote_family.py
index 20919f4..4adc07f 100644
--- a/pywikibot/families/wikiquote_family.py
+++ b/pywikibot/families/wikiquote_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikiquote."""
#
# (C) Pywikibot team, 2005-2016
diff --git a/pywikibot/families/wikisource_family.py b/pywikibot/families/wikisource_family.py
index 074c93b..661ca2b 100644
--- a/pywikibot/families/wikisource_family.py
+++ b/pywikibot/families/wikisource_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikisource."""
#
# (C) Pywikibot team, 2004-2016
diff --git a/pywikibot/families/wikitech_family.py b/pywikibot/families/wikitech_family.py
index 9793659..73cdb8b 100644
--- a/pywikibot/families/wikitech_family.py
+++ b/pywikibot/families/wikitech_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikitech."""
#
# (C) Pywikibot team, 2005-2015
diff --git a/pywikibot/families/wikiversity_family.py b/pywikibot/families/wikiversity_family.py
index ed65423..9ebc0d5 100644
--- a/pywikibot/families/wikiversity_family.py
+++ b/pywikibot/families/wikiversity_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikiversity."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/families/wiktionary_family.py b/pywikibot/families/wiktionary_family.py
index 140bd50..f8938cc 100644
--- a/pywikibot/families/wiktionary_family.py
+++ b/pywikibot/families/wiktionary_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wiktionary."""
#
# (C) Pywikibot team, 2005-2016
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index 4a602aa..58ee757 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for WOW Wiki."""
#
# (C) Pywikibot team, 2009-2015
@@ -31,7 +31,7 @@
def __init__(self):
"""Constructor."""
super(Family, self).__init__()
- # Override 'sv'. http://sv.wow.wikia.com is an empty wiki.
+ # Override 'sv'. http://sv.wow.wikia.com is an empty wiki.
# The interwikimap in this family map 'sv' to this empty wiki.
self.langs['sv'] = 'sv.warcraft.wikia.com'
diff --git a/pywikibot/family.py b/pywikibot/family.py
index d11dfea..e1157cb 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -740,7 +740,7 @@
self.category_text_separator = config.line_separator * 2
# When both at the bottom should categories come after interwikilinks?
# TODO: T86284 Needed on Wikia sites, as it uses the CategorySelect
- # extension which puts categories last on all sites. TO BE DEPRECATED!
+ # extension which puts categories last on all sites. TO BE DEPRECATED!
self.categories_last = []
# Which languages have a special order for putting interlanguage
diff --git a/pywikibot/fixes.py b/pywikibot/fixes.py
index b6049b2..6586cf4 100644
--- a/pywikibot/fixes.py
+++ b/pywikibot/fixes.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""File containing all standard fixes."""
#
# (C) Pywikibot team, 2008-2010
@@ -387,7 +387,7 @@
(r'ISBN: (\d+)', r'ISBN \1'),
# superfluous word "number"
(r'ISBN( number| no\.?| No\.?|-Nummer|-Nr\.):? (\d+)', r'ISBN \2'),
- # Space, minus, dot, hypen, en dash, em dash, etc. instead of
+ # Space, minus, dot, hypen, en dash, em dash, etc. instead of
# hyphen-minus as separator, or spaces between digits and separators.
# Note that these regular expressions also match valid ISBNs, but
# these won't be changed.
diff --git a/pywikibot/flow.py b/pywikibot/flow.py
index 9ccb5f5..5f8a006 100644
--- a/pywikibot/flow.py
+++ b/pywikibot/flow.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Objects representing Flow entities, like boards, topics, and posts."""
#
# (C) Pywikibot team, 2015
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index f529aba..86e8748 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Various i18n functions.
@@ -6,15 +6,15 @@
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
-'scripts.i18n'. In pywikibot 2.0, that package is not packaged
+'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does not have a hard dependency
-on any i18n messages. However, there are three user input questions
+on any i18n messages. However, there are three user input questions
in pagegenerators which will use i18 messages if they can be loaded.
The default message location may be changed by calling
-L{set_message_package} with a package name. The package must contain
+L{set_message_package} with a package name. The package must contain
an __init__.py, and a message bundle called 'pywikibot' containing
-messages. See L{twntranslate} for more information on the messages.
+messages. See L{twntranslate} for more information on the messages.
"""
#
# (C) Pywikibot team, 2004-2016
@@ -44,8 +44,8 @@
PLURAL_PATTERN = r'{{PLURAL:(?:%\()?([^\)]*?)(?:\)d)?\|(.*?)}}'
-# Package name for the translation messages. The messages data must loaded
-# relative to that package name. In the top of this package should be
+# Package name for the translation messages. The messages data must loaded
+# relative to that package name. In the top of this package should be
# directories named after for each script/message bundle, and each directory
# should contain JSON files called <lang>.json
_messages_package_name = 'scripts.i18n'
diff --git a/pywikibot/interwiki_graph.py b/pywikibot/interwiki_graph.py
index 85d903b..29907d7 100644
--- a/pywikibot/interwiki_graph.py
+++ b/pywikibot/interwiki_graph.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module with the Graphviz drawing calls."""
#
# (C) Pywikibot team, 2006-2016
@@ -103,7 +103,7 @@
def originPage(self):
"""Deprecated property for the origin page.
- DEPRECATED. Use origin.
+ DEPRECATED. Use origin.
"""
# TODO: deprecate this property
return self.origin
@@ -112,7 +112,7 @@
def originPage(self, value):
"""Deprecated property for the origin page.
- DEPRECATED. Use origin.
+ DEPRECATED. Use origin.
"""
self.origin = value
@@ -120,7 +120,7 @@
def foundIn(self):
"""Mapping of pages to others pages interwiki linked to it.
- DEPRECATED. Use found_in.
+ DEPRECATED. Use found_in.
"""
# TODO: deprecate this property
return self.found_in
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 031483c..7665806 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Objects representing Mediawiki log entries."""
#
# (C) Pywikibot team, 2007-2016
diff --git a/pywikibot/logging.py b/pywikibot/logging.py
index ab7b01c..e8edec6 100644
--- a/pywikibot/logging.py
+++ b/pywikibot/logging.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Logging functions."""
#
# (C) Pywikibot team, 2010-2016
@@ -45,12 +45,12 @@
# User output/logging functions
# Six output functions are defined. Each requires a unicode or string
-# argument. All of these functions generate a message to the log file if
+# argument. All of these functions generate a message to the log file if
# logging is enabled ("-log" or "-debug" command line arguments).
# The functions output(), stdout(), warning(), and error() all display a
# message to the user through the logger object; the only difference is the
-# priority level, which can be used by the application layer to alter the
+# priority level, which can be used by the application layer to alter the
# display. The stdout() function should be used only for data that is
# the "result" of a script, as opposed to information messages to the
# user.
diff --git a/pywikibot/login.py b/pywikibot/login.py
index aa45e90..e110c47 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Library to log the bot in to a wiki account."""
#
# (C) Rob W.W. Hooft, 2003
@@ -182,10 +182,12 @@
"""
Login to the site.
- remember Remember login (default: True)
- captchaId A dictionary containing the captcha id and answer, if any
+ @param remember: Remember login (default: True)
+ @type remember: bool
+ @param captchaId: A dictionary containing the captcha id and answer,
+ if any
- Returns cookie data if successful, None otherwise.
+ @return: cookie data if successful, None otherwise.
"""
# NOT IMPLEMENTED - see data/api.py for implementation
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 165e7c8..61fb71a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -109,7 +109,7 @@
BasePage: Base object for a MediaWiki page.
This object only implements internally methods that do not require
- reading from or writing to the wiki. All other methods are delegated
+ reading from or writing to the wiki. All other methods are delegated
to the Site object.
Will be subclassed by Page, WikibasePage, and FlowPage.
@@ -130,7 +130,7 @@
- If the first argument is a Page, create a copy of that object.
This can be used to convert an existing Page into a subclass
- object, such as Category or FilePage. (If the title is also
+ object, such as Category or FilePage. (If the title is also
given as the second argument, creates a copy with that title;
this is used when pages are moved.)
- If the first argument is a Site, create a Page on that Site
@@ -138,7 +138,7 @@
and the third as the namespace number. The namespace number is
mandatory, even if the title includes the namespace prefix. This
is the preferred syntax when using an already-normalized title
- obtained from api.php or a database dump. WARNING: may produce
+ obtained from api.php or a database dump. WARNING: may produce
invalid objects if page title isn't in normal form!
- If the first argument is a Link, create a Page from that link.
This is the preferred syntax when using a title scraped from
@@ -858,7 +858,7 @@
Return other member of the article-talk page pair for this Page.
If self is a talk page, returns the associated content page;
- otherwise, returns the associated talk page. The returned page need
+ otherwise, returns the associated talk page. The returned page need
not actually exist on the wiki.
@return: Page or None if self is a special page.
@@ -1278,7 +1278,7 @@
Save the page with the contents of the first argument as the text.
This method is maintained primarily for backwards-compatibility.
- For new code, using Page.save() is preferred. See save() method
+ For new code, using Page.save() is preferred. See save() method
docs for all parameters not listed here.
@param newtext: The complete text of the revised page.
@@ -1299,7 +1299,7 @@
Asynchronous version of put (takes the same arguments), which places
pages on a queue to be saved by a daemon thread. All arguments are
- the same as for .put(). This version is maintained solely for
+ the same as for .put(). This version is maintained solely for
backwards-compatibility.
"""
self.put(newtext, summary=summary, watchArticle=watchArticle,
@@ -1483,7 +1483,7 @@
"""
Return a list of Page objects for templates used on this Page.
- Template parameters are ignored. This method only returns embedded
+ Template parameters are ignored. This method only returns embedded
templates, not template pages that happen to be referenced through
a normal link.
@@ -1502,7 +1502,7 @@
"""
Iterate Page objects for templates used on this Page.
- Template parameters are ignored. This method only returns embedded
+ Template parameters are ignored. This method only returns embedded
templates, not template pages that happen to be referenced through
a normal link.
@@ -1942,12 +1942,12 @@
@param protections: A dict mapping type of protection to protection
level of that type.
- @type protections: dict
+ @type protections: dict
@param reason: Reason for the action
- @type reason: basestring
+ @type reason: basestring
@param prompt: Whether to ask user for confirmation (deprecated).
Defaults to protections is None
- @type prompt: bool
+ @type prompt: bool
"""
def process_deprecated_arg(value, arg_name):
# if protections was set and value is None, don't interpret that
@@ -2682,7 +2682,7 @@
def copyTo(self, cat, message):
"""
- Copy text of category page to a new page. Does not move contents.
+ Copy text of category page to a new page. Does not move contents.
@param cat: New category title (without namespace) or Category object
@type cat: unicode or Category
@@ -2723,7 +2723,7 @@
Copy partial category page text (not contents) to a new title.
Like copyTo above, except this removes a list of templates (like
- deletion templates) that appear in the old category text. It also
+ deletion templates) that appear in the old category text. It also
removes all text between the two HTML comments BEGIN CFD TEMPLATE
and END CFD TEMPLATE. (This is to deal with CFD templates that are
substituted.)
@@ -3860,7 +3860,7 @@
if lazy_loading_id or self._link._text != self.id:
# If the item is lazy loaded or has been modified,
- # _link._text is stale. Removing _link._title
+ # _link._text is stale. Removing _link._title
# forces Link to re-parse ._text into ._title.
if hasattr(self._link, '_title'):
del self._link._title
@@ -3880,10 +3880,10 @@
Get the ItemPage for a Page that links to it.
@param page: Page to look for corresponding data item
- @type page: pywikibot.Page
+ @type page: pywikibot.Page
@param lazy_load: Do not raise NoPage if either page or corresponding
ItemPage does not exist.
- @type lazy_load: bool
+ @type lazy_load: bool
@rtype: ItemPage
@raise NoPage: There is no corresponding ItemPage for the page
@@ -4191,7 +4191,7 @@
Return the type of this property.
It returns 'globecoordinate' for type 'globe-coordinate'
- in order to be backwards compatible. See
+ in order to be backwards compatible. See
https://gerrit.wikimedia.org/r/#/c/135405/ for background.
"""
if self.type == 'globe-coordinate':
@@ -4566,7 +4566,7 @@
def removeSource(self, source, **kwargs):
"""
- Remove the source. Calls removeSources().
+ Remove the source. Call removeSources().
@param source: the source to remove
@type source: pywikibot.Claim
@@ -4603,7 +4603,7 @@
def removeQualifier(self, qualifier, **kwargs):
"""
- Remove the qualifier. Calls removeQualifiers().
+ Remove the qualifier. Call removeQualifiers().
@param qualifier: the qualifier to remove
@type qualifier: Claim
@@ -4883,7 +4883,7 @@
Has the following attributes:
- - site: The Site object for the wiki linked to
+ - site: The Site object for the wiki linked to
- namespace: The namespace of the page linked to (int)
- title: The title of the page linked to (unicode); does not include
namespace or section
@@ -4961,7 +4961,7 @@
# Normalize unicode string to a NFC (composed) format to allow
# proper string comparisons to strings output from MediaWiki API.
# Due to Python issue 10254, this is not possible on Python 2.6.6
- # if the string contains combining characters. See T102461.
+ # if the string contains combining characters. See T102461.
if (PYTHON_VERSION == (2, 6, 6) and
unicodedata.__name__ != 'unicodedata2' and
any(unicodedata.combining(c) for c in t)):
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e60c98f..979f89b 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This module offers a wide variety of page generators.
@@ -293,7 +293,7 @@
Argument can also be given as "-google:searchstring".
-yahoo Work on all pages that are found in a Yahoo search.
- Depends on python module pYsearch. See yahoo_appid in
+ Depends on python module pYsearch. See yahoo_appid in
config.py for instructions.
-page Work on a single page. Argument can also be given as
@@ -621,7 +621,7 @@
If it is recognized as an argument that specifies a generator, a
generator is created and added to the accumulation list, and the
- function returns true. Otherwise, it returns false, so that caller
+ function returns true. Otherwise, it returns false, so that caller
can try parsing the argument. Call getCombinedGenerator() after all
arguments have been parsed to get the final output generator.
@@ -1395,7 +1395,7 @@
@type namespaces: iterable of basestring or Namespace key,
or a single instance of those types.
@param site: Site for generator results; mandatory if
- namespaces contains namespace names. Defaults to the default site.
+ namespaces contains namespace names. Defaults to the default site.
@type site: L{pywikibot.site.BaseSite}
@raises KeyError: a namespace identifier was not resolved
@raises TypeError: a namespace identifier has an inappropriate
@@ -2012,13 +2012,13 @@
if not has_item:
if show_filtered:
pywikibot.output(
- '%s has a wikidata item. Skipping.' % page)
+ '%s has a wikidata item. Skipping.' % page)
continue
else:
if has_item:
if show_filtered:
pywikibot.output(
- '%s doesn\'t have a wikidata item. Skipping.' % page)
+ '%s doesn\'t have a wikidata item. Skipping.' % page)
continue
yield page
diff --git a/pywikibot/plural.py b/pywikibot/plural.py
index ddb6ce1..ce94fa5 100644
--- a/pywikibot/plural.py
+++ b/pywikibot/plural.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module containing plural rules of various languages."""
#
# (C) xqt, 2011
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index 306bd74..cea677f 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Objects representing objects used with ProofreadPage Extension.
@@ -350,9 +350,8 @@
@param value: New value or None
@param value: basestring
- Raises:
- exception Error: the page is not formatted according to ProofreadPage
- extension.
+ @raise Error: the page is not formatted according to ProofreadPage
+ extension.
"""
self._text = value
if self._text:
@@ -369,9 +368,8 @@
def _decompose_page(self):
"""Split Proofread Page text in header, body and footer.
- Raises:
- exception Error: the page is not formatted according to ProofreadPage
- extension.
+ @raise Error: the page is not formatted according to ProofreadPage
+ extension.
"""
# Property force page text loading.
if not (hasattr(self, '_text') or self.text):
@@ -647,7 +645,7 @@
@type end: int
@param filter_ql: filters quality levels
if None: all but 'Without Text'.
- @type filter_ql: list of ints (corresponding to ql constants
+ @type filter_ql: list of ints (corresponding to ql constants
defined in ProofreadPage).
@param only_existing: yields only existing pages.
@type only_existing: bool
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 780b48b..86f4b6e 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Objects representing MediaWiki sites (wikis).
@@ -473,7 +473,7 @@
Identifiers may be any value for which int() produces a valid
namespace id, except bool, or any string which Namespace.lookup_name
- successfully finds. A numerical string is resolved as an integer.
+ successfully finds. A numerical string is resolved as an integer.
@param identifiers: namespace identifiers
@type identifiers: iterable of basestring or Namespace key,
@@ -602,7 +602,7 @@
Identifiers may be any value for which int() produces a valid
namespace id, except bool, or any string which Namespace.lookup_name
- successfully finds. A numerical string is resolved as an integer.
+ successfully finds. A numerical string is resolved as an integer.
@param identifiers: namespace identifiers
@type identifiers: iterable of basestring or Namespace key,
@@ -798,7 +798,7 @@
@property
def throttle(self):
- """Return this Site's throttle. Initialize a new one if needed."""
+ """Return this Site's throttle. Initialize a new one if needed."""
if not hasattr(self, "_throttle"):
self._throttle = Throttle(self, multiplydelay=True)
return self._throttle
@@ -1047,7 +1047,7 @@
def lock_page(self, page, block=True):
"""
- Lock page for writing. Must be called before writing any page.
+ Lock page for writing. Must be called before writing any page.
We don't want different threads trying to write to the same page
at the same time, even to different sections.
@@ -1070,7 +1070,7 @@
def unlock_page(self, page):
"""
- Unlock page. Call as soon as a write operation has completed.
+ Unlock page. Call as soon as a write operation has completed.
@param page: the page to be locked
@type page: pywikibot.Page
@@ -1226,7 +1226,7 @@
# site-specific formatting preferences
def category_on_one_line(self):
- # TODO: is this even needed? No family in the framework uses it.
+ # TODO: is this even needed? No family in the framework uses it.
"""Return True if this site wants all category links on one line."""
return self.code in self.family.category_on_one_line
@@ -1753,7 +1753,7 @@
Preload one or multiple tokens.
@param types: the types of token.
- @type types: iterable
+ @type types: iterable
@param all: load all available tokens, if None only if it can be done
in one request.
@type all: bool
@@ -1929,7 +1929,7 @@
@param namespaces: if not None, limit the query to namespaces in this
list
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param total: if not None, limit the generator to yielding this many
items in total
@@ -2040,7 +2040,7 @@
# is not already IN_PROGRESS, however the
# login status may be left 'IN_PROGRESS' because
# of exceptions or if the first method of login
- # (below) is successful. Instead, log the problem,
+ # (below) is successful. Instead, log the problem,
# to be increased to 'warning' level once majority
# of issues are resolved.
if self._loginstatus == LoginStatus.IN_PROGRESS:
@@ -3326,7 +3326,7 @@
@param types: the types of token (e.g., "edit", "move", "delete");
see API documentation for full list of types
- @type types: iterable
+ @type types: iterable
@param all: load all available tokens, if None only if it can be done
in one request.
@type all: bool
@@ -3468,7 +3468,7 @@
@param namespaces: If present, only return links from the namespaces
in this list.
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param total: Maximum number of pages to retrieve in total.
@param content: if True, load the current content of each iterated page
@@ -3526,7 +3526,7 @@
@param namespaces: If present, only return links from the namespaces
in this list.
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param content: if True, load the current content of each iterated page
(default False)
@@ -3554,7 +3554,7 @@
@param namespaces: If present, only return links from the namespaces
in this list.
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@raises KeyError: a namespace identifier was not resolved
@raises TypeError: a namespace identifier has an inappropriate
@@ -3586,7 +3586,7 @@
@param namespaces: Only iterate pages in these namespaces (default: all)
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param follow_redirects: if True, yields the target of any redirects,
rather than the redirect page
@@ -3649,7 +3649,7 @@
@param namespaces: Only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param content: if True, load the current content of each iterated page
(default False)
@@ -3676,7 +3676,7 @@
these namespaces. To yield subcategories or files, use
parameter member_type instead.
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param sortby: determines the order in which results are generated,
valid values are "sortkey" (default, results ordered by category
@@ -4343,7 +4343,7 @@
@type image: FilePage
@param namespaces: If present, only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param filterredir: if True, only yield redirects; if False (and not
None), only yield non-redirects (default: yield both)
@@ -4474,7 +4474,7 @@
@type reverse: bool
@param namespaces: only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param pagelist: iterate changes to pages in this list only
@param pagelist: list of Pages
@@ -4566,7 +4566,7 @@
"nearmatch" (many wikis do not support title or nearmatch search)
@param namespaces: search only in these namespaces (defaults to all)
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param get_redirects: if True, include redirects in results. Since
version MediaWiki 1.23 it will always return redirects.
@@ -4628,7 +4628,7 @@
@param reverse: Iterate oldest contributions first (default: newest)
@param namespaces: only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param showMinor: if True, iterate only minor edits; if False and
not None, iterate only non-minor edits (default: iterate both)
@@ -4677,7 +4677,7 @@
@param reverse: Iterate oldest revisions first (default: newest)
@param namespaces: only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param showMinor: if True, only list minor edits; if False (and not
None), only list non-minor edits
@@ -4815,7 +4815,7 @@
@param total: the maximum number of pages to iterate (default: 1)
@param namespaces: only iterate pages in these namespaces.
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@param redirects: if True, include only redirect pages in results
(default: include only non-redirects)
@@ -5459,9 +5459,9 @@
'create', and 'upload'. Valid protection levels (in MediaWiki 1.12)
are '' (equivalent to 'none'), 'autoconfirmed', and 'sysop'.
If None is given, however, that protection will be skipped.
- @type protections: dict
+ @type protections: dict
@param reason: Reason for the action
- @type reason: basestring
+ @type reason: basestring
@param expiry: When the block should expire. This expiry will be applied
to all protections. If None, 'infinite', 'indefinite', 'never', or ''
is given, there is no expiry.
@@ -6226,7 +6226,7 @@
@param namespaces: only iterate pages in these namespaces
@type namespaces: iterable of basestring or Namespace key,
- or a single instance of those types. May be a '|' separated
+ or a single instance of those types. May be a '|' separated
list of namespace identifiers.
@raises KeyError: a namespace identifier was not resolved
@raises TypeError: a namespace identifier has an inappropriate
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index a6a3003..cc69e4b 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Classes for detecting a MediaWiki site."""
#
# (C) Pywikibot team, 2010-2015
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index fc7c4b1..8c020d9 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -573,7 +573,7 @@
remaining.
@param text: the text in which to replace links
- @type text: basestring
+ @type text: basestring
@param replace: either a callable which reacts like described above.
The callable must accept four parameters link, text, groups, rng and
allows for user interaction. The groups are a dict containing 'title',
@@ -586,11 +586,11 @@
result by the callable. It'll convert that into a callable where the
first item (the Link or Page) has to be equal to the found link and in
that case it will apply the second value from the sequence.
- @type replace: sequence of pywikibot.Page/pywikibot.Link/str or
+ @type replace: sequence of pywikibot.Page/pywikibot.Link/str or
callable
@param site: a Site object to use if replace is not a sequence or the link
to be replaced is not a Link or Page instance.
- @type site: pywikibot.APISite
+ @type site: pywikibot.APISite
"""
def to_link(source):
"""Return the link from source when it's a Page otherwise itself."""
@@ -796,7 +796,7 @@
# Families having those have one member only, and do not have
# language-specific sites. The name of the target family of their
# inter-language links is kept in their interwiki_forward attribute.
-# These functions only deal with links of these two kinds only. They
+# These functions only deal with links of these two kinds only. They
# do not find or change links of other kinds, nor any that are formatted
# as in-line interwiki links (e.g., "[[:es:Articulo]]".
@@ -1339,7 +1339,7 @@
Return value is a list of tuples. There is one tuple for each use of a
template in the page, with the template title as the first entry and a
- dict of parameters as the second entry. Parameters are indexed by
+ dict of parameters as the second entry. Parameters are indexed by
strings; as in MediaWiki, an unnamed parameter is given a parameter name
with an integer value corresponding to its position among the unnamed
parameters, and if this results multiple parameters with the same name
@@ -1354,7 +1354,7 @@
The two implementations return nested templates in a different order.
i.e. for {{a|b={{c}}}}, mwpfh returns [a, c], whereas regex returns [c, a].
- mwpfh preserves whitespace in parameter names and values. regex excludes
+ mwpfh preserves whitespace in parameter names and values. regex excludes
anything between <!-- --> before parsing the text.
If there are multiple numbered parameters in the wikitext for the same
@@ -1365,7 +1365,7 @@
@param text: The wikitext from which templates are extracted
@type text: unicode or string
@param remove_disabled_parts: Remove disabled wikitext such as comments
- and pre. If None (default), this is enabled when mwparserfromhell
+ and pre. If None (default), this is enabled when mwparserfromhell
is not available or is disabled in the config, and disabled if
mwparserfromhell is present and enabled in the config.
@type remove_disabled_parts: bool or None
@@ -1711,7 +1711,7 @@
@param text: a wiki text
@type text: str
- @return: list of stars templates
+ @return: list of stars templates
@rtype: list
"""
allstars = []
@@ -1875,7 +1875,8 @@
if _short.endswith('.'):
self.origNames2monthNum[_short[:-1]] = n
- self.groups = [u'year', u'month', u'hour', u'time', u'day', u'minute', u'tzinfo']
+ self.groups = ['year', 'month', 'hour', 'time', 'day', 'minute',
+ 'tzinfo']
timeR = r'(?P<time>(?P<hour>([0-1]\d|2[0-3]))[:\.h](?P<minute>[0-5]\d))'
timeznR = r'\((?P<tzinfo>[A-Z]+)\)'
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index d125df1..04bc1e1 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Mechanics to slow down wiki read and/or write rate."""
#
# (C) Pywikibot team, 2008
diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index 790e17e..64d617b 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Title translate module."""
#
# (C) Rob W.W. Hooft, 2003
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 2b7a0e1..526fd93 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Miscellaneous helper functions (not wiki-dependent)."""
#
# (C) Pywikibot team, 2008-2016
@@ -538,7 +538,7 @@
Important: the generator thread will stop itself if the generator's
internal queue is exhausted; but, if the calling program does not use
all the generated values, it must call the generator's stop() method to
- stop the background thread. Example usage:
+ stop the background thread. Example usage:
>>> gen = ThreadedGenerator(target=range, args=(20,))
>>> try:
@@ -552,7 +552,7 @@
def __init__(self, group=None, target=None, name="GeneratorThread",
args=(), kwargs=None, qsize=65536):
- """Constructor. Takes same keyword arguments as threading.Thread.
+ """Constructor. Takes same keyword arguments as threading.Thread.
target must be a generator function (or other callable that returns
an iterable object).
@@ -654,7 +654,7 @@
and the additional keyword marker.
@param iterable: the iterable to work on
- @type iterable: iterable
+ @type iterable: iterable
@param args: same args as:
- C{itertools.islice(iterable, stop)}
- C{itertools.islice(iterable, start, stop[, step])}
@@ -691,7 +691,7 @@
"""A simple threadpool class to limit the number of simultaneous threads.
Any threading.Thread object can be added to the pool using the append()
- method. If the maximum number of simultaneous threads has not been reached,
+ method. If the maximum number of simultaneous threads has not been reached,
the Thread object will be started immediately; if not, the append() call
will block until the thread is able to start.
@@ -841,7 +841,7 @@
The container can be any object that supports __contains__.
If the container is a set or dict, the method add or __setitem__ will be
- used automatically. Any other method may be provided explicitly using the
+ used automatically. Any other method may be provided explicitly using the
add parameter.
Beware that key=id is only useful for cases where id() is not unique.
@@ -1128,7 +1128,7 @@
# Decorators
#
# Decorator functions without parameters are _invoked_ differently from
-# decorator functions with function syntax. For example, @deprecated causes
+# decorator functions with function syntax. For example, @deprecated causes
# a different invocation to @deprecated().
# The former is invoked with the decorated function as args[0].
@@ -1137,8 +1137,8 @@
# function as args[0].
# The follow deprecators may support both syntax, e.g. @deprecated and
-# @deprecated() both work. In order to achieve that, the code inspects
-# args[0] to see if it callable. Therefore, a decorator must not accept
+# @deprecated() both work. In order to achieve that, the code inspects
+# args[0] to see if it callable. Therefore, a decorator must not accept
# only one arg, and that arg be a callable, as it will be detected as
# a deprecator without any arguments.
@@ -1149,7 +1149,7 @@
inspect.signature was introduced in 3.3, however backports are available.
In Python 3.3, it does not support all types of callables, and should
- not be relied upon. Python 3.4 works correctly.
+ not be relied upon. Python 3.4 works correctly.
Any exception calling inspect.signature is ignored and None is returned.
diff --git a/pywikibot/tools/_logging.py b/pywikibot/tools/_logging.py
index 3b07379..55d4c7d 100644
--- a/pywikibot/tools/_logging.py
+++ b/pywikibot/tools/_logging.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Logging tools."""
#
# (C) Pywikibot team, 2009-2015
@@ -121,7 +121,7 @@
Make sure that the exception trace is converted to unicode.
L{exceptions.Error} traces are encoded in our console encoding, which
- is needed for plainly printing them. However, when logging them
+ is needed for plainly printing them. However, when logging them
using logging.exception, the Python logging module will try to use
these traces, and it will fail if they are console encoded strings.
diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py
index e659a43..da7c595 100644
--- a/pywikibot/tools/djvu.py
+++ b/pywikibot/tools/djvu.py
@@ -33,7 +33,7 @@
Constructor.
@param file_djvu: filename (including path) to djvu file
- @type file_djvu: string/unicode
+ @type file_djvu: string/unicode
"""
file_djvu = os.path.expanduser(file_djvu)
# Check file exists and has read permissions.
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index 47f6762..6c95058 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module containing various formatting related utilities."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/pywikibot/tools/ip.py b/pywikibot/tools/ip.py
index 675eed8..0b2a99f 100644
--- a/pywikibot/tools/ip.py
+++ b/pywikibot/tools/ip.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""IP address tools module."""
#
# (C) Pywikibot team, 2015
@@ -97,7 +97,7 @@
"""
Verify the IP address provided is valid.
- No logging is performed. Use ip_address instead to catch errors.
+ No logging is performed. Use ip_address instead to catch errors.
@param IP: IP address
@type IP: unicode
diff --git a/pywikibot/userinterfaces/__init__.py b/pywikibot/userinterfaces/__init__.py
index 5f9e6ac..fb83868 100644
--- a/pywikibot/userinterfaces/__init__.py
+++ b/pywikibot/userinterfaces/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""User interfaces."""
#
# (C) Pywikibot team, 2007
diff --git a/pywikibot/userinterfaces/cgi_interface.py b/pywikibot/userinterfaces/cgi_interface.py
index ee1640c..91a9ba7 100644
--- a/pywikibot/userinterfaces/cgi_interface.py
+++ b/pywikibot/userinterfaces/cgi_interface.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""CGI user interface."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py
index 454c005..27bc8cc 100644
--- a/pywikibot/userinterfaces/gui.py
+++ b/pywikibot/userinterfaces/gui.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
A window with a unicode textfield where the user can edit.
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index bb30c1c..f0c20cb 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -84,7 +84,7 @@
This method initializes handler(s) for output levels VERBOSE (if
enabled by config.verbose_output), INFO, STDOUT, WARNING, ERROR,
- and CRITICAL. STDOUT writes its output to sys.stdout; all the
+ and CRITICAL. STDOUT writes its output to sys.stdout; all the
others write theirs to sys.stderr.
"""
@@ -257,7 +257,7 @@
Works like raw_input(), but returns a unicode string instead of ASCII.
Unlike raw_input, this function automatically adds a colon and space
- after the question if they are not already present. Also recognises
+ after the question if they are not already present. Also recognises
a trailing question mark.
@param question: The question, without trailing whitespace.
diff --git a/pywikibot/userinterfaces/terminal_interface_unix.py b/pywikibot/userinterfaces/terminal_interface_unix.py
index 789f319..5f94858 100755
--- a/pywikibot/userinterfaces/terminal_interface_unix.py
+++ b/pywikibot/userinterfaces/terminal_interface_unix.py
@@ -50,7 +50,7 @@
def encounter_color(self, color, target_stream):
"""Write the unix color directly to the stream."""
- fg, bg = self.divide_color(color)
+ fg, bg = self.divide_color(color)
fg = unixColors[fg]
self._write(fg, target_stream)
if bg is not None:
diff --git a/pywikibot/userinterfaces/transliteration.py b/pywikibot/userinterfaces/transliteration.py
index 3d2ded4..357cb84 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module to transliterate text."""
#
# (C) Pywikibot team, 2006-2015
diff --git a/pywikibot/userinterfaces/win32_unicode.py b/pywikibot/userinterfaces/win32_unicode.py
index 36c47d3..d77baf1 100755
--- a/pywikibot/userinterfaces/win32_unicode.py
+++ b/pywikibot/userinterfaces/win32_unicode.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Stdout, stderr and argv support for unicode."""
#
# (C) David-Sarah Hopwood, 2010
diff --git a/pywikibot/version.py b/pywikibot/version.py
index bd4d841..2cc8ba3 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Module to determine the pywikibot version (tag, revision and date)."""
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2014
diff --git a/pywikibot/weblib.py b/pywikibot/weblib.py
index df8a7b5..4c27358 100644
--- a/pywikibot/weblib.py
+++ b/pywikibot/weblib.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Functions for manipulating external links or querying third-party sites."""
#
# (C) Pywikibot team, 2013
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py
index cb47bc8..5d7a412 100644
--- a/pywikibot/xmlreader.py
+++ b/pywikibot/xmlreader.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
XML reading module.
diff --git a/scripts/__init__.py b/scripts/__init__.py
index 03688c1..c5f2e74 100644
--- a/scripts/__init__.py
+++ b/scripts/__init__.py
@@ -1,2 +1,2 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""THIS DIRECTORY IS TO HOLD BOT SCRIPTS FOR THE NEW FRAMEWORK."""
diff --git a/scripts/add_text.py b/scripts/add_text.py
index 9beb31a..90bd4a6 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
This is a Bot to add a text at the end of the content of the page.
diff --git a/scripts/archive/__init__.py b/scripts/archive/__init__.py
index 335234f..f1adf7c 100644
--- a/scripts/archive/__init__.py
+++ b/scripts/archive/__init__.py
@@ -1,2 +1,2 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""THIS DIRECTORY IS TO HOLD BOT SCRIPTS THAT NO LONGER IS MAINTENANCED."""
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 807707e..e90b0c5 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
A bot to remove stale protection templates from pages that are not protected.
@@ -73,7 +73,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
# PREFERENCES
diff --git a/scripts/blockreview.py b/scripts/blockreview.py
index 5b595ff..21a351e 100755
--- a/scripts/blockreview.py
+++ b/scripts/blockreview.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot implements a blocking review process for de-wiki first.
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py
index f811eec..7a7d75d 100755
--- a/scripts/capitalize_redirects.py
+++ b/scripts/capitalize_redirects.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Bot to create capitalized redirects.
diff --git a/scripts/casechecker.py b/scripts/casechecker.py
index 925e0a9..80e206f 100755
--- a/scripts/casechecker.py
+++ b/scripts/casechecker.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Bot to find all pages on the wiki with mixed latin and cyrilic alphabets."""
#
# (C) Pywikibot team, 2006-2016
@@ -51,7 +51,7 @@
latinKeyboard = u'qwertyuiopasdfghjklzxcvbnm'
romanNumChars = u'IVXLCDM'
- # all letters that may be used as suffixes after roman numbers: "Iый"
+ # all letters that may be used as suffixes after roman numbers: "Iый"
romannumSuffixes = localLowerLtr
romanNumSfxPtrn = re.compile(
u'^[' + romanNumChars + ']+[' + localLowerLtr + ']+$')
diff --git a/scripts/category.py b/scripts/category.py
index 17d5af7..698ae75 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -35,7 +35,7 @@
Options for "remove" action:
* -nodelsum - This specifies not to use the custom edit summary as the
- deletion reason. Instead, it uses the default deletion reason
+ deletion reason. Instead, it uses the default deletion reason
for the language, which is "Category was disbanded" in
English.
@@ -69,7 +69,7 @@
- Also, the name of the list to make in the listify option
NOTE: If the category names have spaces in them you may need to use
a special syntax in your shell so that the names aren't treated as
- separate parameters. For instance, in BASH, use single quotes,
+ separate parameters. For instance, in BASH, use single quotes,
e.g. -from:'Polar bears'
* -batch - Don't prompt to delete emptied categories (do it
automatically).
diff --git a/scripts/cfd.py b/scripts/cfd.py
index 96fa0a3..5ec80a8 100755
--- a/scripts/cfd.py
+++ b/scripts/cfd.py
@@ -38,8 +38,8 @@
# Regular expression declarations
# See the en-wiki CFD working page at [[Wikipedia:Categories for discussion/Working]]
-# to see how these work in context. To get this bot working on other wikis you will
-# need to adjust these regular expressions at the very least.
+# to see how these work in context. To get this bot working on other wikis you
+# will need to adjust these regular expressions at the very least.
nobots = re.compile(r"NO\s*BOTS", re.IGNORECASE)
example = re.compile(r"\[\[:Category:(.)\1\1\1\1\]\]", re.IGNORECASE)
speedymode = re.compile(r"^===*\s*Speedy Moves\s*===*\s*$", re.IGNORECASE)
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 24c6173..52ad71e 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -51,7 +51,7 @@
-nologerror If given, this option will disable the error that is risen
when the log is full.
----- Instructions for the real-time settings ----
+---- Instructions for the real-time settings ----
* For every new block you have to add:
<------- ------->
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index 6dfe4e1..ffe7878 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -139,7 +139,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
diff --git a/scripts/commons_link.py b/scripts/commons_link.py
index f83e20f..1ede549 100755
--- a/scripts/commons_link.py
+++ b/scripts/commons_link.py
@@ -42,7 +42,7 @@
from pywikibot import textlib, pagegenerators, i18n, Bot
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 6e78034..e43aa44 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
With this tool you can add the template {{commonscat}} to categories.
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 301ff7d..ec7a891 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -45,9 +45,7 @@
"""
Constructor.
- Arguments:
- * generator - A generator that yields Page objects.
-
+ @param generator: A generator that yields Page objects.
"""
super(CoordImportRobot, self).__init__()
self.generator = pagegenerators.PreloadingGenerator(generator)
@@ -59,7 +57,7 @@
Check if self.prop is used as property for a qualifier.
@param claims: the Wikibase claims to check in
- @type claims: dict
+ @type claims: dict
@return: the first property for which self.prop
is used as qualifier, or None if any
@return: unicode or None
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index c79061d..035c59d 100644
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This module can do slight modifications to tidy a wiki page's source code.
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index 836d1af..d8b0ca7 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
A generic bot to do data ingestion (batch uploading).
diff --git a/scripts/delete.py b/scripts/delete.py
index 4fbe618..8e704f5 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -73,7 +73,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
@@ -119,7 +119,7 @@
Returns a set with namespaces where a ref to page is present.
@param namespaces: Namespace to check
- @type namespaces: iterable of Namespace objects
+ @type namespaces: iterable of Namespace objects
@rtype set: namespaces where a ref to page is present
"""
if namespaces is None:
@@ -137,9 +137,9 @@
Constructor.
@param generator: the pages to work on
- @type generator: iterable
+ @type generator: iterable
@param summary: the reason for the (un)deletion
- @type summary: unicode
+ @type summary: unicode
"""
self.availableOptions.update({
'undelete': False,
diff --git a/scripts/disambredir.py b/scripts/disambredir.py
index 741a311..2460551 100755
--- a/scripts/disambredir.py
+++ b/scripts/disambredir.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
User assisted updating redirect links on disambiguation pages.
diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index 7a3589d..6a979b5 100644
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -60,11 +60,11 @@
Constructor.
@param djvu: djvu from where to fetch the text layer
- @type djvu: DjVuFile object
+ @type djvu: DjVuFile object
@param index: index page in the Index: namespace
- @type index: Page object
+ @type index: Page object
@param pages: page interval to upload (start, end)
- @type pages: tuple
+ @type pages: tuple
"""
self.availableOptions.update({
'force': False,
diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py
index fe02548..359082d 100755
--- a/scripts/fixing_redirects.py
+++ b/scripts/fixing_redirects.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Correct all redirect links in featured pages or only one page of each wiki.
@@ -34,7 +34,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
# Featured articles categories
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 4dfa9b9..d86f640 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Tool to copy a flickr stream to Commons.
diff --git a/scripts/freebasemappingupload.py b/scripts/freebasemappingupload.py
index 9ed598f..21046fe 100755
--- a/scripts/freebasemappingupload.py
+++ b/scripts/freebasemappingupload.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Script to upload the mappings of Freebase to Wikidata.
diff --git a/scripts/image.py b/scripts/image.py
index bfd3b32..9138549 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -13,15 +13,15 @@
Command line options:
--summary: Provide a custom edit summary. If the summary includes spaces,
+-summary: Provide a custom edit summary. If the summary includes spaces,
surround it with single quotes, such as:
-summary:'My edit summary'
-always Don't prompt to make changes, just do them.
--loose Do loose replacements. This will replace all occurrences of the name
- of the image (and not just explicit image syntax). This should work
+-loose Do loose replacements. This will replace all occurrences of the name
+ of the image (and not just explicit image syntax). This should work
to catch all instances of the image, including where it is used as a
- template parameter or in image galleries. However, it can also make
- more mistakes. This only works with image replacement, not image
+ template parameter or in image galleries. However, it can also make
+ more mistakes. This only works with image replacement, not image
removal.
Examples:
@@ -63,12 +63,12 @@
Constructor.
@param generator: the pages to work on
- @type generator: iterable
+ @type generator: iterable
@param old_image: the title of the old image (without namespace)
- @type old_image: unicode
+ @type old_image: unicode
@param new_image: the title of the new image (without namespace), or
None if you want to remove the image
- @type new_image: unicode or None
+ @type new_image: unicode or None
"""
self.availableOptions.update({
'summary': None,
diff --git a/scripts/imageharvest.py b/scripts/imageharvest.py
index 6e5e366..9026843 100644
--- a/scripts/imageharvest.py
+++ b/scripts/imageharvest.py
@@ -16,14 +16,15 @@
-shown Choose images shown on the page as well as linked from it
-justshown Choose _only_ images shown on the page, not those linked
"""
-# (C) Pywikibot team, 2004-2015
#
-# Distributed under the terms of the MIT license.
+# (C) Pywikibot team, 2004-2016
+#
+# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
-
+#
import os
import BeautifulSoup
diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py
index 30fd9bf..a8d0bba 100755
--- a/scripts/imagerecat.py
+++ b/scripts/imagerecat.py
@@ -29,7 +29,7 @@
# (C) Multichill, 2008-2011
# (C) Pywikibot team, 2008-2014
#
-# Distributed under the terms of the MIT license.
+# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index f5c5db3..bcc6ab0 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Script to check language links for general pages.
@@ -15,10 +15,10 @@
&pagegenerators_help;
-days: Like -years, but runs through all date pages. Stops at
- Dec 31. If the argument is given in the form -days:X,
+ Dec 31. If the argument is given in the form -days:X,
it will start at month no. X through Dec 31. If the
argument is simply given as -days, it will run from
- Jan 1 through Dec 31. E.g. for -days:9 it will run
+ Jan 1 through Dec 31. E.g. for -days:9 it will run
from Sep 1 through Dec 31.
-years: run on all year pages in numerical order. Stop at year 2050.
@@ -112,10 +112,10 @@
This will only be used in non-autonomous mode.
-hintsonly The bot does not ask for a page to work on, even if none of
- the above page sources was specified. This will make the
+ the above page sources was specified. This will make the
first existing page of -hint or -hinfile slip in as the start
page, determining properties like namespace, disambiguation
- state, and so on. When no existing page is found in the
+ state, and so on. When no existing page is found in the
hints, the bot does nothing.
Hitting return without input on the "Which page to check:"
prompt has the same effect as using -hintsonly.
@@ -154,7 +154,7 @@
* test: Take interwiki links from Test Wikipedia
Languages, groups and families having the same page title
- can be combined, as -hint:5,scand,sr,pt,commons:New_York
+ can be combined, as -hint:5,scand,sr,pt,commons:New_York
-hintfile: similar to -hint, except that hints are taken from the given
file, enclosed in [[]] each, instead of the command line.
@@ -399,7 +399,7 @@
u'/doc'),
'bn': (u'documentation', u'/doc'),
'ca': (u'ús de la plantilla', u'/ús'),
- 'cs': (u'dokumentace', u'/doc'),
+ 'cs': ('dokumentace', '/doc'),
'da': (u'dokumentation', u'/doc'),
'de': (u'dokumentation', u'/Meta'),
'dsb': ([u'dokumentacija', u'doc'], u'/Dokumentacija'),
@@ -420,17 +420,17 @@
u'/Documentation'),
'hsb': ([u'dokumentacija', u'doc'], u'/Dokumentacija'),
'hu': (u'sablondokumentáció', u'/doc'),
- 'id': (u'template doc', u'/doc'),
+ 'id': ('template doc', '/doc'),
'ilo': (u'documentation', u'/doc'),
'ja': (u'documentation', u'/doc'),
- 'ka': (u'თარგის ინფო', u'/ინფო'),
+ 'ka': ('თარგის ინფო', '/ინფო'),
'ko': (u'documentation', u'/설명문서'),
'ms': (u'documentation', u'/doc'),
'no': (u'dokumentasjon', u'/dok'),
'nn': (u'dokumentasjon', u'/dok'),
- 'pl': (u'dokumentacja', u'/opis'),
+ 'pl': ('dokumentacja', '/opis'),
'pt': ([u'documentação', u'/doc'], u'/doc'),
- 'ro': (u'documentaţie', u'/doc'),
+ 'ro': ('documentaţie', '/doc'),
'ru': (u'doc', u'/doc'),
'simple': ([u'documentation',
u'template documentation',
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index d19fbeb..63dce6e 100644
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -38,7 +38,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
# Allowed namespaces. main, project, template, category
diff --git a/scripts/isbn.py b/scripts/isbn.py
index b96676c..f1e1a4b 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script reports and fixes invalid ISBN numbers.
diff --git a/scripts/listpages.py b/scripts/listpages.py
index 60a39a4..8063e72 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
Print a list of pages, as defined by page generator parameters.
diff --git a/scripts/login.py b/scripts/login.py
index a980ce3..67efa1b 100755
--- a/scripts/login.py
+++ b/scripts/login.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Script to log the bot in to a wiki account.
diff --git a/scripts/lonelypages.py b/scripts/lonelypages.py
index ef2f0e4..54ced1a 100755
--- a/scripts/lonelypages.py
+++ b/scripts/lonelypages.py
@@ -53,7 +53,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
diff --git a/scripts/maintenance/__init__.py b/scripts/maintenance/__init__.py
index fd43e14..1f49645 100644
--- a/scripts/maintenance/__init__.py
+++ b/scripts/maintenance/__init__.py
@@ -1,3 +1,3 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
# THIS DIRECTORY IS TO HOLD BOT SCRIPTS FOR THE NEW FRAMEWORK
"""Maintenance scripts."""
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 299497d..58fb6f8 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
This script runs commands on each entry in the API caches.
@@ -224,7 +224,7 @@
whether cache files are being used.
However file access times are not always usable.
On many modern filesystems, they have been disabled.
- On unix, check the filesystem mount options. You may
+ On unix, check the filesystem mount options. You may
need to remount with 'strictatime'.
@param use_accesstime: Whether access times should be used.
diff --git a/scripts/maintenance/compat2core.py b/scripts/maintenance/compat2core.py
index f14d343..0ba7210 100755
--- a/scripts/maintenance/compat2core.py
+++ b/scripts/maintenance/compat2core.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
A helper script to convert compat 1.0 scripts to the new core 2.0 framework.
@@ -18,7 +18,7 @@
to convert a script and show warnings about deprecated methods:
- python pwb.py compat2core <scriptname>
+ python pwb.py compat2core <scriptname>
to show warnings about deprecated methods:
diff --git a/scripts/maintenance/make_i18n_dict.py b/scripts/maintenance/make_i18n_dict.py
index 6311fe9..ce7a6a4 100755
--- a/scripts/maintenance/make_i18n_dict.py
+++ b/scripts/maintenance/make_i18n_dict.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Generate a i18n file from a given script.
diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py
index c858b38..cca9164 100755
--- a/scripts/maintenance/wikimedia_sites.py
+++ b/scripts/maintenance/wikimedia_sites.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Script that updates the language lists in Wikimedia family files."""
#
# (C) xqt, 2009-2016
diff --git a/scripts/match_images.py b/scripts/match_images.py
index 296f336..1075dda 100755
--- a/scripts/match_images.py
+++ b/scripts/match_images.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Program to match two images based on histograms.
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index fb69c15..1a3aea1 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script fixes links that contain common spelling mistakes.
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 96c8a0d..5a61392 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script can move pages.
@@ -56,7 +56,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index 112897a..7735fff 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script adds a missing references section to pages.
@@ -57,7 +57,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
# References sections are usually placed before further reading / external
@@ -547,7 +547,7 @@
if match:
if textlib.isDisabled(oldText, match.start()):
pywikibot.output(
- 'Existing %s section is commented out, skipping.'
+ 'Existing %s section is commented out, skipping.'
% section)
index = match.end()
else:
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index d954df8..682e3eb 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
Script to delete files that are also present on Wikimedia Commons.
@@ -24,12 +24,11 @@
-replacealways replace links if the files are equal and the file names
differ without asking for confirmation
- -replaceloose Do loose replacements. This will replace all occurrences
+ -replaceloose Do loose replacements. This will replace all occurrences
of the name of the image (and not just explicit image
syntax). This should work to catch all instances of the
file, including where it is used as a template parameter
- or in galleries. However, it can also make more
- mistakes.
+ or in galleries. However, it can also make more mistakes.
-replaceonly Use this if you do not have a local sysop account, but do
wish to replace links from the NowCommons template.
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 390f26f..577dcfb 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
Bot to upload pages from a file.
diff --git a/scripts/panoramiopicker.py b/scripts/panoramiopicker.py
index a971687..6dbc4a5 100644
--- a/scripts/panoramiopicker.py
+++ b/scripts/panoramiopicker.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tool to copy a Panoramio set to Commons."""
#
# (C) Multichill, 2010
diff --git a/scripts/patrol.py b/scripts/patrol.py
index f5bc371..10f1db9 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
The bot is meant to mark the edits based on info obtained by whitelist.
@@ -80,12 +80,11 @@
"""
Constructor.
- @kwarg feed - The changes feed to work on (Newpages
- or Recentchanges)
- @kwarg ask - If True, confirm each patrol action
- @kwarg whitelist - page title for whitelist (optional)
- @kwarg autopatroluserns - Takes user consent to automatically patrol
- @kwarg versionchecktime - Check versionchecktime lapse in sec
+ @kwarg feed: The changes feed to work on (Newpages or Recentchanges)
+ @kwarg ask: If True, confirm each patrol action
+ @kwarg whitelist: page title for whitelist (optional)
+ @kwarg autopatroluserns: Takes user consent to automatically patrol
+ @kwarg versionchecktime: Check versionchecktime lapse in sec
"""
self.availableOptions.update({
'ask': False,
@@ -388,7 +387,7 @@
Constructor.
@param page_title: The page title for this rule
- @type page_title: pywikibot.Page
+ @type page_title: pywikibot.Page
"""
self.page_title = page_title
@@ -409,7 +408,7 @@
"""Constructor.
@param page_title: The page title for this rule
- @type page_title: pywikibot.Page
+ @type page_title: pywikibot.Page
"""
self.site = pywikibot.Site()
self.page_title = page_title
diff --git a/scripts/protect.py b/scripts/protect.py
index 4441241..b9a6962 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -63,7 +63,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
}
diff --git a/scripts/replace.py b/scripts/replace.py
index f0945f2..ff9b06f 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -175,7 +175,7 @@
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
- '¶ms;': pagegenerators.parameterHelp,
+ '¶ms;': pagegenerators.parameterHelp,
'&fixes-help;': fixes.parameter_help,
}
@@ -503,7 +503,7 @@
@param generator: generator that yields Page objects
@type generator: generator
@param replacements: a list of Replacement instances or sequences of
- length 2 with the original text (as a compiled regular expression)
+ length 2 with the original text (as a compiled regular expression)
and replacement text (as a string).
@type replacements: list
@param exceptions: a dictionary which defines when not to change an
diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
index fd27032..85b808c 100755
--- a/scripts/replicate_wiki.py
+++ b/scripts/replicate_wiki.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot replicates pages in a wiki to a second wiki within one family.
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index 0022ef9..9f4e06e 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script can be used for reverting certain edits.
diff --git a/scripts/script_wui.py b/scripts/script_wui.py
index efbcbc7..616e35f 100755
--- a/scripts/script_wui.py
+++ b/scripts/script_wui.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Bot which runs python framework scripts as (sub-)bot.
@@ -90,7 +90,7 @@
# The crontab package is https://github.com/josiahcarlson/parse-crontab
# version 0.20 installs a package called 'tests' which conflicts with our
-# test suite. The patch to fix this has been merged, but is not released.
+# test suite. The patch to fix this has been merged, but is not released.
# TODO: Use https://github.com/jayvdb/parse-crontab until it is fixed.
import crontab
diff --git a/scripts/selflink.py b/scripts/selflink.py
index 28f4bca..116b6a1 100755
--- a/scripts/selflink.py
+++ b/scripts/selflink.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot searches for selflinks and allows removing them.
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 74ad11b..a2510ac 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -6,10 +6,10 @@
Specify the disambiguation page on the command line.
The program will pick up the page, and look for all alternative links,
-and show them with a number adjacent to them. It will then automatically
+and show them with a number adjacent to them. It will then automatically
loop over all pages referring to the disambiguation page,
and show 30 characters of context on each side of the reference to help you
-make the decision between the alternatives. It will ask you to type the
+make the decision between the alternatives. It will ask you to type the
number of the appropriate replacement, and perform the change.
It is possible to choose to replace only the link (just type the number) or
diff --git a/scripts/standardize_interwiki.py b/scripts/standardize_interwiki.py
index 7ca682f..ed12fb2 100644
--- a/scripts/standardize_interwiki.py
+++ b/scripts/standardize_interwiki.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Loop over all pages in the home wiki, standardizing the interwiki links.
diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py
index 4b29eea..b1a54ee 100755
--- a/scripts/states_redirect.py
+++ b/scripts/states_redirect.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Create country sub-division redirect pages.
Check if they are in the form Something, State, and if so, create a redirect
diff --git a/scripts/template.py b/scripts/template.py
index 2b0eab9..c4bbc6c 100755
--- a/scripts/template.py
+++ b/scripts/template.py
@@ -39,12 +39,12 @@
If this parameter is missed, all edits are checked but this is
restricted to the last 100 edits.
--summary: Lets you pick a custom edit summary. Use quotes if edit summary
+-summary: Lets you pick a custom edit summary. Use quotes if edit summary
contains spaces.
-always Don't bother asking to confirm any of the changes, Just Do It.
--addcat: Appends the given category to every page that is edited. This is
+-addcat: Appends the given category to every page that is edited. This is
useful when a category is being broken out from a template
parameter or when templates are being upmerged but more information
must be preserved.
@@ -179,11 +179,11 @@
Constructor.
@param generator: the pages to work on
- @type generator: iterable
+ @type generator: iterable
@param templates: a dictionary which maps old template names to
their replacements. If remove or subst is True, it maps the
names of the templates that should be removed/resolved to None.
- @type templates: dict
+ @type templates: dict
"""
self.availableOptions.update({
'subst': False,
diff --git a/scripts/templatecount.py b/scripts/templatecount.py
index cb8ae24..42422fd 100755
--- a/scripts/templatecount.py
+++ b/scripts/templatecount.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Display the list of pages transcluding a given list of templates.
@@ -16,7 +16,7 @@
-list Gives the list of all of the pages transcluding the templates
(rather than just counting them).
--namespace: Filters the search to a given namespace. If this is specified
+-namespace: Filters the search to a given namespace. If this is specified
multiple times it will search all given namespaces
Examples:
diff --git a/scripts/touch.py b/scripts/touch.py
index cc59ca7..87a9c61 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot goes over multiple pages of a wiki, and edits them without changes.
diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index 4d996d2..b9a690e 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
r"""
This script transfers pages from a source wiki to a target wiki.
diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index 3bb027a..2e65460 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot appends some text to all unused images and notifies uploaders.
diff --git a/scripts/version.py b/scripts/version.py
index b76450c..1b7b119 100755
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Script to determine the Pywikibot version (tag, revision and date)."""
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2008
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 44e3296..f81d8c3 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This bot is used for checking external links found at the wiki.
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 0ad4ac1..ec1810c 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
u"""
Script to welcome new users.
diff --git a/scripts/wikisourcetext.py b/scripts/wikisourcetext.py
index fdad386..2dd0e45 100644
--- a/scripts/wikisourcetext.py
+++ b/scripts/wikisourcetext.py
@@ -68,7 +68,7 @@
Constructor.
@param generator: page generator
- @type generator: generator
+ @type generator: generator
"""
self.availableOptions.update({
'force': False,
diff --git a/setup.py b/setup.py
index 7abce5f..a1323c5 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Installer script for Pywikibot 2.0 framework."""
#
# (C) Pywikibot team, 2009-2015
@@ -132,7 +132,7 @@
# However the Debian package python-ipaddr is also supported:
# https://pypi.python.org/pypi/ipaddr
# Other backports are likely broken.
- # ipaddr 2.1.10+ is distributed with Debian and Fedora. See T105443.
+ # ipaddr 2.1.10+ is distributed with Debian and Fedora. See T105443.
dependencies.append('ipaddr>=2.1.10')
if sys.version_info < (2, 7, 9):
@@ -162,7 +162,7 @@
# Microsoft makes available a compiler for Python 2.7
# http://www.microsoft.com/en-au/download/details.aspx?id=44266
# If you set up your own compiler for Python 3, on 3.3 two demo files
-# packaged with pywin32 may fail. Remove com/win32com/demos/ie*.py
+# packaged with pywin32 may fail. Remove com/win32com/demos/ie*.py
if os.name == 'nt' and os.environ.get('PYSETUP_TEST_NO_UI', '0') != '1':
# FIXME: tests/ui_tests.py suggests pywinauto 0.4.2
# which isnt provided on pypi.
diff --git a/tests/__init__.py b/tests/__init__.py
index 8c7e393..7996ec4 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Package tests."""
#
# (C) Pywikibot team, 2007-2015
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 704a853..9da8d8e 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""API test module."""
#
# (C) Pywikibot team, 2007-2016
@@ -893,7 +893,7 @@
BaseSite on it's own. It's testing against steward.wikimedia.org.
These tests are split into two subclasses as only the first failed login
- behaves as expected. All subsequent logins will raise an APIError, making
+ behaves as expected. All subsequent logins will raise an APIError, making
it impossible to test two scenarios with the same APISite object.
"""
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index 560275d..8a132cd 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for archivebot scripts."""
#
# (C) Pywikibot team, 2016
diff --git a/tests/aspects.py b/tests/aspects.py
index e9a8788..3ac9ca6 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1,9 +1,9 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Test aspects to allow fine grained control over what tests are executed.
Several parts of the test infrastructure are implemented as mixins,
-such as API result caching and excessive test durations. An unused
+such as API result caching and excessive test durations. An unused
mixin to show cache usage is included.
"""
#
@@ -535,7 +535,7 @@
Test cases involving writing to the server.
When editing, the API should not be patched to use
- CachedRequest. This class prevents that.
+ CachedRequest. This class prevents that.
"""
@classmethod
@@ -780,7 +780,7 @@
# Prevent use of pywikibot.Site
bases = cls.add_base(bases, DisableSiteMixin)
- # 'pwb' tests will _usually_ require a site. To ensure the
+ # 'pwb' tests will _usually_ require a site. To ensure the
# test class dependencies are declarative, this requires the
# test writer explicitly sets 'site=False' so code reviewers
# check that the script invoked by pwb will not load a site.
diff --git a/tests/basepage_tests.py b/tests/basepage_tests.py
index 3a1e66b..7a91fbb 100644
--- a/tests/basepage_tests.py
+++ b/tests/basepage_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for BasePage subclasses."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/bot_tests.py b/tests/bot_tests.py
index 42b9726..a0eb9a7 100644
--- a/tests/bot_tests.py
+++ b/tests/bot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Bot tests."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/cache_tests.py b/tests/cache_tests.py
index 877620c..2e8e96b 100644
--- a/tests/cache_tests.py
+++ b/tests/cache_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""API Request cache tests."""
#
# (C) Pywikibot team, 2012-2014
diff --git a/tests/category_bot_tests.py b/tests/category_bot_tests.py
index 4174b40..fd6d6ff 100644
--- a/tests/category_bot_tests.py
+++ b/tests/category_bot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the category bot script."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/category_tests.py b/tests/category_tests.py
index 4fca4a3..f5b9fef 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the Category class."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/tests/checkimages_tests.py b/tests/checkimages_tests.py
index 0ab4af0..cfdd2dc 100644
--- a/tests/checkimages_tests.py
+++ b/tests/checkimages_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Unit tests for checkimages script."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index 081e6c1..fb9b407 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test cosmetic_changes module."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/data/fixes.py b/tests/data/fixes.py
index 6e34568..5220e35 100644
--- a/tests/data/fixes.py
+++ b/tests/data/fixes.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Collection of fixes for tests."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/data/set-fixes.py b/tests/data/set-fixes.py
index 5077e37..0f3bbee 100644
--- a/tests/data/set-fixes.py
+++ b/tests/data/set-fixes.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Fixes implementation which overwrites the variable."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/data_ingestion_tests.py b/tests/data_ingestion_tests.py
index 8c08334..e66c891 100644
--- a/tests/data_ingestion_tests.py
+++ b/tests/data_ingestion_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Unit tests for data_ingestion.py script."""
#
# (C) Pywikibot team, 2012-2015
diff --git a/tests/date_tests.py b/tests/date_tests.py
index 538cc8b..cac6ca5 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the date module."""
#
# (C) Pywikibot team, 2012-2015
diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py
index f1ba9bb..8c950e6 100644
--- a/tests/deletionbot_tests.py
+++ b/tests/deletionbot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for scripts/delete.py."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index 3080c58..56f127d 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for deprecation tools."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/tests/diff_tests.py b/tests/diff_tests.py
index 27593ee..a96921d 100644
--- a/tests/diff_tests.py
+++ b/tests/diff_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test diff module."""
#
# (C) Pywikibot team, 2016
diff --git a/tests/disambredir_tests.py b/tests/disambredir_tests.py
index fc5eb2e..701ad6c 100644
--- a/tests/disambredir_tests.py
+++ b/tests/disambredir_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
DisambigurationRedirectBot test.
diff --git a/tests/djvu_tests.py b/tests/djvu_tests.py
index 7dc3908..ce38022 100644
--- a/tests/djvu_tests.py
+++ b/tests/djvu_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Unit tests for djvutext.py script."""
#
diff --git a/tests/dry_api_tests.py b/tests/dry_api_tests.py
index 37c9c89..f4a4c4a 100644
--- a/tests/dry_api_tests.py
+++ b/tests/dry_api_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""API tests which do not interact with a site."""
#
# (C) Pywikibot team, 2012-2014
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 4d5c747..aeea493 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests against a fake Site object."""
#
# (C) Pywikibot team, 2012-2014
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py
index f4a87bc..f31a3b9 100644
--- a/tests/edit_failure_tests.py
+++ b/tests/edit_failure_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Tests for edit failures.
diff --git a/tests/edit_tests.py b/tests/edit_tests.py
index d7fb930..f59ae01 100644
--- a/tests/edit_tests.py
+++ b/tests/edit_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for editing pages."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/exceptions_tests.py b/tests/exceptions_tests.py
index 5902137..ef300e0 100644
--- a/tests/exceptions_tests.py
+++ b/tests/exceptions_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for exceptions."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/tests/family_tests.py b/tests/family_tests.py
index 1b536f1..41ab51d 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the family module."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/tests/file_tests.py b/tests/file_tests.py
index d75cfd1..91fb22b 100644
--- a/tests/file_tests.py
+++ b/tests/file_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""FilePage tests."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/fixes_tests.py b/tests/fixes_tests.py
index 74a24eb..d6e67e4 100644
--- a/tests/fixes_tests.py
+++ b/tests/fixes_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for fixes module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/flow_edit_tests.py b/tests/flow_edit_tests.py
index 5c36c3f..5287f22 100644
--- a/tests/flow_edit_tests.py
+++ b/tests/flow_edit_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Edit tests for the flow module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/flow_tests.py b/tests/flow_tests.py
index fc24841..f3c4c54 100644
--- a/tests/flow_tests.py
+++ b/tests/flow_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the flow module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 9a237a0..ea1b3cb 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for http module."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/tests/i18n/__init__.py b/tests/i18n/__init__.py
index fdca28a..df5895e 100644
--- a/tests/i18n/__init__.py
+++ b/tests/i18n/__init__.py
@@ -1,2 +1,2 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test i18n data package."""
diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index f1b93fa..355f5fd 100644
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test i18n module."""
#
# (C) Pywikibot team, 2007-2014
diff --git a/tests/interwiki_link_tests.py b/tests/interwiki_link_tests.py
index 8eba0cc..e7e852c 100644
--- a/tests/interwiki_link_tests.py
+++ b/tests/interwiki_link_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test Interwiki Link functionality."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/interwikidata_tests.py b/tests/interwikidata_tests.py
index df30ded..2f75a9b 100644
--- a/tests/interwikidata_tests.py
+++ b/tests/interwikidata_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for scripts/interwikidata.py."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index 668219a..701c50d 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for isbn script."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py
index 91c7a71..3a09e98 100644
--- a/tests/l10n_tests.py
+++ b/tests/l10n_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test valid templates."""
#
# (C) Pywikibot team, 2015
@@ -45,7 +45,7 @@
# known problem
if site.code == 'simple':
raise unittest.SkipTest(
- "'simple' wiki has 'en' language code but "
+ "'simple' wiki has 'en' language code but "
"missing template. Must be solved by the "
"corresponding script.")
# check whether template exists
diff --git a/tests/link_tests.py b/tests/link_tests.py
index f21a700..c5ef4b4 100644
--- a/tests/link_tests.py
+++ b/tests/link_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test Link functionality."""
#
# (C) Pywikibot team, 2014-2015
@@ -614,7 +614,7 @@
cached = True
def test_partially_qualified_NS0_family(self):
- """Test 'en:Main Page' on dewp is namespace 0."""
+ """Test 'en:Main Page' on dewp is namespace 0."""
config.mylang = 'de'
config.family = 'wikipedia'
link = Link('en:Main Page')
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py
index 48646b6..2122637 100644
--- a/tests/logentry_tests.py
+++ b/tests/logentry_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test logentries module."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/login_tests.py b/tests/login_tests.py
index 3c03c47..9c63bc3 100644
--- a/tests/login_tests.py
+++ b/tests/login_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Tests for LoginManager classes.
diff --git a/tests/mediawikiversion_tests.py b/tests/mediawikiversion_tests.py
index e387928..7c19053 100644
--- a/tests/mediawikiversion_tests.py
+++ b/tests/mediawikiversion_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the tools.MediaWikiVersion class."""
#
# (C) Pywikibot team, 2008-2016
diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index ebfaf87..8b8f107 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the Namespace class."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py
index a856ca4..7f3f3df 100644
--- a/tests/oauth_tests.py
+++ b/tests/oauth_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test OAuth functionality."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/page_tests.py b/tests/page_tests.py
index ab0b132..ea2d7da 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the page module."""
#
# (C) Pywikibot team, 2008-2016
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 06380ef..4d93a4d 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test pagegenerators module."""
#
# (C) Pywikibot team, 2009-2016
diff --git a/tests/paraminfo_tests.py b/tests/paraminfo_tests.py
index 306a24d..871b863 100644
--- a/tests/paraminfo_tests.py
+++ b/tests/paraminfo_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test confirming paraminfo contains expected values."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/patrolbot_tests.py b/tests/patrolbot_tests.py
index 5058348..79d621d 100644
--- a/tests/patrolbot_tests.py
+++ b/tests/patrolbot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the patrol script."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/plural_tests.py b/tests/plural_tests.py
index b5ce6b3..f1206d6 100644
--- a/tests/plural_tests.py
+++ b/tests/plural_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test plural module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py
index 18112a5..aa3945a 100644
--- a/tests/proofreadpage_tests.py
+++ b/tests/proofreadpage_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the proofreadpage module."""
#
# (C) Pywikibot team, 2015-2016
diff --git a/tests/protectbot_tests.py b/tests/protectbot_tests.py
index e9219ea..ae31f9b 100644
--- a/tests/protectbot_tests.py
+++ b/tests/protectbot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for scripts/protect.py."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/pwb/__init__.py b/tests/pwb/__init__.py
index 56b2f7a..5ac80b8 100644
--- a/tests/pwb/__init__.py
+++ b/tests/pwb/__init__.py
@@ -1,2 +1,2 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Dummy package initialisation."""
diff --git a/tests/pwb_tests.py b/tests/pwb_tests.py
index 9466a6d..da8447c 100644
--- a/tests/pwb_tests.py
+++ b/tests/pwb_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Test pwb.py.
diff --git a/tests/python_tests.py b/tests/python_tests.py
index bdb9084..f57f514 100755
--- a/tests/python_tests.py
+++ b/tests/python_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests Python features."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/reflinks_tests.py b/tests/reflinks_tests.py
index 56611f3..690f4b9 100644
--- a/tests/reflinks_tests.py
+++ b/tests/reflinks_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for reflinks script."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py
index 60ac7ef..ca2ae36 100644
--- a/tests/replacebot_tests.py
+++ b/tests/replacebot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the replace script and ReplaceRobot class."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/script_tests.py b/tests/script_tests.py
index f9cb422..2005706 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test that each script can be compiled and executed."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index 2a0a94a..385a95d 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test for site detection."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 2ddd451..6134f26 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the site module."""
#
# (C) Pywikibot team, 2008-2016
@@ -2802,7 +2802,7 @@
def _test_preload_langlinks_long(self):
"""Test preloading continuation works."""
- # FIXME: test fails. It is disabled as it takes more
+ # FIXME: test fails. It is disabled as it takes more
# than 10 minutes on travis for English Wikipedia
mysite = self.get_site()
mainpage = self.get_mainpage()
diff --git a/tests/sparql_tests.py b/tests/sparql_tests.py
index a19d582..02c76d6 100644
--- a/tests/sparql_tests.py
+++ b/tests/sparql_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test cases for the SPARQL API."""
#
# (C) Pywikibot team, 2016
diff --git a/tests/template_bot_tests.py b/tests/template_bot_tests.py
index 88ba4da..af16d80 100644
--- a/tests/template_bot_tests.py
+++ b/tests/template_bot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test template bot module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/tests_tests.py b/tests/tests_tests.py
index d4fcb12..910b306 100755
--- a/tests/tests_tests.py
+++ b/tests/tests_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the tests package."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 103d848..b020095 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2016
diff --git a/tests/thread_tests.py b/tests/thread_tests.py
index 9019385..f0e2cc0 100644
--- a/tests/thread_tests.py
+++ b/tests/thread_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for threading tools."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/timestamp_tests.py b/tests/timestamp_tests.py
index f970a8d..df29c6b 100644
--- a/tests/timestamp_tests.py
+++ b/tests/timestamp_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the Timestamp class."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py
index 90eca23..f3951e9 100644
--- a/tests/timestripper_tests.py
+++ b/tests/timestripper_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for archivebot.py/Timestripper."""
#
# (C) Pywikibot team, 2016
@@ -267,7 +267,7 @@
tzone = tzoneFixedOffset(0, 'UTC')
def test_timestripper_match(self):
- """Test that dates in comments are correctly recognised."""
+ """Test that dates in comments are correctly recognised."""
ts = self.ts
txt_match = '<!-- [[User:Do___ArchiveUntil]] ' + self.date + ' -->'
diff --git a/tests/tk_tests.py b/tests/tk_tests.py
index 57e3a0e..72c6810 100644
--- a/tests/tk_tests.py
+++ b/tests/tk_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the Tk UI."""
#
# (C) Pywikibot team, 2008-2014
diff --git a/tests/tools_chars_tests.py b/tests/tools_chars_tests.py
index 9249d27..be5fa93 100644
--- a/tests/tools_chars_tests.py
+++ b/tests/tools_chars_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test tools.chars package."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/tools_formatter_tests.py b/tests/tools_formatter_tests.py
index 21de181..61f24f1 100644
--- a/tests/tools_formatter_tests.py
+++ b/tests/tools_formatter_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the C{pywikibot.tools.formatter} module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/tools_ip_tests.py b/tests/tools_ip_tests.py
index 56afa23..8134324 100644
--- a/tests/tools_ip_tests.py
+++ b/tests/tools_ip_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test IP module/regex."""
#
# (C) Pywikibot team, 2012-2015
diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index 7ddeaa6..a3623ab 100644
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test tools package alone which don't fit into other tests."""
#
# (C) Pywikibot team, 2016
diff --git a/tests/ui_options_tests.py b/tests/ui_options_tests.py
index 8a7608c..dd08650 100644
--- a/tests/ui_options_tests.py
+++ b/tests/ui_options_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Bot tests for input_choice options."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index bbb9de7..ec78761 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the user interface."""
#
# (C) Pywikibot team, 2008-2016
diff --git a/tests/upload_tests.py b/tests/upload_tests.py
index 53794d0..fb830dd 100644
--- a/tests/upload_tests.py
+++ b/tests/upload_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Site upload test.
diff --git a/tests/uploadbot_tests.py b/tests/uploadbot_tests.py
index 48f72a9..769b65e 100644
--- a/tests/uploadbot_tests.py
+++ b/tests/uploadbot_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
UploadRobot test.
diff --git a/tests/user_tests.py b/tests/user_tests.py
index 1d10ae4..1ca961f 100644
--- a/tests/user_tests.py
+++ b/tests/user_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the User page."""
#
# (C) Pywikibot team, 2016
diff --git a/tests/utils.py b/tests/utils.py
index 73da80d..7ff1594 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test utilities."""
#
# (C) Pywikibot team, 2013-2016
@@ -90,7 +90,7 @@
Unit test decorator to allow failure.
Test runners each have different interpretations of what should be
- the result of an @expectedFailure test if it succeeds. Some consider
+ the result of an @expectedFailure test if it succeeds. Some consider
it to be a pass; others a failure.
This decorator runs the test and, if it is a failure, reports the result
diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py
index 43e3b79..0d1d661 100644
--- a/tests/weblib_tests.py
+++ b/tests/weblib_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Weblib test module."""
#
# (C) Pywikibot team, 2014-2015
diff --git a/tests/weblinkchecker_tests.py b/tests/weblinkchecker_tests.py
index 14f1590..56be6d7 100644
--- a/tests/weblinkchecker_tests.py
+++ b/tests/weblinkchecker_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""weblinkchecker test module."""
#
# (C) Pywikibot team, 2015
diff --git a/tests/wikibase_edit_tests.py b/tests/wikibase_edit_tests.py
index 59bcd29..c787840 100644
--- a/tests/wikibase_edit_tests.py
+++ b/tests/wikibase_edit_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
Tests for editing Wikibase items.
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index f428475..5e0e8a2 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for the Wikidata parts of the page module."""
#
# (C) Pywikibot team, 2008-2014
@@ -565,11 +565,11 @@
self.assertRaises(pywikibot.NoPage, getattr(item, method))
# The invocation above of a fetching method shouldnt change
- # the local item, but it does! The title changes to '-1'.
+ # the local item, but it does! The title changes to '-1'.
#
# However when identifying the item for 'en:Test page'
# (a deleted page), the exception handling is smarter, and no
- # local data is modified in this scenario. This case is
+ # local data is modified in this scenario. This case is
# separately tested in test_fromPage_missing_lazy.
if link.title != 'Test page':
self.assertEqual(item._link._title, '-1')
diff --git a/tests/wikidataquery_tests.py b/tests/wikidataquery_tests.py
index f45dcb4..075612a 100644
--- a/tests/wikidataquery_tests.py
+++ b/tests/wikidataquery_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test cases for the WikidataQuery query syntax and API."""
#
# (C) Pywikibot team, 2014
diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py
index 4e2af7c..ad2ba74 100644
--- a/tests/wikistats_tests.py
+++ b/tests/wikistats_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Test cases for the WikiStats dataset."""
#
# (C) Pywikibot team, 2014-2016
diff --git a/tests/xmlreader_tests.py b/tests/xmlreader_tests.py
index 29c6af4..ac6cfe9 100644
--- a/tests/xmlreader_tests.py
+++ b/tests/xmlreader_tests.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Tests for xmlreader module."""
#
# (C) Pywikibot team, 2009-2014
diff --git a/user-config.py.sample b/user-config.py.sample
index f65f7f7..b713b5e 100644
--- a/user-config.py.sample
+++ b/user-config.py.sample
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
# This is a sample file. You should use generate_user_files.py
# to create your user-config.py file.
--
To view, visit https://gerrit.wikimedia.org/r/318563
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4e73880640996311e629a87330802e76e2dee594
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Add count to replaceExcept
......................................................................
Add count to replaceExcept
Bug: T125307
Change-Id: I11eb1f341093e52951f701c8cb9b4a144742041c
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 22 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index fc7c4b1..19aafa7 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -300,7 +300,7 @@
def replaceExcept(text, old, new, exceptions, caseInsensitive=False,
- allowoverlap=False, marker='', site=None):
+ allowoverlap=False, marker='', site=None, count=0):
"""
Return text with 'old' replaced by 'new', ignoring specified types of text.
@@ -320,7 +320,9 @@
@type caseInsensitive: bool
@param marker: a string that will be added to the last replacement;
if nothing is changed, it is added at the end
-
+ @param count: how many replacements to do at most. See parameter
+ count of re.sub().
+ @type count: int
"""
# if we got a string, compile it as a regular expression
if isinstance(old, basestring):
@@ -336,8 +338,9 @@
dontTouchRegexes = _get_regexes(exceptions, site)
index = 0
+ replaced = 0
markerpos = len(text)
- while True:
+ while not count or replaced < count:
if index > len(text):
break
match = old.search(text, index)
@@ -412,6 +415,7 @@
# When the regex allows to match nothing, shift by one character
index += 1
markerpos = match.start() + len(replacement)
+ replaced += 1
text = text[:markerpos] + marker + text[markerpos:]
return text
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 103d848..6f6a288 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1179,6 +1179,21 @@
['invoke'], site=self.site),
'{{#invoke:x}}')
+ def test_replace_with_count(self):
+ """Test replacing with count argument."""
+ self.assertEqual(textlib.replaceExcept('x [[x]] x x', 'x', 'y', [],
+ site=self.site),
+ 'y [[y]] y y')
+ self.assertEqual(textlib.replaceExcept('x [[x]] x x', 'x', 'y', [],
+ site=self.site, count=5),
+ 'y [[y]] y y')
+ self.assertEqual(textlib.replaceExcept('x [[x]] x x', 'x', 'y', [],
+ site=self.site, count=2),
+ 'y [[y]] x x')
+ self.assertEqual(textlib.replaceExcept('x [[x]] x x', 'x', 'y', ['link'],
+ site=self.site, count=2),
+ 'y [[x]] y x')
+
def test_replace_tag_category(self):
"""Test replacing not inside category links."""
for ns_name in self.site.namespaces[14]:
--
To view, visit https://gerrit.wikimedia.org/r/321373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I11eb1f341093e52951f701c8cb9b4a144742041c
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPR] derive wikia_family Family class from WikiaFamily
......................................................................
[IMPR] derive wikia_family Family class from WikiaFamily
- This sets scriptpath to WikiaFamily class default.
- Also update version string.
- remove double space in coding string
Change-Id: I2bc901e350cf5f40649d1b585d063f435f6a53e0
---
M pywikibot/families/wikia_family.py
1 file changed, 4 insertions(+), 8 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/wikia_family.py b/pywikibot/families/wikia_family.py
index a97a5b0..07eda63 100644
--- a/pywikibot/families/wikia_family.py
+++ b/pywikibot/families/wikia_family.py
@@ -1,7 +1,7 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""Family module for Wikia."""
#
-# (C) Pywikibot team, 2008-2015
+# (C) Pywikibot team, 2008-2016
#
# Distributed under the terms of the MIT license.
#
@@ -15,7 +15,7 @@
# The Wikia Search family
# user-config.py: usernames['wikia']['wikia'] = 'User name'
-class Family(family.SingleSiteFamily):
+class Family(family.SingleSiteFamily, family.WikiaFamily):
"""Family class for Wikia."""
@@ -25,11 +25,7 @@
@deprecated('APISite.version()')
def version(self, code):
"""Return the version for this family."""
- return "1.19.20"
-
- def scriptpath(self, code):
- """Return the script path for this family."""
- return ''
+ return '1.19.24'
def apipath(self, code):
"""Return the path to api.php for this family."""
--
To view, visit https://gerrit.wikimedia.org/r/307319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2bc901e350cf5f40649d1b585d063f435f6a53e0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: login.py: raise if username does not have read permissions
......................................................................
login.py: raise if username does not have read permissions
If the error is not raised, it may lead to an infinite loop of retries.
Bug: T145954
Change-Id: Ia3e046e69d4dc9f2381d5a9ef8f4804e2ee0ec53
---
M pywikibot/login.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/login.py b/pywikibot/login.py
index dfc5cdf..aa45e90 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -308,6 +308,10 @@
elif e.code == 'Illegal':
raise NoUsername(u"Username '%s' is invalid on %s"
% (self.login_name, self.site))
+ elif e.code == 'readapidenied':
+ raise NoUsername(
+ 'Username "{0}" does not have read permissions on '
+ '{1}'.format(self.login_name, self.site))
# TODO: investigate other unhandled API codes (bug T75539)
if retry:
self.password = None
--
To view, visit https://gerrit.wikimedia.org/r/321355
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia3e046e69d4dc9f2381d5a9ef8f4804e2ee0ec53
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>