jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/498722 )
Change subject: [IMPR] Replace PY2 unicode with string in docs and unify across files ......................................................................
[IMPR] Replace PY2 unicode with string in docs and unify across files
Change-Id: Ia66664a2a78425ed6131f8ebe470567257ab1a12 --- M generate_user_files.py M pywikibot/__init__.py M pywikibot/bot.py M pywikibot/comms/http.py M pywikibot/config2.py M pywikibot/data/api.py M pywikibot/data/sparql.py M pywikibot/echo.py M pywikibot/editor.py M pywikibot/family.py M pywikibot/flow.py M pywikibot/i18n.py M pywikibot/page.py M pywikibot/pagegenerators.py M pywikibot/proofreadpage.py M pywikibot/site.py M pywikibot/specialbots.py M pywikibot/textlib.py M pywikibot/tools/__init__.py M pywikibot/tools/djvu.py M pywikibot/tools/formatter.py M pywikibot/tools/ip.py M pywikibot/userinterfaces/gui.py M pywikibot/userinterfaces/terminal_interface_base.py M pywikibot/version.py M scripts/add_text.py M scripts/archive/featured.py M scripts/archivebot.py M scripts/basic.py M scripts/blockpageschecker.py M scripts/capitalize_redirects.py M scripts/catall.py M scripts/category.py M scripts/category_redirect.py M scripts/cfd.py M scripts/checkimages.py M scripts/claimit.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/create_categories.py M scripts/data_ingestion.py M scripts/delete.py M scripts/disambredir.py M scripts/djvutext.py M scripts/editarticle.py M scripts/fixing_redirects.py M scripts/flickrripper.py M scripts/followlive.py M scripts/freebasemappingupload.py M scripts/harvest_template.py M scripts/illustrate_wikidata.py M scripts/image.py M scripts/imagerecat.py M scripts/imagetransfer.py M scripts/imageuncat.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/download_dump.py M scripts/makecat.py M scripts/misspelling.py M scripts/movepages.py M scripts/ndashredir.py M scripts/newitem.py M scripts/noreferences.py M scripts/nowcommons.py M scripts/pagefromfile.py M scripts/piper.py M scripts/protect.py M scripts/redirect.py M scripts/reflinks.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/spamremove.py M scripts/states_redirect.py M scripts/surnames_redirects.py M scripts/table2wiki.py M scripts/template.py M scripts/templatecount.py M scripts/touch.py M scripts/transferbot.py M scripts/unlink.py M scripts/unusedfiles.py M scripts/upload.py M scripts/watchlist.py M scripts/weblinkchecker.py M scripts/welcome.py M scripts/wikisourcetext.py M tests/aspects.py 99 files changed, 267 insertions(+), 265 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/generate_user_files.py b/generate_user_files.py index 1a40c99..87562fb 100755 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -428,7 +428,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # set the config family and mylang values to an invalid state so that # the script can detect that the command line arguments -family & -lang diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index e674046..6918e6f 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -182,7 +182,7 @@ """Convert an ISO 8601 timestamp to a Timestamp object.
@param ts: ISO 8601 timestamp or a Timestamp object already - @type ts: str ot Timestamp + @type ts: str or Timestamp @param sep: one-character separator, placed between the date and time @type sep: str @return: Timestamp object @@ -772,7 +772,7 @@ Create a new WbQuantity object.
@param amount: number representing this quantity - @type amount: string or Decimal. Other types are accepted, and + @type amount: str or Decimal. Other types are accepted, and converted via str to Decimal. @param unit: the Wikibase item for the unit or the entity URI of this Wikibase item. @@ -1164,7 +1164,7 @@
Site helper method. @param url: The site URL to get code and family - @type url: string + @type url: str @raises SiteDefinitionError: Unknown URL """ if url not in _url_cache: @@ -1197,19 +1197,19 @@ using the method parameters.
@param code: language code (override config.mylang) - @type code: string + @type code: str @param fam: family name or object (override config.family) - @type fam: string or Family + @type fam: str or Family @param user: bot user name to use on this site (override config.usernames) - @type user: unicode + @type user: str @param sysop: sysop user to use on this site (override config.sysopnames) - @type sysop: unicode + @type sysop: str @param interface: site class or name of class in pywikibot.site (override config.site_interface) @type interface: subclass of L{pywikibot.site.BaseSite} or string @param url: Instead of code and fam, does try to get a Site based on the URL. Still requires that the family supporting that URL exists. - @type url: string + @type url: str @rtype: pywikibot.site.APISite @raises ValueError: URL and pair of code and family given @raises ValueError: Invalid interface name diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 0a93d5e..714b842 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -451,7 +451,7 @@
@param question: a string that will be shown to the user. Don't add a space after the question mark/colon, this method will do this for you. - @type question: unicode + @type question: str @param password: if True, hides the user's input (for password entry). @type password: bool @param default: The default answer if none was entered. None to require @@ -459,7 +459,7 @@ @type default: basestring @param force: Automatically use the default @type force: bool - @rtype: unicode + @rtype: str """ # make sure logging system has been initialized if not _handlers_initialized: @@ -875,7 +875,7 @@ This is required because the -help option loads the module's docstring and because the module name will be used for the filename of the log.
- @rtype: unicode + @rtype: str """ # get commandline arguments called = pywikibot.argvu[0].strip() diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 569e0b6..fc1a990 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -191,7 +191,7 @@ str.format. Is using config.user_agent_format when it is None. @type format_string: basestring @return: The formatted user agent - @rtype: unicode + @rtype: str """ values = USER_AGENT_PRODUCTS.copy()
diff --git a/pywikibot/config2.py b/pywikibot/config2.py index 2c0b5c6..78afa27 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -313,7 +313,7 @@ directory. Used to test whether placing a user config file in this directory will cause it to be selected as the base directory. @type test_directory: str or None - @rtype: unicode + @rtype: str """ def exists(directory): directory = os.path.abspath(directory) diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 9f2843a..8f02ad1 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -877,10 +877,10 @@ @type site: APISite @param module: The module name which is used by paraminfo. (Ignored when site is None) - @type module: string + @type module: str @param param: The parameter name inside the module. That parameter must have a 'type' entry. (Ignored when site is None) - @type param: string + @type param: str @param dict: The initializing dict which is used for L{from_dict}. @type dict: dict """ @@ -901,10 +901,10 @@ @param site: The associated site @type site: APISite @param module: The module name which is used by paraminfo. - @type module: string + @type module: str @param param: The parameter name inside the module. That parameter must have a 'type' entry. - @type param: string + @type param: str @param clear_invalid: Instead of throwing a KeyError, invalid names are silently removed from the options (disabled by default). @type clear_invalid: bool @@ -1389,7 +1389,7 @@
@param value: param value(s)
- @type value: unicode or str in site encoding + @type value: str in site encoding (string types may be a `|`-separated list) iterable, where items are converted to unicode with special handling for datetime.datetime to convert it to a @@ -2159,7 +2159,7 @@ scripts/maintenance/cache.py to support the new key and all previous keys.
- @rtype: unicode + @rtype: str """ login_status = self.site._loginstatus
diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py index 813987c..11df7c8 100644 --- a/pywikibot/data/sparql.py +++ b/pywikibot/data/sparql.py @@ -39,9 +39,9 @@ Create endpoint.
@param endpoint: SPARQL endpoint URL - @type endpoint: string + @type endpoint: str @param entity_url: URL prefix for any entities returned in a query. - @type entity_url: string + @type entity_url: str @param repo: The Wikibase site which we want to run queries on. If provided this overrides any value in endpoint and entity_url. Defaults to Wikidata. @@ -105,7 +105,7 @@ https://www.w3.org/TR/2013/REC-sparql11-results-json-20130321/
@param query: Query text - @type query: string + @type query: str @param full_data: Whether return full data objects or only values @type full_data: bool @return: List of query results or None if query failed @@ -138,7 +138,7 @@ Run SPARQL query and return parsed JSON result.
@param query: Query text - @type query: string + @type query: str """ url = '{0}?query={1}'.format(self.endpoint, quote(query)) while True: @@ -169,7 +169,7 @@ Run SPARQL ASK query and return boolean result.
@param query: Query text - @type query: string + @type query: str @rtype: bool """ data = self.query(query, headers=headers) diff --git a/pywikibot/echo.py b/pywikibot/echo.py index 0b4604a..9fb0d33 100644 --- a/pywikibot/echo.py +++ b/pywikibot/echo.py @@ -61,7 +61,7 @@ """ DEPRECATED: Return notification id as unicode.
- @rtype: unicode + @rtype: str """ return str(self.event_id)
diff --git a/pywikibot/editor.py b/pywikibot/editor.py index 6bc1b58..51e58d6 100644 --- a/pywikibot/editor.py +++ b/pywikibot/editor.py @@ -83,14 +83,14 @@ Halts the thread's operation until the editor is closed.
@param text: the text to be edited - @type text: unicode + @type text: str @param jumpIndex: position at which to put the caret @type jumpIndex: int @param highlight: each occurrence of this substring will be highlighted - @type highlight: unicode + @type highlight: str @return: the modified text, or None if the user didn't save the text file in his text editor - @rtype: unicode or None + @rtype: str or None """ if config.editor: handle, tempFilename = tempfile.mkstemp() diff --git a/pywikibot/family.py b/pywikibot/family.py index 1b82b8c..5f5c932 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -1103,9 +1103,9 @@ May be overridden to return 'https'. Other protocols are not supported.
@param code: language code - @type code: string + @type code: str @return: protocol that this family uses - @rtype: string + @rtype: str """ return 'http'
@@ -1114,7 +1114,7 @@ Return whether a HTTPS certificate error should be ignored.
@param code: language code - @type code: string + @type code: str @return: flag to allow access if certificate has an error. @rtype: bool """ diff --git a/pywikibot/flow.py b/pywikibot/flow.py index ab32dea..ed2b819 100644 --- a/pywikibot/flow.py +++ b/pywikibot/flow.py @@ -42,7 +42,7 @@ @param source: A Flow-enabled site or a Link or Page on such a site @type source: Site, Link, or Page @param title: normalized title of the page - @type title: unicode + @type title: str
@raises TypeError: incorrect use of parameters @raises ValueError: use of non-Flow-enabled Site @@ -61,7 +61,7 @@ """Return the UUID of the page.
@return: UUID of the page - @rtype: unicode + @rtype: str """ if not hasattr(self, '_uuid'): self._load_uuid() @@ -141,11 +141,11 @@ """Create and return a Topic object for a new topic on this Board.
@param title: The title of the new topic (must be in plaintext) - @type title: unicode + @type title: str @param content: The content of the topic's initial post - @type content: unicode + @type content: str @param format: The content format of the value supplied for content - @type format: unicode (either 'wikitext' or 'html') + @type format: str (either 'wikitext' or 'html') @return: The new topic @rtype: Topic """ @@ -173,11 +173,11 @@ @param board: The topic's parent board @type board: Board @param title: The title of the new topic (must be in plaintext) - @type title: unicode + @type title: str @param content: The content of the topic's initial post - @type content: unicode + @type content: str @param format: The content format of the value supplied for content - @type format: unicode (either 'wikitext' or 'html') + @type format: str (either 'wikitext' or 'html') @return: The new topic @rtype: Topic """ @@ -191,7 +191,7 @@ @param board: The topic's parent Flow board @type board: Board @param root_uuid: The UUID of the topic and its root post - @type root_uuid: unicode + @type root_uuid: str @param topiclist_data: The data returned by view-topiclist @type topiclist_data: dict @return: A Topic object derived from the supplied data @@ -242,7 +242,7 @@ """A convenience method to reply to this topic's root post.
@param content: The content of the new post - @type content: unicode + @type content: str @param format: The format of the given content @type format: str ('wikitext' or 'html') @return: The new reply to this topic's root post @@ -255,7 +255,7 @@ """Lock this topic.
@param reason: The reason for locking this topic - @type reason: unicode + @type reason: str """ self.site.lock_topic(self, True, reason) self._reload() @@ -264,7 +264,7 @@ """Unlock this topic.
@param reason: The reason for unlocking this topic - @type reason: unicode + @type reason: str """ self.site.lock_topic(self, False, reason) self._reload() @@ -273,7 +273,7 @@ """Delete this topic through the Flow moderation system.
@param reason: The reason for deleting this topic. - @type reason: unicode + @type reason: str """ self.site.delete_topic(self, reason) self._reload() @@ -282,7 +282,7 @@ """Hide this topic.
@param reason: The reason for hiding this topic. - @type reason: unicode + @type reason: str """ self.site.hide_topic(self, reason) self._reload() @@ -291,7 +291,7 @@ """Suppress this topic.
@param reason: The reason for suppressing this topic. - @type reason: unicode + @type reason: str """ self.site.suppress_topic(self, reason) self._reload() @@ -300,7 +300,7 @@ """Restore this topic.
@param reason: The reason for restoring this topic. - @type reason: unicode + @type reason: str """ self.site.restore_topic(self, reason) self._reload() @@ -318,7 +318,7 @@ @param page: Flow topic @type page: Topic @param uuid: UUID of a Flow post - @type uuid: unicode + @type uuid: str
@raises TypeError: incorrect types of parameters """ @@ -342,7 +342,7 @@ @param page: A Flow topic @type page: Topic @param post_uuid: The UUID of the post - @type post_uuid: unicode + @type post_uuid: str @param data: The JSON data returned from the API @type data: dict
@@ -397,7 +397,7 @@ """Return the UUID of the post.
@return: UUID of the post - @rtype: unicode + @rtype: str """ return self._uuid
@@ -444,9 +444,9 @@ @param sysop: Whether to load using sysop rights. Implies force. @type sysop: bool @param format: Content format to return contents in - @type format: unicode + @type format: str @return: The contents of the post in the given content format - @rtype: unicode + @rtype: str @raises NotImplementedError: use of 'sysop' """ if sysop: @@ -486,7 +486,7 @@ """Reply to this post.
@param content: The content of the new post - @type content: unicode + @type content: str @param format: The format of the given content @type format: str ('wikitext' or 'html') @return: The new reply post @@ -512,7 +512,7 @@ """Delete this post through the Flow moderation system.
@param reason: The reason for deleting this post. - @type reason: unicode + @type reason: str """ self.site.delete_post(self, reason) self._load() @@ -521,7 +521,7 @@ """Hide this post.
@param reason: The reason for hiding this post. - @type reason: unicode + @type reason: str """ self.site.hide_post(self, reason) self._load() @@ -530,7 +530,7 @@ """Suppress this post.
@param reason: The reason for suppressing this post. - @type reason: unicode + @type reason: str """ self.site.suppress_post(self, reason) self._load() @@ -539,7 +539,7 @@ """Restore this post.
@param reason: The reason for restoring this post. - @type reason: unicode + @type reason: str """ self.site.restore_post(self, reason) self._load() diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 4000a51..cae0b61 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -408,7 +408,7 @@ This code is used by other translating methods below.
@param lang: The language code - @type lang: string + @type lang: str @return: language codes @rtype: list of str """ @@ -455,7 +455,7 @@ """Check for the plural variants in message and replace them.
@param message: the message to be replaced - @type message: unicode string + @type message: str string @param parameters: plural parameters passed from other methods @type parameters: Mapping of str to int @return: The message with the plural instances replaced @@ -574,7 +574,7 @@ For PLURAL support have a look at the twtranslate method.
@param code: The language code - @type code: string or Site object + @type code: str or Site object @param xdict: dictionary with language codes as keys or extended dictionary with family names as keys containing language dictionaries or a single (unicode) string. May contain PLURAL tags as @@ -854,7 +854,7 @@ @param parameters: The values which will be applied to the translated text @param password: Hides the user's input (for password entry) @param fallback_prompt: The English prompt if i18n is not available. - @rtype: unicode string + @rtype: str string """ if not messages_available(): if not fallback_prompt: diff --git a/pywikibot/page.py b/pywikibot/page.py index a07bf9c..84470f4 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -183,7 +183,7 @@ @type source: Link, Page (or subclass), or Site @param title: normalized title of the page; required if source is a Site, ignored otherwise - @type title: unicode + @type title: str @param ns: namespace number; required if source is a Site, ignored otherwise @type ns: int @@ -319,7 +319,7 @@ -family and -lang option i.e. config.family and config.mylang @param without_brackets: (cannot be used with as_link) if true, remove the last pair of brackets(usually removes disambiguation brackets). - @rtype: unicode + @rtype: str """ title = self._link.canonical_title() label = self._link.title @@ -382,7 +382,7 @@ The section is the part of the title following a '#' character, if any. If no section is present, return None.
- @rtype: unicode + @rtype: str """ return self._link.section
@@ -473,7 +473,7 @@ @param sysop: if the user has a sysop account, use it to retrieve this page
- @rtype: unicode + @rtype: str """ if force: del self.latest_revision_id @@ -525,7 +525,7 @@ Return text of an old revision of this page; same options as get().
@param oldid: The revid of the revision desired. - @rtype: unicode + @rtype: str """ if force or oldid not in self._revisions \ or self._revisions[oldid].text is None: @@ -544,7 +544,7 @@ without title uncoded. @param with_protocol: if true, http or https prefixes will be included before the double slash. - @rtype: unicode + @rtype: str """ if percent_encoded: title = self.title(as_url=True) @@ -619,7 +619,7 @@ Return the current (edited) wikitext, loading it if necessary.
@return: text of the page - @rtype: unicode + @rtype: str """ if not hasattr(self, '_text') or self._text is None: try: @@ -660,7 +660,7 @@ Application: on Wikisource wikis, text can be preloaded even if a page does not exist, if an Index page is present.
- @rtype: unicode + @rtype: str """ self.site.loadpageinfo(self, preload=True) return self._preloadedtext @@ -691,7 +691,7 @@
@param force: force updating from the live site
- @rtype: unicode or None + @rtype: str or None """ return self.properties(force=force).get('defaultsort')
@@ -721,7 +721,7 @@ """ Return name or IP address of last user to edit page.
- @rtype: unicode + @rtype: str """ return self.latest_revision.user
@@ -744,7 +744,7 @@ i.e. which is not returned by Site.botusers(), it will be returned as a non-bot edit.
- @rtype: unicode + @rtype: str """ if hasattr(self, '_lastNonBotUser'): return self._lastNonBotUser @@ -1232,7 +1232,7 @@
@param summary: The edit summary for the modification (optional, but most wikis strongly encourage its use) - @type summary: unicode + @type summary: str @param watch: Specify how the watchlist is affected by this edit, set to one of "watch", "unwatch", "preferences", "nochange": * watch: add the page to the watchlist @@ -1244,7 +1244,7 @@ For backward compatibility watch parameter may also be boolean: if True, add or if False, remove this Page to/from bot user's watchlist. - @type watch: string, bool (deprecated) or None + @type watch: str, bool (deprecated) or None @param minor: if True, mark this edit as minor @type minor: bool @param botflag: if True, mark this edit as made by a bot (default: @@ -1353,7 +1353,7 @@ docs for all parameters not listed here.
@param newtext: The complete text of the revised page. - @type newtext: unicode + @type newtext: str """ self.text = newtext self.save(summary=summary, watch=watch, minor=minor, botflag=botflag, @@ -2511,7 +2511,7 @@ @param url_height: see iiurlheigth in [1] @param url_param: see iiurlparam in [1] @return: latest file url or thumburl - @rtype: unicode + @rtype: str """ # Plain url is requested. if url_width is None and url_height is None and url_param is None: @@ -2976,11 +2976,11 @@ 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 + @type cat: str or Category @param message: message to use for category creation message If two %s are provided in message, will be replaced by (self.title, authorsList) - @type message: unicode + @type message: str @return: True if copying was successful, False if target page already existed. @rtype: bool @@ -3203,7 +3203,7 @@
DEPRECATED: use username instead.
- @rtype: unicode + @rtype: str """ return self.username
@@ -3215,7 +3215,7 @@ Convenience method that returns the title of the page with namespace prefix omitted, which is the username.
- @rtype: unicode + @rtype: str """ if self._isAutoblock: return '#' + self.title(with_ns=False) @@ -3376,7 +3376,7 @@
@param subpage: subpage part to be appended to the main page title (optional) - @type subpage: unicode + @type subpage: str @return: Page object of user page or user subpage @rtype: Page """ @@ -3395,7 +3395,7 @@
@param subpage: subpage part to be appended to the main talk page title (optional) - @type subpage: unicode + @type subpage: str @return: Page object of user talk page or user talk subpage @rtype: Page """ @@ -3414,9 +3414,9 @@ Send an email to this user via MediaWiki's email interface.
@param subject: the subject header of the mail - @type subject: unicode + @type subject: str @param text: mail body - @type text: unicode + @type text: str @param ccme: if True, sends a copy of this email to the bot @type ccme: bool @raises NotEmailableError: the user of this User is not emailable @@ -3455,9 +3455,9 @@ Outputs 'Email sent' if the email was sent.
@param subject: the subject header of the mail - @type subject: unicode + @type subject: str @param text: mail body - @type text: unicode + @type text: str @param ccme: if True, sends a copy of this email to the bot @type ccme: bool @raises NotEmailableError: the user of this User is not emailable @@ -3672,7 +3672,7 @@ @param site: Wikibase data site @type site: DataSite @param title: normalized title of the page - @type title: unicode + @type title: str @kwarg ns: namespace @type ns: Namespace instance, or int @kwarg entity_type: Wikibase entity type @@ -4532,7 +4532,7 @@ @type site: pywikibot.Site or database name @param force: override caching
- @rtype: unicode + @rtype: str """ if force or not hasattr(self, '_content'): self.get(force=force) @@ -5076,7 +5076,7 @@ Return the type of snak.
@return: str ('value', 'somevalue' or 'novalue') - @rtype: unicode + @rtype: str """ return self.snaktype
@@ -5339,25 +5339,25 @@ @param revid: Revision id number @type revid: int @param text: Revision wikitext. - @type text: unicode, or None if text not yet retrieved + @type text: str, or None if text not yet retrieved @param timestamp: Revision time stamp @type timestamp: pywikibot.Timestamp @param user: user who edited this revision - @type user: unicode + @type user: str @param anon: user is unregistered @type anon: bool @param comment: edit comment text - @type comment: unicode + @type comment: str @param minor: edit flagged as minor @type minor: bool @param rollbacktoken: rollback token - @type rollbacktoken: unicode + @type rollbacktoken: str @param parentid: id of parent Revision (v1.16+) @type parentid: long @param contentmodel: content model label (v1.21+) - @type contentmodel: unicode + @type contentmodel: str @param sha1: sha1 of revision text (v1.19+) - @type sha1: unicode + @type sha1: str """ self.revid = revid self.text = text @@ -5512,7 +5512,7 @@
@param text: the link text (everything appearing between [[ and ]] on a wiki page) - @type text: unicode + @type text: str @param source: the Site on which the link was found (not necessarily the site to which the link refers) @type source: Site or BasePage @@ -5771,7 +5771,7 @@ """ Return the title of the link.
- @rtype: unicode + @rtype: str """ if not hasattr(self, '_title'): self.parse() @@ -5782,7 +5782,7 @@ """ Return the section of the link.
- @rtype: unicode + @rtype: str """ if not hasattr(self, '_section'): self.parse() @@ -5793,7 +5793,7 @@ """ Return the anchor of the link.
- @rtype: unicode + @rtype: str """ if not hasattr(self, '_anchor'): self.parse() @@ -5887,7 +5887,7 @@ """ Return a unicode string representation.
- @rtype: unicode + @rtype: str """ return self.astext()
@@ -5929,7 +5929,7 @@ @param lang: target site code (language) @type lang: str @param title: target Page - @type title: unicode + @type title: str @param source: Link from site source @param source: Site
@@ -6039,7 +6039,7 @@ @param ignore: HTML entities to ignore @param ignore: list of int
- @rtype: unicode + @rtype: str """ if ignore is None: ignore = [] @@ -6101,7 +6101,7 @@ into HTML &#; entities. If it does work, return it unchanged.
@param x: String to update - @type x: unicode + @type x: str @param encoding: Encoding to use @type encoding: str
@@ -6125,7 +6125,7 @@ @type title: str @param encodings: Encodings to attempt to use during conversion. @type encodings: str, list or Site - @rtype: unicode + @rtype: str
@raise UnicodeError: Could not convert using any encoding. """ diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index b2e9ab3..3a13383 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -1607,7 +1607,7 @@
@param filename: the name of the file that should be read. If no name is given, the generator prompts the user. - @type filename: unicode + @type filename: str @param site: Site for generator results. @type site: L{pywikibot.site.BaseSite}
@@ -1933,7 +1933,7 @@ 'all' - yields page if title is matched by all regexes 'any' - yields page if title is matched by any regexes 'none' - yields page if title is NOT matched by any regexes - @type quantifier: string of ('all', 'any', 'none') + @type quantifier: str of ('all', 'any', 'none') @param ignore_namespace: ignore the namespace when matching the title @type ignore_namespace: bool @return: return a page depending on the matching parameters @@ -2951,9 +2951,9 @@ @param site: Site for generator results. @type site: L{pywikibot.site.BaseSite} @param endpoint: SPARQL endpoint URL - @type endpoint: string + @type endpoint: str @param entity_url: URL prefix for any entities returned in a query. - @type entity_url: string + @type entity_url: str @param result_type: type of the iterable in which SPARQL results are stored (default set) @type result_type: iterable diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py index f3719d0..d05f932 100644 --- a/pywikibot/proofreadpage.py +++ b/pywikibot/proofreadpage.py @@ -988,7 +988,7 @@
@param page: Page instance @return: page label - @rtype: unicode string + @rtype: str string """ try: return self._labels_from_page[page] @@ -1003,7 +1003,7 @@
@param page_number: int @return: page label - @rtype: unicode string + @rtype: str string """ try: return self._labels_from_page_number[page_number] diff --git a/pywikibot/site.py b/pywikibot/site.py index 99af4e7..61a151d 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -214,7 +214,7 @@ """Initializer.
@param custom_name: Name defined in server LocalSettings.php - @type custom_name: unicode + @type custom_name: str @param canonical_name: Canonical name @type canonical_name: str @param aliases: Aliases @@ -1000,7 +1000,7 @@ Return the Namespace for a given namespace name.
@param namespace: name - @type namespace: unicode + @type namespace: str @return: The matching Namespace object on this Site @rtype: Namespace, or None if invalid """ @@ -1027,7 +1027,7 @@ Return canonical local form of namespace name.
@param value: A namespace name - @type value: unicode + @type value: str
""" index = self.namespaces.lookup_name(value) @@ -1126,11 +1126,11 @@ """DEPRECATED. Return a wikilink to a page.
@param title: Title of the page to link to - @type title: unicode + @type title: str @param othersite: Generate a interwiki link for use on this site. @type othersite: BaseSite or None
- @rtype: unicode + @rtype: str """ return pywikibot.Link(title, self).astext(othersite)
@@ -1361,7 +1361,7 @@ """Decorator to require a certain MediaWiki extension.
@param extension: the MediaWiki extension required - @type extension: unicode + @type extension: str @return: a decorator to make sure the requirement is satisfied when the decorated function is called. """ @@ -2483,7 +2483,7 @@ @param args: text to be expanded @type args: typing.Iterable[unicode]
- @rtype: unicode + @rtype: str """ needed_mw_messages = ('and', 'comma-separator', 'word-separator') if not args: @@ -2521,12 +2521,12 @@ magic parser words like {{CURRENTTIMESTAMP}}.
@param text: text to be expanded - @type text: unicode + @type text: str @param title: page title without section - @type title: unicode + @type title: str @param includecomments: if True do not strip comments @type includecomments: bool - @rtype: unicode + @rtype: str """ if not isinstance(text, basestring): raise ValueError('text must be a string') @@ -3902,7 +3902,8 @@ @param member_type: member type; if member_type includes 'page' and is used in conjunction with sortby="timestamp", the API may limit results to only pages in the first 50 namespaces. - @type member_type: str or iterable of str; values: page, subcat, file + @type member_type: str or iterable of str; + values: page, subcat, file
@raises KeyError: a namespace identifier was not resolved @raises NotImplementedError: startprefix or endprefix parameters are @@ -4823,7 +4824,7 @@ @see: U{https://www.mediawiki.org/wiki/API:Search%7D
@param searchstring: the text to search for - @type searchstring: unicode + @type searchstring: str @param where: Where to search; value must be "text", "title" or "nearmatch" (many wikis do not support title or nearmatch search) @param namespaces: search only in these namespaces (defaults to all) @@ -5183,14 +5184,14 @@ * nochange: don't change the watchlist @param bot: if True, mark edit with bot flag @kwarg text: Overrides Page.text - @type text: unicode + @type text: str @kwarg section: Edit an existing numbered section or a new section ('new') @type section: int or str @kwarg prependtext: Prepend text. Overrides Page.text - @type text: unicode + @type text: str @kwarg appendtext: Append text. Overrides Page.text. - @type text: unicode + @type text: str @kwarg undo: Revision id to undo. Overrides Page.text @type undo: int @return: True if edit succeeded, False if it failed @@ -5501,7 +5502,7 @@
@param page: the Page to be moved (must exist) @param newtitle: the new title for the Page - @type newtitle: unicode + @type newtitle: str @param summary: edit summary (required!) @param movetalk: if True (default), also move the talk page if possible @param noredirect: if True, suppress creation of a redirect from the @@ -7178,9 +7179,9 @@ @param page: A Flow topic @type page: Topic @param post_id: The UUID of the Post - @type post_id: unicode + @type post_id: str @param format: The content format used for the returned content - @type format: unicode (either 'wikitext', 'html', or 'fixed-html') + @type format: str (either 'wikitext', 'html', or 'fixed-html') @return: A dict representing the post data for the given UUID. @rtype: dict """ @@ -7199,11 +7200,11 @@ @param page: A Flow board @type page: Board @param title: The title of the new topic (must be in plaintext) - @type title: unicode + @type title: str @param content: The content of the topic's initial post - @type content: unicode + @type content: str @param format: The content format of the value supplied for content - @type format: unicode (either 'wikitext' or 'html') + @type format: str (either 'wikitext' or 'html') @return: The metadata of the new topic @rtype: dict """ @@ -7223,11 +7224,11 @@ @param page: A Flow topic @type page: Topic @param reply_to_uuid: The UUID of the Post to create a reply to - @type reply_to_uuid: unicode + @type reply_to_uuid: str @param content: The content of the reply - @type content: unicode + @type content: str @param format: The content format used for the supplied content - @type format: unicode (either 'wikitext' or 'html') + @type format: str (either 'wikitext' or 'html') @return: Metadata returned by the API @rtype: dict """ @@ -7250,7 +7251,7 @@ @param lock: Whether to lock or unlock the topic @type lock: bool (True corresponds to locking the topic.) @param reason: The reason to lock or unlock the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7274,7 +7275,7 @@ @param state: The new moderation state @type state: str @param reason: The reason to moderate the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7295,7 +7296,7 @@ @param page: A Flow topic @type page: Topic @param reason: The reason to delete the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7310,7 +7311,7 @@ @param page: A Flow topic @type page: Topic @param reason: The reason to hide the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7325,7 +7326,7 @@ @param page: A Flow topic @type page: Topic @param reason: The reason to suppress the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7340,7 +7341,7 @@ @param page: A Flow topic @type page: Topic @param reason: The reason to restore the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7357,7 +7358,7 @@ @param state: The new moderation state @type state: str @param reason: The reason to moderate the topic - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7380,7 +7381,7 @@ @param post: A Flow post @type post: Post @param reason: The reason to delete the post - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7395,7 +7396,7 @@ @param post: A Flow post @type post: Post @param reason: The reason to hide the post - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7410,7 +7411,7 @@ @param post: A Flow post @type post: Post @param reason: The reason to suppress the post - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ @@ -7425,7 +7426,7 @@ @param post: A Flow post @type post: Post @param reason: The reason to restore the post - @type reason: unicode + @type reason: str @return: Metadata returned by the API @rtype: dict """ diff --git a/pywikibot/specialbots.py b/pywikibot/specialbots.py index 7ac5315..6adfcdb 100644 --- a/pywikibot/specialbots.py +++ b/pywikibot/specialbots.py @@ -51,19 +51,19 @@
@param url: path to url or local file (deprecated), or list of urls or paths to local files. - @type url: string (deprecated) or list + @type url: str (deprecated) or list @param description: Description of file for its page. If multiple files are uploading the same description is used for every file. - @type description: string + @type description: str @param useFilename: Specify title of the file's page. If multiple files are uploading it asks to change the name for second, third, etc. files, otherwise the last file will overwrite the other. - @type useFilename: string + @type useFilename: str @param keepFilename: Set to True to keep original names of urls and files, otherwise it will ask to enter a name for each file. @type keepFilename: bool @param summary: Summary of the upload - @type summary: string + @type summary: str @param verifyDescription: Set to True to proofread the description. @type verifyDescription: bool @param ignoreWarning: Set this to True to upload even if another file @@ -82,7 +82,7 @@ @type chunk_size: integer @param filename_prefix: Specify prefix for the title of every file's page. - @type filename_prefix: string + @type filename_prefix: str @param always: Disables any input, requires that either ignoreWarning or aborts are set to True and that the description is also set. It overwrites verifyDescription to False and keepFilename to True. @@ -390,7 +390,7 @@ Determine if the warning message should be ignored.
@param warn_code: The warning message - @type warn_code: string + @type warn_code: str """ if self.ignoreWarning is True: return True diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 3335d1d..bc982f4 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -164,7 +164,7 @@ @param phrase: The phrase to convert to localized numerical @param lang: language code @return: The localized version - @rtype: unicode + @rtype: str """ digits = NON_LATIN_DIGITS.get(lang) if not digits: @@ -364,7 +364,7 @@ regex matching. If allowoverlap is true, overlapping occurrences are all replaced (watch out when using this, it might lead to infinite loops!).
- @type text: unicode + @type text: str @param old: a compiled or uncompiled regular expression @param new: a unicode string (which can contain regular expression references), or a function which takes @@ -1208,7 +1208,7 @@ @type insite: BaseSite @return: string including wiki links formatted for inclusion in insite - @rtype: unicode + @rtype: str """ if insite is None: insite = pywikibot.Site() @@ -1362,7 +1362,7 @@ @param add_only: If add_only is True, the old category won't be replaced and the category given will be added after it. @return: the modified text - @rtype: unicode + @rtype: str """ if site is None: site = pywikibot.Site() @@ -1616,7 +1616,7 @@ To replicate that behaviour, enable both remove_disabled_parts and strip.
@param text: The wikitext from which templates are extracted - @type text: unicode or string + @type text: str @param remove_disabled_parts: Remove disabled wikitext such as comments and pre. If None (default), this is enabled when mwparserfromhell is not available or is disabled in the config, and disabled if @@ -1660,7 +1660,7 @@ config.mwparserfromhell.
@param text: The wikitext from which templates are extracted - @type text: unicode or string + @type text: str @return: list of template name and params @rtype: list of tuple """ @@ -1699,7 +1699,7 @@ is not used.
@param text: The wikitext from which templates are extracted - @type text: unicode or string + @type text: str @return: list of template name and params @rtype: list of tuple """ @@ -1855,7 +1855,7 @@ argument value contains a '|', such as {{template|a={{b|c}} }}.
@param text: The wikitext from which templates are extracted - @type text: unicode or string + @type text: str @return: list of template name and params @rtype: list of tuple of name and OrderedDict """ @@ -2016,9 +2016,9 @@ text link e.g. for categories and files.
@param pagetext: The wikitext of a page - @type pagetext: unicode or string + @type pagetext: str @param section: a section of a page including wikitext markups - @type section: unicode or string + @type section: str
""" # match preceding colon for text links diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index 159395a..425052f 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -1272,7 +1272,7 @@ @param mode: The mode in which the file should be opened. It may either be 'r', 'rb', 'a', 'ab', 'w' or 'wb'. All modes open the file in binary mode. It defaults to 'rb'. - @type mode: string + @type mode: str @raises ValueError: When 7za is not available or the opening mode is unknown or it tries to write a 7z archive. @raises FileNotFoundError: When the filename doesn't exist and it tries @@ -1590,10 +1590,10 @@ """Decorator to output a deprecation warning.
@kwarg instead: if provided, will be used to specify the replacement - @type instead: string + @type instead: str @kwarg since: a timestamp string of the date when the method was deprecated (form 'YYYYMMDD') or a version string. - @type since: string + @type since: str """ def decorator(obj): """Outer wrapper. diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py index 8f3e48b..b0507d5 100644 --- a/pywikibot/tools/djvu.py +++ b/pywikibot/tools/djvu.py @@ -30,7 +30,7 @@ @type args: typing.Sequence[string]
@param library: library to be logged in logging messages - @type library: string + @type library: str
@param log: log process output; errors are always logged. @type library: bool @@ -77,7 +77,7 @@ Initializer.
@param file: filename (including path) to djvu file - @type file: string/unicode + @type file: str """ self._filename = file filename = os.path.expanduser(file) diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py index f896494..ec90afa 100644 --- a/pywikibot/tools/formatter.py +++ b/pywikibot/tools/formatter.py @@ -115,7 +115,7 @@ is no literal text around it or when the field value is not a `unicode` already.
- @rtype: unicode + @rtype: str """ result = super(_ColorFormatter, self)._vformat(*args, **kwargs) if isinstance(result, tuple): @@ -142,13 +142,13 @@ Return the normal format result but verify no colors are keywords.
@param format_string: The format template string - @type format_string: unicode + @type format_string: str @param args: The positional field values @type args: typing.Sequence @param kwargs: The named field values @type kwargs: dict @return: The formatted string - @rtype: unicode + @rtype: str """ if self.colors.intersection(kwargs): # kwargs use colors raise ValueError('Keyword argument(s) use valid color(s): ' @@ -171,8 +171,8 @@ parameter color.
@param text: The format template string - @type text: unicode + @type text: str @return: The formatted string - @rtype: unicode + @rtype: str """ return _ColorFormatter().format(text, *args, **kwargs) diff --git a/pywikibot/tools/ip.py b/pywikibot/tools/ip.py index dd9b6fb..5a9ea2f 100644 --- a/pywikibot/tools/ip.py +++ b/pywikibot/tools/ip.py @@ -97,7 +97,7 @@ No logging is performed. Use ip_address instead to catch errors.
@param IP: IP address - @type IP: unicode + @type IP: str @rtype: bool """ try: diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py index 5ca4ff3..04c256c 100644 --- a/pywikibot/userinterfaces/gui.py +++ b/pywikibot/userinterfaces/gui.py @@ -364,14 +364,14 @@ Provide user with editor to modify text.
@param text: the text to be edited - @type text: unicode + @type text: str @param jumpIndex: position at which to put the caret @type jumpIndex: int @param highlight: each occurrence of this substring will be highlighted - @type highlight: unicode + @type highlight: str @return: the modified text, or None if the user didn't save the text file in his text editor - @rtype: unicode or None + @rtype: str or None """ self.text = None # put given text into our textarea diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index e94cf75..98e0b5c 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -268,7 +268,7 @@ @type default: basestring @param force: Automatically use the default @type force: bool - @rtype: unicode + @rtype: str """ assert(not password or not default) end_marker = ':' @@ -442,14 +442,14 @@ Uses a Tkinter edit box because we don't have a console editor
@param text: the text to be edited - @type text: unicode + @type text: str @param jumpIndex: position at which to put the caret @type jumpIndex: int @param highlight: each occurrence of this substring will be highlighted - @type highlight: unicode + @type highlight: str @return: the modified text, or None if the user didn't save the text file in his text editor - @rtype: unicode or None + @rtype: str or None """ try: from pywikibot.userinterfaces import gui diff --git a/pywikibot/version.py b/pywikibot/version.py index 426ae08..e8150e9 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -414,7 +414,7 @@ returned. Because it doesn't import it, the version can be retrieved from any file. @param filename: Name of the file to get version - @type filename: string + @type filename: str """ _program_dir = _get_program_dir() __version__ = None diff --git a/scripts/add_text.py b/scripts/add_text.py index f83fa9b..61b0ff2 100755 --- a/scripts/add_text.py +++ b/scripts/add_text.py @@ -239,7 +239,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # If none, the var is set only for check purpose. summary = None diff --git a/scripts/archive/featured.py b/scripts/archive/featured.py index 1a4fa9a..25c8165 100755 --- a/scripts/archive/featured.py +++ b/scripts/archive/featured.py @@ -616,7 +616,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} local_args = pywikibot.handle_args(args) diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 4875cbe..a44398e 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -381,7 +381,7 @@ Check whether thread has to be archived.
@return: archiving reason i18n string or empty string. - @rtype: string + @rtype: str """ algo = archiver.get_attr('algo') re_t = re.search(r'^old((.*))$', algo) @@ -705,7 +705,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ filename = None pagename = None diff --git a/scripts/basic.py b/scripts/basic.py index 5ca622d..73f2c2c 100755 --- a/scripts/basic.py +++ b/scripts/basic.py @@ -127,7 +127,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} # Process global arguments to determine desired site diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py index a6b0999..035fea8 100755 --- a/scripts/blockpageschecker.py +++ b/scripts/blockpageschecker.py @@ -221,7 +221,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Loading the comments global categoryToCheck, project_inserted diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py index 6291cce..b1a42ba 100755 --- a/scripts/capitalize_redirects.py +++ b/scripts/capitalize_redirects.py @@ -91,7 +91,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/catall.py b/scripts/catall.py index 3903edb..b019976 100755 --- a/scripts/catall.py +++ b/scripts/catall.py @@ -88,7 +88,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ docorrections = True start = 'A' diff --git a/scripts/category.py b/scripts/category.py index 3c0985a..949dffc 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -1334,7 +1334,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments. - @type args: unicode + @type args: str """ from_given = False to_given = False diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py index 1235bd3..6a53ba1 100755 --- a/scripts/category_redirect.py +++ b/scripts/category_redirect.py @@ -506,7 +506,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} for arg in pywikibot.handle_args(args): diff --git a/scripts/cfd.py b/scripts/cfd.py index 6ba2ad1..ff5d6e4 100755 --- a/scripts/cfd.py +++ b/scripts/cfd.py @@ -82,7 +82,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ cfd_page = DEFAULT_CFD_PAGE local_args = pywikibot.handle_args(args) diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 496cfed..c7da6e4 100755 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -1591,7 +1591,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Command line configurable parameters repeat = True # Restart after having check all the images? diff --git a/scripts/claimit.py b/scripts/claimit.py index b70205e..3327f83 100755 --- a/scripts/claimit.py +++ b/scripts/claimit.py @@ -105,7 +105,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str @rtype: bool """ exists_arg = '' diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index 52a1d9c..aab9f0b 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -248,7 +248,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ opts = {} local_args = pywikibot.handle_args(args) diff --git a/scripts/commons_link.py b/scripts/commons_link.py index d961deb..da7afd8 100755 --- a/scripts/commons_link.py +++ b/scripts/commons_link.py @@ -122,7 +122,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 9429010..032181c 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -388,7 +388,8 @@ In Pywikibot >=2.0, page.interwiki() now returns Link objects, not Page objects
- @rtype: unicode, name of a valid commons category + @return: name of a valid commons category + @rtype: str """ for ipageLink in page.langlinks(): ipage = pywikibot.page.Page(ipageLink) @@ -515,7 +516,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} checkcurrent = False diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py index d859359..e323891 100755 --- a/scripts/coordinate_import.py +++ b/scripts/coordinate_import.py @@ -117,7 +117,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args) diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index e938806..e8c9c2d 100644 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -84,7 +84,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/create_categories.py b/scripts/create_categories.py index 1755a72..3111b86 100755 --- a/scripts/create_categories.py +++ b/scripts/create_categories.py @@ -83,7 +83,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ parent = None basename = None diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py index ad1a66c..149d8f1 100755 --- a/scripts/data_ingestion.py +++ b/scripts/data_ingestion.py @@ -105,9 +105,9 @@ a MediaWiki page title, and cause an API exception when used.
@param fmt: format string - @type fmt: unicode + @type fmt: str @return: formatted string - @rtype: unicode + @rtype: str """ # FIXME: normalise the title so it is usable as a MediaWiki title. return fmt % self.metadata @@ -246,7 +246,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args) diff --git a/scripts/delete.py b/scripts/delete.py index 44c3324..759036b 100755 --- a/scripts/delete.py +++ b/scripts/delete.py @@ -135,7 +135,7 @@ @param generator: the pages to work on @type generator: iterable @param summary: the reason for the (un)deletion - @type summary: unicode + @type summary: str """ self.availableOptions.update({ 'undelete': False, @@ -225,7 +225,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ page_name = '' summary = None diff --git a/scripts/disambredir.py b/scripts/disambredir.py index cca775a..07148e1 100755 --- a/scripts/disambredir.py +++ b/scripts/disambredir.py @@ -66,7 +66,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ local_args = pywikibot.handle_args(args)
diff --git a/scripts/djvutext.py b/scripts/djvutext.py index 2a9af85..0d0be22 100644 --- a/scripts/djvutext.py +++ b/scripts/djvutext.py @@ -131,7 +131,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ index = None djvu_path = '.' # default djvu file directory diff --git a/scripts/editarticle.py b/scripts/editarticle.py index 4a4e3b0..f23d4e8 100755 --- a/scripts/editarticle.py +++ b/scripts/editarticle.py @@ -117,7 +117,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ app = ArticleEditor(*args) app.run() diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py index 9112449..f84e0c7 100755 --- a/scripts/fixing_redirects.py +++ b/scripts/fixing_redirects.py @@ -173,7 +173,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ featured = False gen = None diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py index 0aa2755..294f7f3 100755 --- a/scripts/flickrripper.py +++ b/scripts/flickrripper.py @@ -405,7 +405,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ local_args = pywikibot.handle_args(args)
diff --git a/scripts/followlive.py b/scripts/followlive.py index 7596783..3105049 100644 --- a/scripts/followlive.py +++ b/scripts/followlive.py @@ -551,7 +551,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Generate the question text pywikibot.handle_args(*args) diff --git a/scripts/freebasemappingupload.py b/scripts/freebasemappingupload.py index 6a13e42..790c795 100755 --- a/scripts/freebasemappingupload.py +++ b/scripts/freebasemappingupload.py @@ -111,7 +111,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ filename = 'fb2w.nt.gz' # Default filename for arg in pywikibot.handle_args(args): diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py index 80718d0..8b1fa45 100755 --- a/scripts/harvest_template.py +++ b/scripts/harvest_template.py @@ -353,7 +353,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ template_title = None
diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py index d866d69..1e97d59 100755 --- a/scripts/illustrate_wikidata.py +++ b/scripts/illustrate_wikidata.py @@ -90,7 +90,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args) diff --git a/scripts/image.py b/scripts/image.py index 662b3fc..6ad29e6 100755 --- a/scripts/image.py +++ b/scripts/image.py @@ -64,10 +64,10 @@ @param generator: the pages to work on @type generator: iterable @param old_image: the title of the old image (without namespace) - @type old_image: unicode + @type old_image: str @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: str or None """ self.availableOptions.update({ 'summary': None, @@ -131,7 +131,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ old_image = None new_image = None diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py index e02da9f..2edf9d6 100755 --- a/scripts/imagerecat.py +++ b/scripts/imagerecat.py @@ -451,7 +451,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ generator = None onlyFilter = False diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py index ae7c4dc..56d1c58 100755 --- a/scripts/imagetransfer.py +++ b/scripts/imagetransfer.py @@ -289,7 +289,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ gen = None
diff --git a/scripts/imageuncat.py b/scripts/imageuncat.py index a7f4f39..31baaa8 100755 --- a/scripts/imageuncat.py +++ b/scripts/imageuncat.py @@ -1318,7 +1318,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ generator = None
diff --git a/scripts/interwiki.py b/scripts/interwiki.py index f5f5f7e..5ab8806 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -2395,7 +2395,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ singlePageTitle = '' opthintsonly = False diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py index 51475d8..bcc1d27 100644 --- a/scripts/interwikidata.py +++ b/scripts/interwikidata.py @@ -216,7 +216,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ local_args = pywikibot.handle_args(args) gen_factory = pagegenerators.GeneratorFactory() diff --git a/scripts/isbn.py b/scripts/isbn.py index 33fa573..8dbb61c 100755 --- a/scripts/isbn.py +++ b/scripts/isbn.py @@ -1641,7 +1641,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/listpages.py b/scripts/listpages.py index c3c60f2..1ec6268 100755 --- a/scripts/listpages.py +++ b/scripts/listpages.py @@ -175,7 +175,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ gen = None notitle = False diff --git a/scripts/login.py b/scripts/login.py index eb277cf..db88707 100755 --- a/scripts/login.py +++ b/scripts/login.py @@ -116,7 +116,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ password = None sysop = False diff --git a/scripts/lonelypages.py b/scripts/lonelypages.py index 7002520..894e806 100755 --- a/scripts/lonelypages.py +++ b/scripts/lonelypages.py @@ -234,7 +234,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/maintenance/download_dump.py b/scripts/maintenance/download_dump.py index 66c96fc..ea0276f 100644 --- a/scripts/maintenance/download_dump.py +++ b/scripts/maintenance/download_dump.py @@ -206,7 +206,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ opts = {} unknown_args = [] diff --git a/scripts/makecat.py b/scripts/makecat.py index fc7db24..86f034a 100755 --- a/scripts/makecat.py +++ b/scripts/makecat.py @@ -225,7 +225,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ global workingcat, parentcats global checked, tocheck diff --git a/scripts/misspelling.py b/scripts/misspelling.py index 4eafcaa..ad54637 100755 --- a/scripts/misspelling.py +++ b/scripts/misspelling.py @@ -166,7 +166,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # the option that's always selected when the bot wonders what to do with # a link. If it's None, the user is prompted (default behaviour). diff --git a/scripts/movepages.py b/scripts/movepages.py index 24b13e2..d5789d6 100755 --- a/scripts/movepages.py +++ b/scripts/movepages.py @@ -183,7 +183,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ oldName = None options = {} diff --git a/scripts/ndashredir.py b/scripts/ndashredir.py index 8dbef31..ed5674c 100644 --- a/scripts/ndashredir.py +++ b/scripts/ndashredir.py @@ -126,7 +126,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} # Process global arguments to determine desired site diff --git a/scripts/newitem.py b/scripts/newitem.py index bb1d350..956d287 100755 --- a/scripts/newitem.py +++ b/scripts/newitem.py @@ -134,7 +134,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args) diff --git a/scripts/noreferences.py b/scripts/noreferences.py index 8287567..5c63a56 100755 --- a/scripts/noreferences.py +++ b/scripts/noreferences.py @@ -731,7 +731,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py index f2ba56f..ca899aa 100755 --- a/scripts/nowcommons.py +++ b/scripts/nowcommons.py @@ -379,7 +379,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py index 8c1f1ec..a28d441 100755 --- a/scripts/pagefromfile.py +++ b/scripts/pagefromfile.py @@ -294,7 +294,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ filename = 'dict.txt' options = {} diff --git a/scripts/piper.py b/scripts/piper.py index 9686dea..1cfcd9e 100755 --- a/scripts/piper.py +++ b/scripts/piper.py @@ -80,7 +80,7 @@ """Pipe a given text through a given program.
@return: processed text after piping - @rtype: unicode + @rtype: str """ if not isinstance(text, str): # py2-py3 compatibility text = text.encode('utf-8') diff --git a/scripts/protect.py b/scripts/protect.py index 60d7789..5274121 100755 --- a/scripts/protect.py +++ b/scripts/protect.py @@ -118,7 +118,7 @@ """Check if the protection level is valid or ask if necessary.
@return: a valid protection level - @rtype: string + @rtype: str """ if level not in levels: first_char = [] @@ -151,7 +151,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} message_properties = {} diff --git a/scripts/redirect.py b/scripts/redirect.py index 8d93480..9d5efa0 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -689,7 +689,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} gen_options = {} diff --git a/scripts/reflinks.py b/scripts/reflinks.py index dfbf37f..97fdba5 100755 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -769,7 +769,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ xml_filename = None xml_start = None diff --git a/scripts/replace.py b/scripts/replace.py index b6a7d63..21167bc 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -617,7 +617,7 @@ """ Apply all replacements to the given text.
- @rtype: unicode, set + @rtype: str, set """ if page is None: pywikibot.warn( @@ -871,7 +871,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ add_cat = None gen = None diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py index f3e4d53..07a7a45 100755 --- a/scripts/replicate_wiki.py +++ b/scripts/replicate_wiki.py @@ -246,7 +246,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ my_args = pywikibot.handle_args(args)
diff --git a/scripts/revertbot.py b/scripts/revertbot.py index 8f524ad..9ae98e4 100755 --- a/scripts/revertbot.py +++ b/scripts/revertbot.py @@ -163,7 +163,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/script_wui.py b/scripts/script_wui.py index f49e2eb..9ab4db0 100755 --- a/scripts/script_wui.py +++ b/scripts/script_wui.py @@ -325,7 +325,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ global __simulate, __sys_argv
diff --git a/scripts/selflink.py b/scripts/selflink.py index 531974c..e1c4e7d 100755 --- a/scripts/selflink.py +++ b/scripts/selflink.py @@ -78,7 +78,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args) diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index 17dec44..a20f64f 100755 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -1224,7 +1224,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # the option that's always selected when the bot wonders what to do with # a link. If it's None, the user is prompted (default behaviour). diff --git a/scripts/spamremove.py b/scripts/spamremove.py index c5ed4d1..1493934 100755 --- a/scripts/spamremove.py +++ b/scripts/spamremove.py @@ -123,7 +123,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ spam_external_url = None protocol = 'http' diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py index 18829e2..f78feab 100755 --- a/scripts/states_redirect.py +++ b/scripts/states_redirect.py @@ -116,7 +116,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ local_args = pywikibot.handle_args(args) start = None diff --git a/scripts/surnames_redirects.py b/scripts/surnames_redirects.py index 97ab8a0..224727d 100755 --- a/scripts/surnames_redirects.py +++ b/scripts/surnames_redirects.py @@ -106,7 +106,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {}
diff --git a/scripts/table2wiki.py b/scripts/table2wiki.py index 6c27294..347537e 100644 --- a/scripts/table2wiki.py +++ b/scripts/table2wiki.py @@ -523,7 +523,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} gen = None diff --git a/scripts/template.py b/scripts/template.py index caf02a2..ef857d0 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -270,7 +270,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ template_names = [] templates = {} diff --git a/scripts/templatecount.py b/scripts/templatecount.py index cff7f82..01159dc 100755 --- a/scripts/templatecount.py +++ b/scripts/templatecount.py @@ -154,7 +154,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ operation = None args_list = [] diff --git a/scripts/touch.py b/scripts/touch.py index 7f5cd42..cb78bb9 100755 --- a/scripts/touch.py +++ b/scripts/touch.py @@ -98,7 +98,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ gen = None options = {} diff --git a/scripts/transferbot.py b/scripts/transferbot.py index 09262dc..ee92924 100755 --- a/scripts/transferbot.py +++ b/scripts/transferbot.py @@ -86,7 +86,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ local_args = pywikibot.handle_args(args)
diff --git a/scripts/unlink.py b/scripts/unlink.py index 4597d08..908fe4f 100755 --- a/scripts/unlink.py +++ b/scripts/unlink.py @@ -62,7 +62,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ # This temporary string is used to read the title # of the page that should be unlinked. diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py index 0d35d55..c486bec 100755 --- a/scripts/unusedfiles.py +++ b/scripts/unusedfiles.py @@ -107,7 +107,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ options = {} total = None diff --git a/scripts/upload.py b/scripts/upload.py index b5396b9..723ac05 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -104,7 +104,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ url = '' description = [] diff --git a/scripts/watchlist.py b/scripts/watchlist.py index 145b016..298de83 100755 --- a/scripts/watchlist.py +++ b/scripts/watchlist.py @@ -91,7 +91,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ all = False new = False diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index f47af6c..a619c84 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -409,7 +409,7 @@ If useHEAD is true, uses the HTTP HEAD method, which saves bandwidth by not downloading the body. Otherwise, the HTTP GET method is used.
- @rtype: unicode or None + @rtype: str or None """ conn = self.getConnection() try: @@ -953,7 +953,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ gen = None xmlFilename = None diff --git a/scripts/welcome.py b/scripts/welcome.py index 0519c16..5ea6570 100755 --- a/scripts/welcome.py +++ b/scripts/welcome.py @@ -922,7 +922,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ for arg in pywikibot.handle_args(args): arg, sep, val = arg.partition(':') diff --git a/scripts/wikisourcetext.py b/scripts/wikisourcetext.py index dfe3b45..d340d31 100644 --- a/scripts/wikisourcetext.py +++ b/scripts/wikisourcetext.py @@ -215,7 +215,7 @@ If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: unicode + @type args: str """ index = None pages = '1-' diff --git a/tests/aspects.py b/tests/aspects.py index c7d7ebf..79af4f8 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -1610,7 +1610,7 @@ @param msg: Either the specific message or None to allow any generic message. When set to C{INSTEAD} it only counts those supplying an alternative and when C{NO_INSTEAD} only those not supplying one. - @type msg: string or None or INSTEAD or NO_INSTEAD + @type msg: str or None or INSTEAD or NO_INSTEAD """ if msg is None or msg is self.INSTEAD or msg is self.NO_INSTEAD: deprecation_messages = self.deprecation_messages
pywikibot-commits@lists.wikimedia.org