Skip to content

Commit

Permalink
[doc] remove duplicate spaces inside doc strings
Browse files Browse the repository at this point in the history
Change-Id: I4e73880640996311e629a87330802e76e2dee594
  • Loading branch information
xqt committed Nov 14, 2016
1 parent 89e9ad0 commit f158b7b
Show file tree
Hide file tree
Showing 233 changed files with 429 additions and 433 deletions.
8 changes: 4 additions & 4 deletions generate_user_files.py
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -159,7 +159,7 @@ def get_site_and_lang(default_family='wikipedia', default_lang='en',
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
Expand Down Expand Up @@ -206,7 +206,7 @@ def get_site_and_lang(default_family='wikipedia', default_lang='en',
{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"
Expand Down
2 changes: 1 addition & 1 deletion pwb.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pywikibot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2016
Expand Down Expand Up @@ -136,7 +136,7 @@ class Timestamp(datetime.datetime):
"""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.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/_wbtypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Wikibase data type classes."""
#
# (C) Pywikibot team, 2013-2015
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/backports.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
This module contains backports to support older Python versions.
Expand Down
8 changes: 4 additions & 4 deletions pywikibot/bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
User-interface related functions for building bots.
Expand Down Expand Up @@ -179,7 +179,7 @@ def __init__(self, fmt=None, datefmt=None):
# 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.
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def current_page(self, page):
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
Expand Down Expand Up @@ -1513,7 +1513,7 @@ def run(self):
# 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:
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/botirc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
User-interface related functions for building bots.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/comms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Communication layer."""
#
# (C) Pywikibot team, 2007-2008
Expand Down
4 changes: 2 additions & 2 deletions pywikibot/comms/http.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Basic HTTP access interface.
Expand Down Expand Up @@ -400,7 +400,7 @@ def _enqueue(uri, method="GET", body=None, headers=None, **kwargs):
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.
Expand Down
6 changes: 3 additions & 3 deletions pywikibot/comms/rcstream.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
SocketIO-based rcstream client.
Expand Down Expand Up @@ -49,8 +49,8 @@ class RcListenerThread(threading.Thread):
@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
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/comms/threadedhttp.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/compat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Package to provide compatibility with compat scripts."""
2 changes: 1 addition & 1 deletion pywikibot/compat/catlib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/compat/query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/compat/userlib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
Expand Down
14 changes: 7 additions & 7 deletions pywikibot/config2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -87,7 +87,7 @@ class _ConfigurationDeprecationWarning(UserWarning):

# 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.

Expand Down Expand Up @@ -199,7 +199,7 @@ class _ConfigurationDeprecationWarning(UserWarning):
#
# 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
Expand Down Expand Up @@ -591,7 +591,7 @@ def register_families_folder(folder_path):
# 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
Expand All @@ -604,7 +604,7 @@ def register_families_folder(folder_path):
# 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
Expand Down
4 changes: 2 additions & 2 deletions pywikibot/cosmetic_changes.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -151,7 +151,7 @@ def _format_isbn_match(match, strict=True):
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)
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/daemonize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
# (C) Pywikibot team, 2007-2015
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 12 additions & 12 deletions pywikibot/data/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Interface to Mediawiki's api.php."""
#
# (C) Pywikibot team, 2007-2016
Expand Down Expand Up @@ -882,7 +882,7 @@ def parameter(self, module, param_name):
# 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:
Expand Down Expand Up @@ -1062,7 +1062,7 @@ class OptionSet(MutableMapping):
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.
"""
Expand Down Expand Up @@ -1279,7 +1279,7 @@ class Request(MutableMapping):
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
Expand All @@ -1296,7 +1296,7 @@ class Request(MutableMapping):
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:
Expand Down Expand Up @@ -1661,7 +1661,7 @@ def mime(self, value):
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()
Expand Down Expand Up @@ -1987,7 +1987,7 @@ def submit(self):
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)
Expand Down Expand Up @@ -2082,7 +2082,7 @@ def submit(self):
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']}}
Expand Down Expand Up @@ -2482,7 +2482,7 @@ class QueryGenerator(_RequestWrapper):
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.
Expand Down Expand Up @@ -2646,7 +2646,7 @@ def set_namespace(self, namespaces):
@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
Expand Down Expand Up @@ -2956,13 +2956,13 @@ class ListGenerator(QueryGenerator):

"""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.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/mysql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Miscellaneous helper functions for mysql queries."""
#
# (C) Pywikibot team, 2016
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/sparql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""SPARQL Query interface."""
#
# Distributed under the terms of the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/wikidataquery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Objects representing WikidataQuery query syntax and API."""
#
# (C) Pywikibot team, 2013
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/wikistats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Objects representing WikiStats API."""
#
# (C) Pywikibot team, 2014-2016
Expand Down
Loading

0 comments on commit f158b7b

Please sign in to comment.