jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] gui: Fix import errors of gui module
......................................................................
[FIX] gui: Fix import errors of gui module
The gui imports are invalid and thus it wasn't possible to use the
tkinter editor. The relative import in editor.py was neither in Python 3
nor in Python 2 valid and introduced with
728524b6a94c56a9fe92f338bfa5a8149e0a6ab5. The import in
terminal_interface_base.py is valid in Python 2 but not in Python 3 so
changed that into an absolute also.
Change-Id: I6fb408452ff7878e67b3edb953a02526af97c0e3
---
M pywikibot/editor.py
M pywikibot/userinterfaces/terminal_interface_base.py
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index d3e268a..13db04d 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -4,7 +4,7 @@
#
# (C) Gerrit Holl, 2004
-# (C) Pywikibot team, 2004-2014
+# (C) Pywikibot team, 2004-2015
#
# Distributed under the terms of the MIT license.
#
@@ -93,7 +93,7 @@
return newcontent
try:
- import gui # noqa
+ import pywikibot.userinterfaces.gui # noqa
except ImportError as e:
raise pywikibot.Error(
'Could not load GUI modules: %s\nNo editor available.\n'
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index 6d2ceea..c367b65 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -331,7 +331,7 @@
@rtype: unicode or None
"""
try:
- import gui
+ from pywikibot.userinterfaces import gui
except ImportError as e:
print('Could not load GUI modules: %s' % e)
return text
--
To view, visit https://gerrit.wikimedia.org/r/184244
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6fb408452ff7878e67b3edb953a02526af97c0e3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Remove broken linebreak fixes
......................................................................
Remove broken linebreak fixes
Python's universal newline should already take care of this; in addition to
that, they were the wrong way around -- changing '\n' to '\r\n' when reading
the file (while this should have been the other way around).
This code was originally implemented in
https://www.mediawiki.org/wiki/Special:Code/pywikipedia/3739
Change-Id: I78d97cdeb4632a038bc4c9eb1c9be67a63dfbed4
---
M pywikibot/editor.py
1 file changed, 2 insertions(+), 24 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index 1f877e3..d3e268a 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -11,7 +11,6 @@
__version__ = '$Id$'
#
-import sys
import os
import tempfile
import codecs
@@ -57,22 +56,6 @@
pywikibot.log(u'Running editor: %s' % command)
return command
- def convertLinebreaks(self, text):
- """Convert line-breaks."""
- if sys.platform == 'win32':
- return text.replace('\r\n', '\n')
- # TODO: Mac OS handling
- return text
-
- def restoreLinebreaks(self, text):
- """Restore line-breaks."""
- if text is None:
- return
- if sys.platform == 'win32':
- return text.replace('\n', '\r\n')
- # TODO: Mac OS handling
- return text
-
def edit(self, text, jumpIndex=None, highlight=None):
"""
Call the editor and thus allows the user to change the text.
@@ -89,7 +72,6 @@
file in his text editor
@rtype: unicode or None
"""
- text = self.convertLinebreaks(text)
if config.editor:
tempFilename = '%s.%s' % (tempfile.mktemp(),
config.editor_filename_extension)
@@ -108,7 +90,7 @@
encoding=config.editor_encoding) as temp_file:
newcontent = temp_file.read()
os.unlink(tempFilename)
- return self.restoreLinebreaks(newcontent)
+ return newcontent
try:
import gui # noqa
@@ -120,8 +102,4 @@
'are typically part of Python but may be packaged separately '
'on your platform.\n' % e)
- return self.restoreLinebreaks(
- pywikibot.ui.editText(
- text,
- jumpIndex=jumpIndex,
- highlight=highlight))
+ return pywikibot.ui.editText(text, jumpIndex=jumpIndex, highlight=highlight)
--
To view, visit https://gerrit.wikimedia.org/r/184236
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I78d97cdeb4632a038bc4c9eb1c9be67a63dfbed4
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #1913
Status: Errored
Duration: 43 minutes and 28 seconds
Commit: 573b47c (master)
Author: Fabian Neundorf
Message: [IMPROV] Request all tokens at once
Prior to version 1.20 it wasn't requesting all tokens at once but each
in a separate request. But the API actually allows to request all tokens
at once.
Change-Id: I91326d6a30269f617ba60d18079339832028da5b
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/19e747665474...573b47c6…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/46581105
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Request all tokens at once
......................................................................
[IMPROV] Request all tokens at once
Prior to version 1.20 it wasn't requesting all tokens at once but each
in a separate request. But the API actually allows to request all tokens
at once.
Change-Id: I91326d6a30269f617ba60d18079339832028da5b
---
M pywikibot/site.py
1 file changed, 12 insertions(+), 14 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index c1fd08a..9e0c75a 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2673,24 +2673,23 @@
if _version < MediaWikiVersion('1.20'):
if all:
types.extend(self.TOKENS_0)
- for tokentype in self.validate_tokens(types):
- # 'patrol' token is done later on.
- if tokentype == 'patrol':
- continue
- query = api.PropertyGenerator('info',
- titles='Dummy page',
- intoken=tokentype,
- site=self)
- query.request._warning_handler = warn_handler
+ valid_tokens = set(self.validate_tokens(types))
+ # don't request patrol
+ query = api.PropertyGenerator('info',
+ titles='Dummy page',
+ intoken=valid_tokens - set(['patrol']),
+ site=self)
+ query.request._warning_handler = warn_handler
- for item in query:
- pywikibot.debug(unicode(item), _logger)
+ for item in query:
+ pywikibot.debug(unicode(item), _logger)
+ for tokentype in valid_tokens:
if (tokentype + 'token') in item:
user_tokens[tokentype] = item[tokentype + 'token']
# patrol token require special handling.
# TODO: try to catch exceptions?
- if 'patrol' in types:
+ if 'patrol' in valid_tokens:
if MediaWikiVersion('1.14') <= _version < MediaWikiVersion('1.17'):
user_tokens['patrol'] = user_tokens['edit']
else:
@@ -2707,8 +2706,7 @@
item = data['recentchanges'][0]
pywikibot.debug(unicode(item), _logger)
if 'patroltoken' in item:
- user_tokens['patrol'] = item.get('patroltoken')
-
+ user_tokens['patrol'] = item['patroltoken']
else:
if _version < MediaWikiVersion('1.24wmf19'):
if all is not False:
--
To view, visit https://gerrit.wikimedia.org/r/184125
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I91326d6a30269f617ba60d18079339832028da5b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #1911
Status: Errored
Duration: 44 minutes and 33 seconds
Commit: 6301648 (master)
Author: xqt
Message: L10N test for valid templates
- test for redirect-broken-redirect-template
- test for archivebot-archiveheader
New parameter fallback for i18n.twtranslate() to disable language
code fallback for test purposes and L10N.
New method i18n.twget_keys to retrieve all language codes of
a package.
Add l10n_tests to flake8-docstrings-mandatory
Change-Id: I891a4862e16d2d51eec0cca03367e74feedf4d2b
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/4163d9686e5a...63016482…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/46549113
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications