jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693580 )
Change subject: [cleanup] Remove category_namespaces
......................................................................
[cleanup] Remove category_namespaces
Xqt reverted this because I deleted several other methods that didn't provide
a FutureWarning. This narrows the change just to the one method that did.
Change-Id: I467b533602bbe2d33b79db57a876fdc2dac5a943
---
M pywikibot/site/_basesite.py
M tests/site_tests.py
2 files changed, 0 insertions(+), 8 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py
index eecc0d9..32c36a1 100644
--- a/pywikibot/site/_basesite.py
+++ b/pywikibot/site/_basesite.py
@@ -435,12 +435,6 @@
"""Return local name for the Category namespace."""
return self.namespace(14)
- @deprecated('list(namespaces.CATEGORY)', since='20150829',
- future_warning=True)
- def category_namespaces(self): # pragma: no cover
- """Return names for the Category namespace."""
- return list(self.namespace(14, all=True))
-
# site-specific formatting preferences
def category_on_one_line(self):
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 69ec6da..f2bd76c 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -69,8 +69,6 @@
self.site.namespace(10))
self.assertEqual(self.site.category_namespace(),
self.site.namespace(14))
- self.assertEqual(self.site.category_namespaces(),
- list(self.site.namespace(14, all=True)))
class TestSiteDryDeprecatedFunctions(DefaultDrySiteTestCase,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693580
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I467b533602bbe2d33b79db57a876fdc2dac5a943
Gerrit-Change-Number: 693580
Gerrit-PatchSet: 4
Gerrit-Owner: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/694318 )
Change subject: Revert "[IMPR] Use different logfiles for multiple processes (Step 2)"
......................................................................
Revert "[IMPR] Use different logfiles for multiple processes (Step 2)"
This reverts commit d0ae0ff3bded6b271557dccf88dd5c96ab7dada3.
Reason for revert: This splits logs for the same script across multiple files
even when multiple copies of that script aren't being run at the same time.
Example:
python t1.py -log # pid: 1; logs to t1-bot.log; OK
# t1.py ends
python t2.py -log # pid: 1; logs to t2-bot.log; OK
python t1.py -log # pid: 2; logs to t1-2-bot.log; should be t1-bot.log
# t1.py and t2.py end
python t1.py -log # pid: 1; logs to t1-bot.log; OK
This makes it difficult to read the log chronologically across multiple runs
when other scripts may run at overlapping times.
Change-Id: Iae8311b0c3ec40acccb400a30f1de4efea1e37fc
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 11 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 219601d..86ab1d7 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -103,7 +103,7 @@
from warnings import warn
import pywikibot
-from pywikibot import config, daemonize, i18n, throttle, version
+from pywikibot import config, daemonize, i18n, version
from pywikibot.backports import Dict, Iterable, List, Sequence
from pywikibot.bot_choice import (
AlwaysChoice,
@@ -346,19 +346,11 @@
# if user has enabled file logging, configure file handler
if module_name in config.log or '*' in config.log:
- # get PID
- pywikibot.Site().throttle # initialize a Throttle object and set PID
- pid = throttle.pid # get the global PID
- pid = str(pid) + '-' if pid > 1 else ''
-
if config.logfilename:
- # keep config.logfilename unchanged
logfile = config.datafilepath('logs', config.logfilename)
else:
- # add PID to logfle name
- logfile = config.datafilepath('logs', '{}-{}bot.log'
- .format(module_name, pid))
-
+ logfile = config.datafilepath('logs', '{}-bot.log'
+ .format(module_name))
file_handler = RotatingFileHandler(filename=logfile,
maxBytes=1024 * config.logfilesize,
backupCount=config.logfilecount,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/694318
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iae8311b0c3ec40acccb400a30f1de4efea1e37fc
Gerrit-Change-Number: 694318
Gerrit-PatchSet: 2
Gerrit-Owner: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Bináris <wikiposta(a)gmail.com>
Gerrit-Reviewer: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693947 )
Change subject: [bugfix] Show OutputOption if before_question attribute is not set
......................................................................
[bugfix] Show OutputOption if before_question attribute is not set
OutputOption has before_question attribute. The output statement
inside option.result has been dropped to enable redirecting the
output stream. Therefore output the option.out after result is
called.
Bug: T283488
Change-Id: I7e64dddaecb1c89f8293f9748c3ad0c26e1c906f
---
M pywikibot/userinterfaces/terminal_interface_base.py
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index c4abe8b..d8ff5d2 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -373,6 +373,12 @@
options. If default is not a shortcut, it'll return -1.
@rtype: int (if not return_shortcut), lowercased str (otherwise)
"""
+ def output_option(option, before_question):
+ """Print an OutputOption before or after question."""
+ if isinstance(option, OutputOption) \
+ and option.before_question is before_question:
+ self.stream_output(option.out + '\n')
+
if force and default is None:
raise ValueError('With no default option it cannot be forced')
if isinstance(options, Option):
@@ -399,9 +405,7 @@
with self.lock:
while not handled:
for option in options:
- if isinstance(option, OutputOption) \
- and option.before_question:
- self.stream_output(option.out + '\n')
+ output_option(option, before_question=True)
output = Option.formatted(question, options, default)
if force:
self.stream_output(output + '\n')
@@ -413,6 +417,7 @@
for index, option in enumerate(options):
if option.handled(answer):
answer = option.result(answer)
+ output_option(option, before_question=False)
handled = option.stop
break
@@ -527,7 +532,7 @@
# Each warning appears twice
# the second time it has a 'message'
if 'message' in record.__dict__:
- return None
+ return
record.__dict__.setdefault('newline', '\n')
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693947
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7e64dddaecb1c89f8293f9748c3ad0c26e1c906f
Gerrit-Change-Number: 693947
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693983 )
Change subject: [cleanup] Minor add_text documentation revisions
......................................................................
[cleanup] Minor add_text documentation revisions
To better acquaint myself with the codebase I'm focusing on one
of our scripts. This is just some benign adjustments from a first
pass...
* Add an example that amends the sandbox page so users have a
simple, innocuous command to practice with.
* Drop the 'put it in one line' warnings. I tried it and multiple
lines works just fine.
* Minor get_text simplification so we don't indent as much.
* The documented behavior of get_text's create argument was
incorrect.
* Add the page's type hint.
* Minor grammatical corrections.
Change-Id: I65a05217b2704ba09c6916c694cf28fdd546ed61
---
M scripts/add_text.py
1 file changed, 55 insertions(+), 57 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py
index f937434..1cfa980 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -1,20 +1,19 @@
#!/usr/bin/python
r"""
-This is a Bot to add a text at the end of the content of the page.
+This is a Bot to add text to the top or bottom of a page.
-By default it adds the text above categories and interwiki.
+By default this adds the text to the bottom above the categories and interwiki.
-Alternatively it may also add a text at the top of the page.
These command line parameters can be used to specify which pages to work on:
¶ms;
Furthermore, the following command line parameters are supported:
--talkpage Put the text onto the talk page instead the generated on
+-talkpage Put the text onto the talk page instead
-talk
--text Define which text to add. "\n" are interpreted as newlines.
+-text Define what text to add. "\n" are interpreted as newlines.
-textfile Define a texfile name which contains the text to add
@@ -25,26 +24,28 @@
-newimages Add text in the new images
--always If used, the bot won't ask if it should add the text
- specified
+-always If used, the bot won't ask if it should add the specified
+ text
-up If used, put the text at the top of the page
--noreorder Avoid to reorder cats and interwiki
+-noreorder Avoid reordering cats and interwiki
Example
-------
-1. This is a script to add a template to the top of the pages with
-category:catname
-Warning! Put it in one line, otherwise it won't work correctly:
+1. Append 'hello world' to the bottom of the sandbox:
+
+ python pwb.py add_text -page:Wikipedia:Sandbox \
+ -summary:"Bot: pywikibot practice" -text:"hello world"
+
+2. Add a template to the top of the pages with 'category:catname':
python pwb.py add_text -cat:catname -summary:"Bot: Adding a template" \
-text:"{{Something}}" -except:"\{\{([Tt]emplate:|)[Ss]omething" -up
-2. Command used on it.wikipedia to put the template in the page without any
-category.
-Warning! Put it in one line, otherwise it won't work correctly:
+3. Command used on it.wikipedia to put the template in the page without any
+ category:
python pwb.py add_text -except:"\{\{([Tt]emplate:|)[Cc]ategorizzare" \
-text:"{{Categorizzare}}" -excepturl:"class='catlinks'>" -uncat \
@@ -81,50 +82,46 @@
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
-def get_text(page, old: str, create: bool) -> str:
+def get_text(page: pywikibot.page.BasePage, old: Optional[str],
+ create: bool) -> str:
"""
Get text on page. If old is not None, return old.
@param page: The page to get text from
- @type page: pywikibot.page.BasePage
- @param old: If not None, this parameter is returned instead
- of fetching text from the page
- @param create: Create the page if it doesn't exist
- @return: The page's text or old parameter if not None
+ @param old: If not None, return this rather than the page's text
+ @param create: Declare that the page will be created if it doesn't exist
+ @return: The page's text or the old parameter if not None
"""
- if old is None:
- try:
- text = page.get()
- except NoPageError:
- if create:
- pywikibot.output(
- "{} doesn't exist, creating it!".format(page.title()))
- text = ''
- else:
- pywikibot.output(
- "{} doesn't exist, skip!".format(page.title()))
- return None
- except IsRedirectPageError:
- pywikibot.output('{} is a redirect, skip!'.format(page.title()))
+ if old is not None:
+ return old
+
+ try:
+ return page.get()
+ except NoPageError:
+ if create:
+ pywikibot.output("{} doesn't exist, creating it!"
+ .format(page.title()))
+ return ''
+ else:
+ pywikibot.output("{} doesn't exist, skip!".format(page.title()))
return None
- else:
- text = old
- return text
+ except IsRedirectPageError:
+ pywikibot.output('{} is a redirect, skip!'.format(page.title()))
+ return None
-def put_text(page, new: str, summary: str, count: int,
+def put_text(page: pywikibot.page.BasePage, new: str, summary: str, count: int,
asynchronous: bool = False) -> Optional[bool]:
"""
Save the new text.
- @param page: The page to update and save
- @type page: pywikibot.page.BasePage
+ @param page: The page to change the text of
@param new: The new text for the page
- @param summary: Summary of page changes.
- @param count: Maximum num attempts to reach the server
- @param asynchronous: Save the page asynchronously
- @return: True if successful, False if unsuccessful, None if
- waiting for server
+ @param summary: Summary of the page change
+ @param count: Maximum number of attempts to reach the server
+ @param asynchronous: If True, saves the page asynchronously
+ @return: True if successful, False if unsuccessful, and None if
+ awaiting the server
"""
page.text = new
try:
@@ -152,7 +149,8 @@
return False
-def add_text(page, addText: str, summary: Optional[str] = None,
+def add_text(page: pywikibot.page.BasePage, addText: str,
+ summary: Optional[str] = None,
regexSkip: Optional[str] = None,
regexSkipUrl: Optional[str] = None,
always: bool = False, up: bool = False,
@@ -163,21 +161,21 @@
Add text to a page.
@param page: The page to add text to
- @type page: pywikibot.page.BasePage
@param addText: Text to add
- @param summary: Summary of changes. If None, beginning of addText is used.
- @param regexSkip: Abort if text on page matches
- @param regexSkipUrl: Abort if full url matches
- @param always: Always add text without user confirmation
- @param up: If True, add text to top of page, else add at bottom.
- @param putText: If True, save changes to the page, else return
+ @param summary: Change summary, if None this uses the beginning of addText
+ @param regexSkip: Abort if the text on the page matches this
+ @param regexSkipUrl: Abort if the url matches this
+ @param always: Edit without user confirmation
+ @param up: Append text to the top of the page if True, otherwise the
+ bottom
+ @param putText: Save changes to the page if True, otherwise return
(text, newtext, always)
@param oldTextGiven: If None fetch page text, else use this text
@param reorderEnabled: If True place text above categories and
interwiki, else place at page bottom. No effect if up = False.
- @param create: Create page if it does not exist
- @return: If putText=True: (success, success, always)
- else: (text, newtext, always)
+ @param create: Create the page if it does not exist
+ @return: (success, success, always) if putText is True, otherwise
+ (text, newtext, always)
"""
site = page.site
if not summary:
@@ -282,7 +280,7 @@
If args is an empty list, sys.argv is used.
- @param args: command line arguments
+ @param args: Command line arguments
"""
# If none, the var is set only for check purpose.
summary = None
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693983
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I65a05217b2704ba09c6916c694cf28fdd546ed61
Gerrit-Change-Number: 693983
Gerrit-PatchSet: 3
Gerrit-Owner: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692624 )
Change subject: [IMPR] Use different logfiles for multiple processes (Step 2)
......................................................................
[IMPR] Use different logfiles for multiple processes (Step 2)
Use different logfiles if multiple processes of the same script are running
to prevent WindowsError/PermissionError when renaming a file. This also
prevents having different mixed logs in the same file.
- if config.logfilename is used this will be kept unchanged
- otherwise the logfilename is changed from <scriptname>-bot.log
to <scriptname>-<pid>-bot.log if PID is not 1
Bug: T56685
Change-Id: I38937c3060d4653d1ffe8a8d9b918a8548907ab0
---
M pywikibot/bot.py
1 file changed, 11 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 86ab1d7..219601d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -103,7 +103,7 @@
from warnings import warn
import pywikibot
-from pywikibot import config, daemonize, i18n, version
+from pywikibot import config, daemonize, i18n, throttle, version
from pywikibot.backports import Dict, Iterable, List, Sequence
from pywikibot.bot_choice import (
AlwaysChoice,
@@ -346,11 +346,19 @@
# if user has enabled file logging, configure file handler
if module_name in config.log or '*' in config.log:
+ # get PID
+ pywikibot.Site().throttle # initialize a Throttle object and set PID
+ pid = throttle.pid # get the global PID
+ pid = str(pid) + '-' if pid > 1 else ''
+
if config.logfilename:
+ # keep config.logfilename unchanged
logfile = config.datafilepath('logs', config.logfilename)
else:
- logfile = config.datafilepath('logs', '{}-bot.log'
- .format(module_name))
+ # add PID to logfle name
+ logfile = config.datafilepath('logs', '{}-{}bot.log'
+ .format(module_name, pid))
+
file_handler = RotatingFileHandler(filename=logfile,
maxBytes=1024 * config.logfilesize,
backupCount=config.logfilecount,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692624
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I38937c3060d4653d1ffe8a8d9b918a8548907ab0
Gerrit-Change-Number: 692624
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Bináris <wikiposta(a)gmail.com>
Gerrit-Reviewer: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692617 )
Change subject: [IMPR] re-use throttle PID (Step 1)
......................................................................
[IMPR] re-use throttle PID (Step 1)
After dropping a throttle PID it can be reused for a next process.
PID (Process IDentifier) is to be used for logging filenames to
prevent WindowsError/PermissionError if runnng more than one script
with the same name.
Bug: T56685
Change-Id: I7588e81c15c77b63fe919c653a33430f71f5c538
---
M pywikibot/throttle.py
1 file changed, 10 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 33dff52..edb6625 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -4,14 +4,17 @@
#
# Distributed under the terms of the MIT license.
#
+import itertools
import math
import threading
import time
+
from collections import namedtuple
from contextlib import suppress
from typing import Optional, Union
import pywikibot
+
from pywikibot import config
@@ -117,11 +120,12 @@
_logger)
with self.lock:
processes = []
- my_pid = pid or 1 # start at 1 if global pid not yet set
+ used_pids = set()
count = 1
now = time.time()
for proc in self._read_file(raise_exc=True):
+ used_pids.add(proc.pid)
if now - proc.time > self.releasepid:
continue # process has expired, drop from file
if now - proc.time <= self.dropdelay \
@@ -130,16 +134,17 @@
count += 1
if proc.site != self.mysite or proc.pid != pid:
processes.append(proc)
- if not pid and proc.pid >= my_pid:
- my_pid = proc.pid + 1 # next unused process id
+ free_pid = (i for i in itertools.count(start=1)
+ if i not in used_pids)
if not pid:
- pid = my_pid
+ pid = next(free_pid)
+
self.checktime = time.time()
processes.append(
ProcEntry(pid=pid, time=self.checktime, site=mysite))
- self._write_file(processes)
+ self._write_file(sorted(processes, key=lambda x: x.pid))
self.process_multiplicity = count
pywikibot.log('Found {} {} processes running, including this one.'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692617
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7588e81c15c77b63fe919c653a33430f71f5c538
Gerrit-Change-Number: 692617
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Bináris <wikiposta(a)gmail.com>
Gerrit-Reviewer: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693659 )
Change subject: [doc] Update documentation
......................................................................
[doc] Update documentation
* Mediawiki --> MediaWiki
* unix --> Unix
** See https://en.wikipedia.org/wiki/Unix
* unicode --> Unicode
** See https://en.wikipedia.org/wiki/Unicode
Change-Id: Iba0e373beb0d94a6eb27e44cff0d61f14e6c4408
---
M pywikibot/CONTENT.rst
M pywikibot/userinterfaces/terminal_interface_unix.py
M scripts/maintenance/cache.py
M tests/ui_tests.py
4 files changed, 11 insertions(+), 11 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/CONTENT.rst b/pywikibot/CONTENT.rst
index 7f977f5..80c8fc1 100644
--- a/pywikibot/CONTENT.rst
+++ b/pywikibot/CONTENT.rst
@@ -47,7 +47,7 @@
+----------------------------+------------------------------------------------------+
| interwiki_graph.py | Possible create graph with interwiki.py script |
+----------------------------+------------------------------------------------------+
- | logentries.py | Objects representing Mediawiki log entries |
+ | logentries.py | Objects representing MediaWiki log entries |
+----------------------------+------------------------------------------------------+
| logging.py | Logging and output functions |
+----------------------------+------------------------------------------------------+
@@ -89,7 +89,7 @@
+----------------------------+------------------------------------------------------+
| data | Module providing layers of data access to wiki |
+============================+======================================================+
- | api.py | Interface to Mediawiki's api.php |
+ | api.py | Interface to MediaWiki's api.php |
+----------------------------+------------------------------------------------------+
| mysql.py | Miscellaneous helper functions for mysql queries |
+----------------------------+------------------------------------------------------+
@@ -174,19 +174,19 @@
+============================+======================================================+
| _interface_base.py | Abstract base user interface module |
+----------------------------+------------------------------------------------------+
- | gui.py | GUI with a unicode textfield where the user can edit |
+ | gui.py | GUI with a Unicode textfield where the user can edit |
+----------------------------+------------------------------------------------------+
| terminal_interface.py | Platform independent terminal interface module |
+----------------------------+------------------------------------------------------+
| terminal_interface_base.py | Base for terminal user interfaces |
+----------------------------+------------------------------------------------------+
- | terminal_interface_unix.py | User interface for unix terminals |
+ | terminal_interface_unix.py | User interface for Unix terminals |
+----------------------------+------------------------------------------------------+
| terminal_interface_win32.py| User interface for Win32 terminals |
+----------------------------+------------------------------------------------------+
| transliteration.py | Module to transliterate text |
+----------------------------+------------------------------------------------------+
- | win32_unicode.py | Stdout, stderr and argv support for unicode |
+ | win32_unicode.py | Stdout, stderr and argv support for Unicode |
+----------------------------+------------------------------------------------------+
diff --git a/pywikibot/userinterfaces/terminal_interface_unix.py b/pywikibot/userinterfaces/terminal_interface_unix.py
index a23ce78..8d82f32 100755
--- a/pywikibot/userinterfaces/terminal_interface_unix.py
+++ b/pywikibot/userinterfaces/terminal_interface_unix.py
@@ -1,6 +1,6 @@
-"""User interface for unix terminals."""
+"""User interface for Unix terminals."""
#
-# (C) Pywikibot team, 2003-2020
+# (C) Pywikibot team, 2003-2021
#
# Distributed under the terms of the MIT license.
#
@@ -32,7 +32,7 @@
class UnixUI(terminal_interface_base.UI):
- """User interface for unix terminals."""
+ """User interface for Unix terminals."""
def support_color(self, target_stream):
"""Return that the target stream supports colors."""
@@ -44,7 +44,7 @@
return chr(27) + '[' + str(int(code) + 10) + 'm'
def encounter_color(self, color, target_stream):
- """Write the unix color directly to the stream."""
+ """Write the Unix color directly to the stream."""
fg, bg = self.divide_color(color)
fg = unixColors[fg]
self._write(fg, target_stream)
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 125f2a6..01247e2 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -218,7 +218,7 @@
whether cache files are being used.
However file access times are not always usable.
On many modern filesystems, they have been disabled.
- On unix, check the filesystem mount options. You may
+ On Unix, check the filesystem mount options. You may
need to remount with 'strictatime'.
@param use_accesstime: Whether access times should be used.
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index f9c76c9..e1bb12a 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -333,7 +333,7 @@
@unittest.skipUnless(os.name == 'posix', 'requires Unix console')
class TestTerminalUnicodeUnix(UITestCase):
- """Terminal output tests for unix."""
+ """Terminal output tests for Unix."""
def testOutputUnicodeText(self):
pywikibot.output('Заглавная_страница')
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693659
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iba0e373beb0d94a6eb27e44cff0d61f14e6c4408
Gerrit-Change-Number: 693659
Gerrit-PatchSet: 3
Gerrit-Owner: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged