Bug#1000656: (no subject)

2021-11-26 Thread John Vandenberg
Package: libpoco-dev
Severity: important
X-Debbugs-Cc: jay...@gmail.com

Dear Maintainer,

I am attempting to use libpoco-dev cmake files on bullseye, but the
problem encountered dates back to the addition of the cmake files to
the libpoco-dev package as part of
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880614

The CMakeLists.txt snippet which should work is:

find_package(Poco COMPONENTS Foundation REQUIRED)

However that looks for "Poco" cmake files and fails.
This first problem is raised upstream as
https://github.com/pocoproject/poco/issues/3244

I can workaround this by doing
# ln -s /usr/lib/x86_64-linux-gnu/cmake/cmake/Poco/ /usr/lib/cmake/

Then we encounter the following error:

CMake Error at /usr/share/cmake-3.18/Modules/CMakeFindDependencyMacro.cmake:47 
(find_package):
  By not providing "FindPCRE.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCRE", but
  CMake did not find one.

  Could not find a package configuration file provided by "PCRE" with any of
  the following names:

PCREConfig.cmake
pcre-config.cmake

  Add the installation prefix of "PCRE" to CMAKE_PREFIX_PATH or set
  "PCRE_DIR" to a directory containing one of the above files.  If "PCRE"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/cmake/Poco/PocoFoundationConfig.cmake:5 
(find_dependency)
  /usr/lib/x86_64-linux-gnu/cmake/cmake/Poco/PocoConfig.cmake:29 (find_package)
  CMakeLists.txt:48 (find_package)

This is because libpcre2-dev and libpcre3-dev dont include any of those
mentioned files (FindPCRE.cmake, PCREConfig.cmake, or
pcre-config.cmake).

Note pcre2 does has a pcre2-config.cmake.in file which presumably
is used to generate a pcre2-config.cmake .
https://sources.debian.org/src/pcre2/10.39-3/cmake/
This wont suffice, as it doesnt provide cmake library `Pcre::Pcre`
which is needed by Poco.

However I can workaround this by adding the followinfg to /usr/lib/cmake/Poco/
as set up previously.
https://github.com/pocoproject/poco/blob/master/cmake/FindPCRE.cmake
Note the contents of that file mention `Pcre::Pcre`.

Worth noting vcpkg goes about fixing this a different way, by creating
their own unofficial-pcre-config.cmake at
https://github.com/ddc7451/vcpkg/tree/5746100fdc746523dd6cb1bac2cd1c0a50e0c253/ports/pcre
and then patching poco to look for unofficial::pcre::pcre
https://github.com/ddc7451/vcpkg/search?q=unofficial%3A%3Apcre%3A%3Apcre
https://github.com/ddc7451/vcpkg/blob/5746100fdc746523dd6cb1bac2cd1c0a50e0c253/ports/poco/include_pcre.patch

-- System Information (reportbug hacked to work on macos..):
Architecture: darwin-amd64 (x86_64)

Kernel: Darwin 21.1.0
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Init: unable to detect



[Bug 1840575] Re: numpy tests fail on openSUSE i586 and armv7l

2019-08-18 Thread John Vandenberg
Note this only occurs when opengl-accelerate is present.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840575

Title:
  numpy tests fail on openSUSE i586 and armv7l

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyopengl/+bug/1840575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1840575] Re: numpy tests fail on openSUSE i586 and armv7l

2019-08-18 Thread John Vandenberg
Two of the failures

[  125s] === FAILURES 
===
[  125s] _ TestCoreDatatype.test_array_subclass 
_
[  125s] 
[  125s] self = 
[  125s] 
[  125s] @pytest.mark.skipif( not np, reason="Numpy not available")
[  125s] def test_array_subclass( self ):
[  125s] s = Subclassed([0,1,2,3,4])
[  125s] >   result = arraydatatype.ArrayDatatype.asArray( s )
[  125s] 
[  125s] tests/test_arraydatatype.py:287: 
[  125s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ 
[  125s] src/arraydatatype.pyx:172: in 
OpenGL_accelerate.arraydatatype.ArrayDatatype.asArray
[  125s] ???
[  125s] src/arraydatatype.pyx:47: in 
OpenGL_accelerate.arraydatatype.HandlerRegistry.c_lookup
[  125s] ???
[  125s] OpenGL/plugins.py:16: in load
[  125s] return importByName( self.import_path )
[  125s] OpenGL/plugins.py:38: in importByName
[  125s] module = __import__( ".".join(moduleName), {}, {}, moduleName)
[  125s] OpenGL/arrays/numpymodule.py:28: in 
[  125s] from OpenGL_accelerate.numpy_formathandler import NumpyHandler
[  125s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ 
[  125s] 
[  125s] >   ???
[  125s] E   AttributeError: 'module' object has no attribute 'float128'
[  125s] 
[  125s] src/numpy_formathandler.pyx:55: AttributeError
[  125s]  TestCoreDatatype.test_buffer_api_basic 

[  125s] 
[  125s] self = 
[  125s] 
[  125s] @pytest.mark.skipif( not (
[  125s] OpenGL.USE_ACCELERATE and 
acceleratesupport.ACCELERATE_AVAILABLE
[  125s] ), reason="Need OpenGL_accelerate for buffer support")
[  125s] def test_buffer_api_basic(self):
[  125s] import array as silly_array
[  125s] structures = [
[  125s] (b'this and that',13,1,True,1,b'B',[13],[1]),
[  125s] ]
[  125s] if sys.version_info[:2] >= (2,7):
[  125s] structures.append(
[  125s] # on Python 3.4 we do *not* get the (3) prefix :(
[  125s] ((GLint * 3)( 1,2,3 
),12,4,False,1,[b'(3)= (3,0):
[  125s] # only supports buffer protocol in 3.x
[  125s] structures.extend([
[  125s] 
(silly_array.array('I',[1,2,3]),12,4,False,1,b'I',[3],[4]),
[  125s] ])
[  125s] try:
[  125s] structures.append( 
(memoryview(b'this'),4,1,True,1,b'B',[4],[1]) )
[  125s] except NameError:
[  125s] # Python 2.6 doesn't have memory view
[  125s] pass
[  125s] try:
[  125s] if array:
[  125s] structures.extend( [
[  125s] 
(arange(0,9,dtype='I').reshape((3,3)),36,4,False,2,b'I',[3,3],[12,4]),
[  125s] 
(arange(0,9,dtype='I').reshape((3,3))[:,1],12,4,False,1,b'I',[3],[12]),
[  125s] ])
[  125s] except NameError:
[  125s] # Don't have numpy installed...
[  125s] pass
[  125s] 
[  125s] from OpenGL.arrays import _buffers
[  125s] for object,length,itemsize,readonly,ndim,format,shape,strides 
in structures:
[  125s] buf = _buffers.Py_buffer.from_object( object, 
_buffers.PyBUF_STRIDES|_buffers.PyBUF_FORMAT )
[  125s] with buf:
[  125s] assert buf.len == length, (object,length,buf.len)
[  125s] assert buf.itemsize == itemsize, 
(object,itemsize,buf.itemsize)
[  125s] assert buf.readonly == readonly, 
(object,readonly,buf.readonly)
[  125s] assert buf.ndim == ndim, (object,ndim,buf.ndim)
[  125s] if isinstance( format, list):
[  125s] >   assert buf.format in format, 
(object,format,buf.format)
[  125s] E   AssertionError: 
(, ['(3).format
[  125s] 
[  125s] tests/test_arraydatatype.py:245: AssertionError

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840575

Title:
  numpy tests fail on openSUSE i586 and armv7l

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyopengl/+bug/1840575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1840575] Re: numpy tests fail on openSUSE i586 and armv7l

2019-08-18 Thread John Vandenberg
The list of tests failing or aborting:

test_array_subclass
test_buffer_api_basic
test_byte_count_numpy
test_numpyConversion
test_copyNonContiguous
test_arrayTranspose
test_glmultidraw
test_glbuffersubdata_numeric
test_vbo
test_mmap_data
test_nurbs
test_evaluator
test_tess_cb_traditional
test_glAreTexturesResident
test_tess_collection
test_glreadpixels_warray

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840575

Title:
  numpy tests fail on openSUSE i586 and armv7l

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyopengl/+bug/1840575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1840575] Re: numpy tests fail on openSUSE i586 and armv7l

2019-08-18 Thread John Vandenberg
** Summary changed:

- numpy tests fail on openSUSE i586 and armv7l Python 2.7
+ numpy tests fail on openSUSE i586 and armv7l

** Description changed:

  On openSUSE, when numpy is available in the build VM, the tests fail on
- Python 2.7
+ Python 2.7 and Python 3.7
  
  The short version:
  
  [  258s] + python2 -m pytest -v tests
  [  258s] = test session starts 
==
  [  258s] platform linux2 -- Python 2.7.16, pytest-4.6.4, py-1.8.0, 
pluggy-0.12.0 -- /usr/bin/python2
  [  258s] cachedir: .pytest_cache
  [  258s] rootdir: /home/abuild/rpmbuild/BUILD/PyOpenGL-3.1.3b2
  [  267s] collecting ... collected 65 items
- [  267s] 
+ [  267s]
  [  267s] tests/test_arraydatatype.py::TestCoreDatatype::test_arrayPointer 
PASSED  [  1%]
  [  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_array_subclass 
FAILED [  3%]
  [  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_buffer_api_basic 
FAILED [  4%]
  [  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_byte_count 
PASSED[  6%]
  [  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_byte_count_numpy 
/var/tmp/rpm-tmp.Ztyz5e: line 42: 25279 Aborted python2 -m 
pytest -v tests
  [  268s] + kill 25259
  
  The complete rpmbuild log is attached.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840575

Title:
  numpy tests fail on openSUSE i586 and armv7l

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyopengl/+bug/1840575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1784105] Re: stop building python3-pyopengl for now, and demote rdeps

2019-08-18 Thread John Vandenberg
openSUSE is using the PyOpenGL-3.1.3b2 and it is working well on Python
3.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1784105

Title:
  stop building python3-pyopengl for now, and demote rdeps

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dxf2gcode/+bug/1784105/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1840575] [NEW] numpy tests fail on openSUSE i586 and armv7l Python 2.7

2019-08-18 Thread John Vandenberg
Public bug reported:

On openSUSE, when numpy is available in the build VM, the tests fail on
Python 2.7

The short version:

[  258s] + python2 -m pytest -v tests
[  258s] = test session starts 
==
[  258s] platform linux2 -- Python 2.7.16, pytest-4.6.4, py-1.8.0, 
pluggy-0.12.0 -- /usr/bin/python2
[  258s] cachedir: .pytest_cache
[  258s] rootdir: /home/abuild/rpmbuild/BUILD/PyOpenGL-3.1.3b2
[  267s] collecting ... collected 65 items
[  267s] 
[  267s] tests/test_arraydatatype.py::TestCoreDatatype::test_arrayPointer 
PASSED  [  1%]
[  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_array_subclass 
FAILED [  3%]
[  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_buffer_api_basic 
FAILED [  4%]
[  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_byte_count PASSED  
  [  6%]
[  268s] tests/test_arraydatatype.py::TestCoreDatatype::test_byte_count_numpy 
/var/tmp/rpm-tmp.Ztyz5e: line 42: 25279 Aborted python2 -m 
pytest -v tests
[  268s] + kill 25259

The complete rpmbuild log is attached.

** Affects: pyopengl (Ubuntu)
 Importance: Undecided
 Status: New

** Attachment added: "i586 build log"
   https://bugs.launchpad.net/bugs/1840575/+attachment/5283091/+files/log.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840575

Title:
  numpy tests fail on openSUSE i586 and armv7l Python 2.7

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyopengl/+bug/1840575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Re: [Rpm-maint] [rpm-software-management/rpm] Fix doc permissions (#567)

2019-03-23 Thread John Vandenberg
It also appears to disregard any hard links, and doesnt re-hard-link them, 
which in my case is causing rpmlint to rage about file duplicates in the docs 
dir.

This is because doc and license are handled by `processSpecialDir` which is a 
bit special, most likely because it is using globs from the source and not 
obtaining files from the buildroot.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/567#issuecomment-475867383___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[phpMyAdmin Git] [phpmyadmin/localized_docs] f84c8c: Translated using Weblate (Indonesian)

2017-10-02 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/localized_docs
  Commit: f84c8cd0d5c5d5edac1173ab83e92926f6611495
  
https://github.com/phpmyadmin/localized_docs/commit/f84c8cd0d5c5d5edac1173ab83e92926f6611495
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2017-10-02 (Mon, 02 Oct 2017)

  Changed paths:
M po/id.mo
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 32.3% (791 of 2446 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/localized_docs] 6bc551: Translated using Weblate (Indonesian)

2017-09-30 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/localized_docs
  Commit: 6bc551a2cb2c5b462938484502051d009f8c3be2
  
https://github.com/phpmyadmin/localized_docs/commit/6bc551a2cb2c5b462938484502051d009f8c3be2
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2017-09-30 (Sat, 30 Sep 2017)

  Changed paths:
M po/id.mo
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 31.8% (779 of 2446 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/phpmyadmin] fb492e: Translated using Weblate (Indonesian)

2017-09-29 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/phpmyadmin
  Commit: fb492e150ecf40c0c3bd44237b21dcf03ca97976
  
https://github.com/phpmyadmin/phpmyadmin/commit/fb492e150ecf40c0c3bd44237b21dcf03ca97976
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2017-09-29 (Fri, 29 Sep 2017)

  Changed paths:
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 81.3% (2628 of 3231 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/phpmyadmin] 99294f: Translated using Weblate (Indonesian)

2017-09-29 Thread John Vandenberg
  Branch: refs/heads/QA_4_7
  Home:   https://github.com/phpmyadmin/phpmyadmin
  Commit: 99294f872aa0afd68ec8d0ced922f5a4aa6e3988
  
https://github.com/phpmyadmin/phpmyadmin/commit/99294f872aa0afd68ec8d0ced922f5a4aa6e3988
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2017-09-29 (Fri, 29 Sep 2017)

  Changed paths:
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 81.4% (2611 of 3205 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/localized_docs] 5107de: Translated using Weblate (Indonesian)

2017-09-23 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/localized_docs
  Commit: 5107de8197b0dfaf601ee439fef767ca0507a647
  
https://github.com/phpmyadmin/localized_docs/commit/5107de8197b0dfaf601ee439fef767ca0507a647
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2017-09-24 (Sun, 24 Sep 2017)

  Changed paths:
M po/id.mo
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 30.7% (753 of 2446 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/localized_docs] 9cc791: Translated using Weblate (Indonesian)

2016-10-12 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/localized_docs
  Commit: 9cc7914fe0ddc8caa90ca5da32150442de2561e4
  
https://github.com/phpmyadmin/localized_docs/commit/9cc7914fe0ddc8caa90ca5da32150442de2561e4
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2016-10-13 (Thu, 13 Oct 2016)

  Changed paths:
M po/id.mo
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 7.2% (165 of 2291 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[phpMyAdmin Git] [phpmyadmin/localized_docs] 877c28: Translated using Weblate (Indonesian)

2016-10-12 Thread John Vandenberg
  Branch: refs/heads/master
  Home:   https://github.com/phpmyadmin/localized_docs
  Commit: 877c28f9f859a4806b1556764be697d0aab0501c
  
https://github.com/phpmyadmin/localized_docs/commit/877c28f9f859a4806b1556764be697d0aab0501c
  Author: John Vandenberg <jay...@gmail.com>
  Date:   2016-10-09 (Sun, 09 Oct 2016)

  Changed paths:
M po/id.mo
M po/id.po

  Log Message:
  ---
  Translated using Weblate (Indonesian)

Currently translated at 1.2% (28 of 2291 strings)

[CI skip]


___
Git mailing list
Git@phpmyadmin.net
https://lists.phpmyadmin.net/mailman/listinfo/git


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Replace debian-sid with lucid

2016-10-03 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313832

Change subject: Replace debian-sid with lucid
..

Replace debian-sid with lucid

djvulibre-bin in debian-sid is incompatible with the
Travis precise sudoless images.  Use lucid instead.

Bug: T145484
Change-Id: I6dda8892b1c020c7f8f0c1b1758f71b7250cd576
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/32/313832/1

diff --git a/.travis.yml b/.travis.yml
index 5dc947f..9d46272 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,7 +17,7 @@
 addons:
   apt:
 sources:
-  - debian-sid
+  - lucid
 packages:
   - libssl1.0.0
   - djvulibre-bin

-- 
To view, visit https://gerrit.wikimedia.org/r/313832
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6dda8892b1c020c7f8f0c1b1758f71b7250cd576
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Avoid broken pycparser 2.14

2016-10-03 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313821

Change subject: Avoid broken pycparser 2.14
..

Avoid broken pycparser 2.14

Package cryptography depends on cffi which
depends on pycparser.  pycparser 2.14 is broken
and needs to be avoided.

https://github.com/eliben/pycparser/issues/147

Change-Id: Ie95a686dc830d5c70f5dfd8205d579f344e4b193
---
M requests-requirements.txt
M requirements.txt
M setup.py
3 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/21/313821/1

diff --git a/requests-requirements.txt b/requests-requirements.txt
index 4ad0a88..e5cf659 100644
--- a/requests-requirements.txt
+++ b/requests-requirements.txt
@@ -5,3 +5,5 @@
 pyOpenSSL>=0.13 ; python_full_version < '2.7.9' or python_version >= '3'
 ndg-httpsclient ; python_full_version < '2.7.9' or python_version >= '3'
 pyasn1 ; python_full_version < '2.7.9' or python_version >= '3'
+# https://github.com/eliben/pycparser/issues/147
+pycparser != 2.14
diff --git a/requirements.txt b/requirements.txt
index 0aeb72d..83761b3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -25,6 +25,8 @@
 pyOpenSSL>=0.13 ; python_full_version < '2.7.9'
 ndg-httpsclient ; python_full_version < '2.7.9'
 pyasn1 ; python_full_version < '2.7.9'
+# https://github.com/eliben/pycparser/issues/147
+pycparser != 2.14
 
 future>=0.15.0 ; python_version < '2.7'
 
diff --git a/setup.py b/setup.py
index f688df5..7abce5f 100644
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,7 @@
 # 0.6.1 supports socket.io 1.0, but WMF is using 0.9 (T91393 and T85716)
 # websocket-client>=0.33 is required by socketIO-client (T114913)
 'rcstream': ['socketIO-client<0.6.1', 'websocket-client>=0.33'],
-'security': ['requests[security]'],
+'security': ['requests[security]', 'pycparser!=2.14'],
 'mwoauth': ['mwoauth>=0.2.4'],
 'html': ['BeautifulSoup4'],
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/313821
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie95a686dc830d5c70f5dfd8205d579f344e4b193
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: pydocstyle 1.1.0 is incompatible with 1.0.x

2016-10-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313677

Change subject: pydocstyle 1.1.0 is incompatible with 1.0.x
..

pydocstyle 1.1.0 is incompatible with 1.0.x

Bug: T147126
Change-Id: Iabf7b612b1da55a3788148bb38721b9bdea3b672
---
M tox.ini
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/77/313677/1

diff --git a/tox.ini b/tox.ini
index f053a96..5514562 100644
--- a/tox.ini
+++ b/tox.ini
@@ -52,6 +52,7 @@
 basepython = python2.7
 deps = flake8<3
pyflakes >= 1.1
+   pydocstyle != 1.1.0
hacking
flake8-docstrings>=0.2.6
flake8-putty>=0.3.2

-- 
To view, visit https://gerrit.wikimedia.org/r/313677
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabf7b612b1da55a3788148bb38721b9bdea3b672
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: unicodedata2 9 supports Python 3

2016-10-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313676

Change subject: unicodedata2 9 supports Python 3
..

unicodedata2 9 supports Python 3

Change-Id: I5d416d548a5aef16b3217f41bcbbf296882422fa
---
M requirements.txt
M setup.py
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/76/313676/1

diff --git a/requirements.txt b/requirements.txt
index 0aeb72d..71506d1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -31,6 +31,7 @@
 ipaddr>=2.1.10 ; python_version < '3'
 
 unicodedata2>=7.0.0-2 ; python_version < '3'
+unicodedata2>=9.0.0-2 ; python_version >= '3'
 
 # OAuth support
 # mwoauth 0.2.4 is needed because it supports getting identity information
diff --git a/setup.py b/setup.py
index f688df5..2e28367 100644
--- a/setup.py
+++ b/setup.py
@@ -66,6 +66,7 @@
 'security': ['requests[security]'],
 'mwoauth': ['mwoauth>=0.2.4'],
 'html': ['BeautifulSoup4'],
+'unicode': ['unicodedata2>=9.0.0-2'],
 }
 
 if PY2:

-- 
To view, visit https://gerrit.wikimedia.org/r/313676
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d416d548a5aef16b3217f41bcbbf296882422fa
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Use released flake8-mock 0.3

2016-09-10 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/309816

Change subject: Use released flake8-mock 0.3
..

Use released flake8-mock 0.3

Change-Id: I10d134d8059236ea758065566a64edc390aeaab0
---
M dev-requirements.txt
M tox.ini
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/16/309816/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index e8bab19..edd5005 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -17,7 +17,7 @@
 pyflakes>=0.9
 flake8
 flake8-docstrings>=0.2.6
-git+https://github.com/jayvdb/flake8-mock@use-ascii-readme
+flake8-mock>=0.3
 codecov
 coverage
 mock ; python_version < '3'
diff --git a/tox.ini b/tox.ini
index c436cf8..f053a96 100644
--- a/tox.ini
+++ b/tox.ini
@@ -62,7 +62,7 @@
flake8-import-order
flake8-tuple>=0.2.8
flake8-print>=2.0.1
-   git+https://github.com/jayvdb/flake8-mock@use-ascii-readme
+   flake8-mock>=0.3
pep8-naming
 
 [testenv:nose]

-- 
To view, visit https://gerrit.wikimedia.org/r/309816
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10d134d8059236ea758065566a64edc390aeaab0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow importing to specified namespace

2016-08-23 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/306219

Change subject: Allow importing to specified namespace
..

Allow importing to specified namespace

Bug: T143687
Change-Id: I4b0d8eef1a8ee5e4c5871140fe26b8763b1ea597
---
M maintenance/importDump.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/306219/1

diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index f0e0555..c926126 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -70,6 +70,8 @@
$this->addOption( 'namespaces',
'Import only the pages from namespaces belonging to the 
list of ' .
'pipe-separated namespace names or namespace indexes', 
false, true );
+   $this->addOption( 'to-namespace', 'Pages will be imported into 
specified namespace',
+   false, true );
$this->addOption( 'rootpage', 'Pages will be imported as 
subpages of the specified page',
false, true );
$this->addOption( 'dry-run', 'Parse dump without actually 
importing pages' );

-- 
To view, visit https://gerrit.wikimedia.org/r/306219
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b0d8eef1a8ee5e4c5871140fe26b8763b1ea597
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Split run method into __init__ and treat method

2016-08-21 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/305869

Change subject: Split run method into __init__ and treat method
..

Split run method into __init__ and treat method

Change-Id: I18c29f25b272b2ccee6cfc7985f3997bb845a6db
---
M scripts/unusedfiles.py
1 file changed, 29 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/69/305869/1

diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index 3024a2a..147e869 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -44,8 +44,6 @@
 super(UnusedFilesBot, self).__init__(**kwargs)
 self.site = site
 
-def run(self):
-"""Start the bot."""
 template_image = i18n.translate(self.site,
 template_to_the_image)
 template_user = i18n.translate(self.site,
@@ -54,27 +52,37 @@
 if not all([template_image, template_user]):
 raise pywikibot.Error(u'This script is not localized for %s site.'
   % self.site)
+
+self.template_image = template_image
+self.template_user = template_user
+
 generator = pagegenerators.UnusedFilesGenerator(site=self.site)
 generator = pagegenerators.PreloadingGenerator(generator)
-for image in generator:
-if not image.exists():
-pywikibot.output("File '%s' does not exist (see bug T71133)."
- % image.title())
-continue
-# Use fileUrl() and fileIsShared() to confirm it is local media
-# rather than a local page with the same name as shared media.
-if (image.fileUrl() and not image.fileIsShared() and
-u'http://' not in image.text):
-if template_image in image.text:
-pywikibot.output(u"%s done already"
- % image.title(asLink=True))
-continue
-self.append_text(image, u"\n\n" + template_image)
-uploader = image.getFileVersionHistory().pop(0)['user']
-user = pywikibot.User(image.site, uploader)
-usertalkpage = user.getUserTalkPage()
-msg2uploader = template_user % {'title': image.title()}
-self.append_text(usertalkpage, msg2uploader)
+
+self.generator = generator
+
+def treat(self, image):
+"""Process one image page."""
+if not image.exists():
+pywikibot.output("File '%s' does not exist (see bug T71133)."
+ % image.title())
+return
+# Use fileUrl() and fileIsShared() to confirm it is local media
+# rather than a local page with the same name as shared media.
+if (image.fileUrl() and not image.fileIsShared() and
+u'http://' not in image.text):
+if self.template_image in image.text:
+pywikibot.output(u"%s done already"
+ % image.title(asLink=True))
+return
+
+self.append_text(image, '\n\n' + self.template_image)
+
+uploader = image.getFileVersionHistory().pop(0)['user']
+user = pywikibot.User(image.site, uploader)
+usertalkpage = user.getUserTalkPage()
+msg2uploader = self.template_user % {'title': image.title()}
+self.append_text(usertalkpage, msg2uploader)
 
 def append_text(self, page, apptext):
 """Append apptext to the page."""

-- 
To view, visit https://gerrit.wikimedia.org/r/305869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18c29f25b272b2ccee6cfc7985f3997bb845a6db
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Deprecate ReplaceBot.doReplacements

2016-08-16 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/304974

Change subject: Deprecate ReplaceBot.doReplacements
..

Deprecate ReplaceBot.doReplacements

It was effectively deprecated by babc7cef.

Change-Id: I01be5aa92faecbcf0819cbacc84d13c4470186f2
---
M scripts/replace.py
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/74/304974/1

diff --git a/scripts/replace.py b/scripts/replace.py
index 7e3f0d9..0694ddf 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -629,6 +629,7 @@
 
 return new_text
 
+@deprecated('apply_replacements')
 def doReplacements(self, original_text, page=None):
 """Apply replacements to the given text and page."""
 if page is None:

-- 
To view, visit https://gerrit.wikimedia.org/r/304974
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01be5aa92faecbcf0819cbacc84d13c4470186f2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: setup.py: Add Python 3.4 and 3.5 to pypi classifiers

2016-08-10 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/303983

Change subject: setup.py: Add Python 3.4 and 3.5 to pypi classifiers
..

setup.py: Add Python 3.4 and 3.5 to pypi classifiers

Change-Id: I17fbde4172a5cd380c25b7f781a2a122f9313549
(cherry picked from commit b6e02407d8d1afde3c9df831f9bacb4a5a9f0e6e)
---
M setup.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/83/303983/1

diff --git a/setup.py b/setup.py
index 397dac1..265a915 100644
--- a/setup.py
+++ b/setup.py
@@ -188,6 +188,8 @@
 'Environment :: Console',
 'Programming Language :: Python :: 2.7',
 'Programming Language :: Python :: 3.3',
+'Programming Language :: Python :: 3.4',
+'Programming Language :: Python :: 3.5',
 ],
 use_2to3=False
 )

-- 
To view, visit https://gerrit.wikimedia.org/r/303983
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17fbde4172a5cd380c25b7f781a2a122f9313549
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: Remove item count output in page generators

2016-08-06 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/303376

Change subject: Remove item count output in page generators
..

Remove item count output in page generators

Currently WikibaseSearchItemPageGenerator always
fetches all items twice in order to display an item count,
and then yield each item.

Also do not fetch all entities for test_searchitem*.

The test only needs to confirm one item is fetched,
and currently it can halt Travis builds due to fetching
~5000 items twice taking 10 mins without any output.

Also add a note to WikidataQueryPageGenerator about its item count.

Change-Id: Ia8b0e97930a94945d3ed2cdf593887ebff8a3e5c
(manually cherry-picked from c9f51be)
---
M pywikibot/pagegenerators.py
M tests/pagegenerators_tests.py
2 files changed, 15 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/76/303376/1

diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e6420a4..d83d85d 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -2295,7 +2295,8 @@
 
 wd_query = wdquery.WikidataQuery(cacheMaxAge=0)
 data = wd_query.query(wd_queryset)
-
+# This item count should not be copied by other generators,
+# and should be removed when wdq becomes a real generator (T135592)
 pywikibot.output(u'retrieved %d items' % data[u'status'][u'items'])
 for item in data[u'items']:
 page = pywikibot.ItemPage(repo, u'Q{0}'.format(item))
@@ -2332,7 +2333,6 @@
 repo = site.data_repository()
 
 data = repo.search_entities(text, language, limit=total, site=site)
-pywikibot.output(u'retrieved %d items' % len(list(data)))
 for item in data:
 yield pywikibot.ItemPage(repo, item['id'])
 
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 967b95e..b19d0b5 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -708,21 +708,30 @@
 gf.handleArg('-searchitem:abc')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-self.assertGreater(len(set(gen)), 0)
+self.assertIsNotNone(next(gen))
 
 def test_searchitem_language(self):
 """Test -searchitem with custom language specified."""
 gf = pagegenerators.GeneratorFactory(site=self.site)
 gf.handleArg('-searchitem:pl:abc')
+gf.handleArg('-limit:1')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-pages = set(gen)
+# ABC disambiguation
+page1 = next(gen)
+self.assertEqual(page1.title(), 'Q286874')
+
 gf = pagegenerators.GeneratorFactory(site=self.site)
 gf.handleArg('-searchitem:en:abc')
+gf.handleArg('-limit:2')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-pages2 = set(gen)
-self.assertNotEqual(pages, pages2)
+# American Broadcasting Company
+page1 = next(gen)
+self.assertEqual(page1.title(), 'Q169889')
+# ABC disambiguation
+page2 = next(gen)
+self.assertEqual(page2.title(), 'Q286874')
 
 
 class TestLogeventsFactoryGenerator(DefaultSiteTestCase,

-- 
To view, visit https://gerrit.wikimedia.org/r/303376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8b0e97930a94945d3ed2cdf593887ebff8a3e5c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: Test Python 3.5 on Travis

2016-08-06 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/303373

Change subject: Test Python 3.5 on Travis
..

Test Python 3.5 on Travis

As Python 3.5 has been officially released we should test on this.
c.f. 773e72e adding this on master, and T106209 for why the rest
of that patch doesnt need backporting.

Change-Id: I31319a5feff31b3f4db1dacde782b7595917cf25
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/303373/1

diff --git a/.travis.yml b/.travis.yml
index 0823589..ade2476 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,7 @@
   - '2.7'
   - '3.3'
   - '3.4'
+  - '3.5'
 
 # OSX builds do not yet support Python
 os:

-- 
To view, visit https://gerrit.wikimedia.org/r/303373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31319a5feff31b3f4db1dacde782b7595917cf25
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: Fix docstring capitalization in return types and behavior

2016-08-06 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/303371

Change subject: Fix docstring capitalization in return types and behavior
..

Fix docstring capitalization in return types and behavior

Bug: T121365
Change-Id: I08aea29e0db61ab930fb2fefd8f5d025f7d36f55
(manually cherry-picked from c150a28)
---
M pywikibot/comms/rcstream.py
M scripts/data_ingestion.py
M scripts/featured.py
M scripts/replicate_wiki.py
M tests/ui_tests.py
5 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/71/303371/1

diff --git a/pywikibot/comms/rcstream.py b/pywikibot/comms/rcstream.py
index d024bc8..544e911 100644
--- a/pywikibot/comms/rcstream.py
+++ b/pywikibot/comms/rcstream.py
@@ -141,7 +141,7 @@
 
 
 def rc_listener(wikihost, rchost, rcport=80, rcpath='/rc', total=None):
-"""RC Changes Generator. Yields changes received from RCstream.
+"""Yield changes received from RCstream.
 
 @param wikihost: the hostname of the wiki we want to get changes for. This
  is passed to rcstream using a 'subscribe' command. Pass
@@ -195,7 +195,7 @@
 
 
 def site_rc_listener(site, total=None):
-"""RC Changes Generator. Yields changes received from RCstream.
+"""Yield changes received from RCstream.
 
 @param site: the Pywikibot.Site object to yield live recent changes for
 @type site: Pywikibot.BaseSite
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index c30669e..eac28be 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -141,7 +141,7 @@
 
 
 def CSVReader(fileobj, urlcolumn, site=None, *args, **kwargs):
-"""CSV reader."""
+"""Yield Photo objects for each row of a CSV file."""
 reader = csv.DictReader(fileobj, *args, **kwargs)
 for line in reader:
 yield Photo(line[urlcolumn], line, site=site)
diff --git a/scripts/featured.py b/scripts/featured.py
index 9e534b7..cef48d7 100755
--- a/scripts/featured.py
+++ b/scripts/featured.py
@@ -541,7 +541,7 @@
 def add_template(self, source, dest, task, fromsite):
 """Place or remove the Link_GA/FA template on/from a page."""
 def compile_link(site, templates):
-"""compile one link template list."""
+"""Compile one link template list."""
 findtemplate = '(%s)' % '|'.join(templates)
 return re.compile(r"\{\{%s\|%s\}\}"
   % (findtemplate.replace(u' ', u'[ _]'),
diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
index 788f993..9cbed4f 100755
--- a/scripts/replicate_wiki.py
+++ b/scripts/replicate_wiki.py
@@ -56,7 +56,7 @@
 
 @deprecated('BaseSite.namespaces')
 def namespaces(site):
-"""dict from namespace number to prefix."""
+"""Return a dictionary from namespace number to prefix."""
 return dict((n.id, n.custom_name) for n in site.namespaces)
 
 
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index 811dfe2..a5779e8 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -194,7 +194,7 @@
 
 
 def unpatch():
-"""un-patch standard terminal files."""
+"""Un-patch standard terminal files."""
 ui._print = org_print
     ui._raw_input = org_input
 

-- 
To view, visit https://gerrit.wikimedia.org/r/303371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08aea29e0db61ab930fb2fefd8f5d025f7d36f55
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Negative24 <jamison.loftho...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[2.0]: Stop reading 'cookieprefix' upon login

2016-08-06 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/303367

Change subject: Stop reading 'cookieprefix' upon login
..

Stop reading 'cookieprefix' upon login

We don't even use the cookies it tries to create, and cookieprefix is
being removed from MediaWiki, so this entire hunk of code is useless,
and has been removed.

Bug: T142155
Change-Id: I449e75870fa2cbcb50a55c2b05805a2c084e6913
(cherry picked from commit 6a848594df261ed18ab78a5e406265ca27476cb0)
---
M pywikibot/data/api.py
1 file changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/67/303367/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c2af5ea..44d7160 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2537,7 +2537,12 @@
 
 Parameters are all ignored.
 
-@return: cookie data if successful, None otherwise.
+Note, this doesn't actually return or do anything with cookies.
+The threadedhttp module takes care of all the cookie stuff,
+this just has a legacy name for now and should be renamed in the
+future.
+
+@return: empty string if successful, throws exception on failure
 
 """
 if hasattr(self, '_waituntil'):
@@ -2557,14 +2562,7 @@
 if u"login" not in login_result:
 raise RuntimeError("API login response does not have 'login' 
key.")
 if login_result['login']['result'] == "Success":
-prefix = login_result['login']['cookieprefix']
-cookies = []
-for key in ('Token', 'UserID', 'UserName'):
-cookies.append("%s%s=%s"
-   % (prefix, key,
-  login_result['login']['lg' + 
key.lower()]))
-self.username = login_result['login']['lgusername']
-return "\n".join(cookies)
+return ''
 elif login_result['login']['result'] == "NeedToken":
 token = login_result['login']['token']
 login_request["lgtoken"] = token

-- 
To view, visit https://gerrit.wikimedia.org/r/303367
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I449e75870fa2cbcb50a55c2b05805a2c084e6913
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: flake8 v3 is not stable

2016-07-25 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/301057

Change subject: flake8 v3 is not stable
..

flake8 v3 is not stable

Change-Id: I5e47fd359d06142242ac25ee018c7edc1dd9a703
---
M tox.ini
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/57/301057/1

diff --git a/tox.ini b/tox.ini
index 541b1cb..8916507 100644
--- a/tox.ini
+++ b/tox.ini
@@ -50,7 +50,7 @@
 flake8 --version
 flake8 --doctests {posargs}
 basepython = python2.7
-deps = flake8
+deps = flake8<3
pyflakes >= 1.1
hacking
flake8-docstrings>=0.2.6

-- 
To view, visit https://gerrit.wikimedia.org/r/301057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e47fd359d06142242ac25ee018c7edc1dd9a703
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[Pytest-commit] Issue #351: deps = {posargs} (hpk42/tox)

2016-07-23 Thread John Vandenberg
New issue 351: deps = {posargs}
https://bitbucket.org/hpk42/tox/issues/351/deps-posargs

John Vandenberg:

Sometimes it is useful to install a set of packages to alter the behaviour of a 
test run.

Two cases where I have thought this was useful was with `flake8-putty`, where I 
install sets of plugins to check my plugin with.

https://github.com/jayvdb/flake8-putty/blob/bac9533cc7fc7854c14657b35d8e07da99d5757f/tox.ini
(obviously I would need to change things a little, adding a new testenv for 
using {posargs} as requirements instead of as filenames.

The current case is `pyflakes`, where I want to install packages into the venv 
and then check their syntax.

For `deps = {posargs}`, each positional argument would need to be a complete 
requirement with environment marker, i.e. any spaces wrapped in `".. "`, and 
they would need to be added to the `deps` as a separate line for each argument.

`deps = {posargs}` currently crashes on

`tox.ConfigError: ConfigError: substitution key 'posargs' not found`



___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[pypy-issue] Issue #2350: Windows PyPy2 sys.stderr emitting \r\r\n line separators (pypy/pypy)

2016-07-21 Thread John Vandenberg
New issue 2350: Windows PyPy2 sys.stderr emitting \r\r\n line separators
https://bitbucket.org/pypy/pypy/issues/2350/windows-pypy2-sysstderr-emitting-r-r-n

John Vandenberg:

If a process prints a line to stderr, pypy replaces the newline with `\r\r\n`.

This happens with any of these approaches:
```
from __future__ import print_function
print('foo', file=sys.stderr)
sys.stderr.write('foo\n')
sys.stderr.writelines(['foo\n'])
```

This doesnt occur for stdout, which emits a normal windows line ending of 
`\r\n`.


___
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue


[MediaWiki-commits] [Gerrit] Revert "Deactivate removeUselessSpaces due to several bugs" - change (pywikibot/core)

2016-07-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299548

Change subject: Revert "Deactivate removeUselessSpaces due to several bugs"
..

Revert "Deactivate removeUselessSpaces due to several bugs"

This reverts commit 3ec08485811ac206456dea3c7b0a209ae0d7d7de.

Change-Id: I8cca2348001beede0641c8c19738aadad0c59b7c
---
M pywikibot/cosmetic_changes.py
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/48/299548/1

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 5848140..72b74d2 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -226,8 +226,7 @@
 self.replaceDeprecatedTemplates,
 # FIXME: fix bugs and re-enable
 # self.resolveHtmlEntities,
-# FIXME: fix bugs with nested templates and re-enable
-# self.removeUselessSpaces,
+self.removeUselessSpaces,
 self.removeNonBreakingSpaceBeforePercent,
 
 self.fixHtml,

-- 
To view, visit https://gerrit.wikimedia.org/r/299548
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cca2348001beede0641c8c19738aadad0c59b7c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix newline in three or more nested templates - change (pywikibot/core)

2016-07-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299541

Change subject: Fix newline in three or more nested templates
..

Fix newline in three or more nested templates

NESTED_TEMPLATE_REGEX uses .* without re.DOTALL,
so it fails to go into unhandled_depth mode when
a newline appears in the nested templates.

Change-Id: I91c27b657541abb5ebee061b0df34d4882d6f70a
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/41/299541/1

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 32f8fe9..d379203 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -99,7 +99,7 @@
 }}
 |
 (?P{{\s*[^{\|#0-9][^{\|#]*?\s* [^{]* {{ .* }})
-""", re.VERBOSE)
+""", re.VERBOSE | re.DOTALL)
 
 # The following regex supports wikilinks anywhere after the first pipe
 # and correctly matches the end of the file link if the wikilink contains
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 89093ac..103d848 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -637,6 +637,16 @@
 self.assertIsNotNone(m.group('unhandled_depth'))
 self.assertTrue(m.group(0).endswith('foo {{bar}}'))
 
+m = func('{{a|\n{{c|{{d|}} }}\n| foo  = bar }} foo {{bar}} baz')
+self.assertIsNotNone(m)
+self.assertIsNotNone(m.group(0))
+self.assertIsNone(m.group('name'))
+self.assertIsNone(m.group(1))
+self.assertIsNone(m.group('params'))
+self.assertIsNone(m.group(2))
+self.assertIsNotNone(m.group('unhandled_depth'))
+self.assertTrue(m.group(0).endswith('foo {{bar}}'))
+
 
 class TestGenericTemplateParams(PatchingTestCase):
 

-- 
To view, visit https://gerrit.wikimedia.org/r/299541
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91c27b657541abb5ebee061b0df34d4882d6f70a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Revert "[bugfix] fix tests for wikidata" - change (pywikibot/core)

2016-07-12 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/298452

Change subject: Revert "[bugfix] fix tests for wikidata"
..

Revert "[bugfix] fix tests for wikidata"

This reverts commit 8816913e4320dbac94c0d18926803ee8f5e8d44b.

Change-Id: Ib435c5c64a3744f43aef639364dfbbd3b6712b08
---
M tests/wikibase_tests.py
1 file changed, 0 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/52/298452/1

diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 6cfceaf..7b747e3 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1131,30 +1131,13 @@
 },
 }
 
-def test_own_repository(self, key):
-"""Test that a data repository family is its own repository."""
-site = self.get_site(key)
-self.assertEqual(site, site.data_repository())
-self.assertTrue(site.is_data_repository)
-
 def test_own_client(self, key):
 """Test that a data repository family can be its own client."""
 site = self.get_site(key)
-self.assertTrue(site.has_data_repository)
 
-def test_item_exists(self):
-"""Test that a ItemPage exists for wikidata:wikidata."""
-site = self.get_site('wikidata')
 page = pywikibot.Page(site, 'Wikidata:Main Page')
 item = pywikibot.ItemPage.fromPage(page)
 self.assertEqual(item.site, site)
-
-def test_item_not_exists(self):
-"""Test that a ItemPage does not exists for test:wikidata."""
-site = self.get_site('wikidatatest')
-page = pywikibot.Page(site, 'Wikidata:Main Page')
-with self.assertRaises(pywikibot.NoPage):
-pywikibot.ItemPage.fromPage(page)
 
 
 class TestUnconnectedClient(TestCase):

-- 
To view, visit https://gerrit.wikimedia.org/r/298452
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib435c5c64a3744f43aef639364dfbbd3b6712b08
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix travis global environment variables - change (pywikibot/core)

2016-07-05 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/297366

Change subject: Fix travis global environment variables
..

Fix travis global environment variables

Remove the secure variable, which is available in the Travis settings.

Change the syntax for TEST_TIMEOUT, as shippable can not understand
the existing a: b syntax

Change-Id: Id8162623647ea88c65bf6e2cd2bf5925e94b05bd
---
M .travis.yml
1 file changed, 1 insertion(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/66/297366/1

diff --git a/.travis.yml b/.travis.yml
index a0186ad..5dc947f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -121,12 +121,7 @@
 
 env:
   global:
-# This is the encrypted password for Wikimedia SUL user 'Pywikibot-test',
-# and is only decrypted by Travis when running builds of code merged into
-# the github repository 'wikimedia/pywikibot-core'.
-# See http://docs.travis-ci.com/user/encryption-keys/ for more information.
-- secure: 
kofInMlisiTBt9o/Ustc/vySlkKfxGzGCX2LwA1D2waym8sDTS0o5gMJ5LsrT/BUKwZbe1vLozPHqZrrkQvsdTml+DpZuotzdILs0m0f3BUoexEC6OON5IDljuxFyETrD1Ug44ih5Mc4lVFOdTcBzg501ZmswGwQrBvg/OyEFfE=
-- TEST_TIMEOUT: 300
+- TEST_TIMEOUT=300
 
   matrix:
 - LANGUAGE=en FAMILY=wikipedia PYWIKIBOT2_TEST_PROD_ONLY=1

-- 
To view, visit https://gerrit.wikimedia.org/r/297366
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8162623647ea88c65bf6e2cd2bf5925e94b05bd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix notifications building from JSON - change (pywikibot/core)

2016-07-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/297119

Change subject: Fix notifications building from JSON
..

Fix notifications building from JSON

Sometimes (like in welcome messages), notifications don't have a
'title' property, so we shouldn't assume there is one.

Bug: T139015
Change-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199
(cherry picked from commit d387ab236634f91186805dd114ee85455d1244f8)
---
M pywikibot/echo.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/19/297119/1

diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index 311827d..c42ddbb 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -27,8 +27,10 @@
 notif.category = data['category']
 notif.timestamp = 
pywikibot.Timestamp.fromtimestampformat(data['timestamp']['mw'])
 
-# TODO: use 'namespace-key' + 'text' ?
-notif.page = pywikibot.Page(site, data['title']['full'])
+if 'title' in data and 'full' in data['title']:
+notif.page = pywikibot.Page(site, data['title']['full'])
+else:
+notif.page = None
 
 if 'agent' in data and 'name' in data['agent']:
 notif.agent = pywikibot.User(site, data['agent']['name'])

-- 
To view, visit https://gerrit.wikimedia.org/r/297119
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: APerson <danielhg...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot: Store ImportError in imported variable - change (pywikibot/core)

2016-06-28 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296411

Change subject: pywikibot: Store ImportError in imported variable
..

pywikibot: Store ImportError in imported variable

If a lazy ImportError is to be handled, the ImportError
needs to be stored in a variable and then used when required.
Earlier, the imported variable was set to `None` and the
import error which was caught with `except` was used. But
this import error may not exist at a later time as python
guarantees it's existence only inside the `except` statement.
Hence, this is changed so that the ImportError is saved in the
variable that was being imported and checked later using
`isinstance(, ImportError)`.

Bug: T134336
Change-Id: I80f82e7f0674bfca70688f28640620dacac1d80b
(manually cherry picked from commit 65cabc8258aa807a754a62182ae51fbf7df45ddd)
---
M pywikibot/botirc.py
M pywikibot/diff.py
M scripts/flickrripper.py
3 files changed, 7 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/296411/1

diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py
index 77d258a..3294d76 100644
--- a/pywikibot/botirc.py
+++ b/pywikibot/botirc.py
@@ -25,13 +25,15 @@
 try:
 from ircbot import SingleServerIRCBot
 except ImportError as e:
+ircbot_import_error = e
+
 class SingleServerIRCBot(object):
 
 """Fake SingleServerIRCBot."""
 
 def __init__(*args, **kwargs):
 """Report import exception."""
-raise e
+raise ircbot_import_error
 
 
 _logger = "botirc"
diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 08f939e..ee41492 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -20,11 +20,6 @@
 else:
 from itertools import izip_longest as zip_longest
 
-try:
-from bs4 import BeautifulSoup
-except ImportError as bserror:
-BeautifulSoup = False
-
 import pywikibot
 from pywikibot.tools import chars
 
@@ -570,9 +565,7 @@
 @return: deleted and added list of contexts
 @rtype: dict
 """
-# check if BeautifulSoup imported
-if not BeautifulSoup:
-raise bserror  # should have been raised and stored earlier.
+from bs4 import BeautifulSoup
 
 comparands = {'deleted-context': [], 'added-context': []}
 soup = BeautifulSoup(compare_string)
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 38e97df..568b5f2 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -62,7 +62,7 @@
 try:
 from pywikibot.userinterfaces.gui import Tkdialog
 except ImportError as _tk_error:
-Tkdialog = None
+Tkdialog = _tk_error
 
 
 flickr_allowed_license = {
@@ -295,7 +295,7 @@
 override, addCategory,
 removeCategories)
 # pywikibot.output(photoDescription)
-if Tkdialog is not None and not autonomous:
+if not isinstance(Tkdialog, ImportError) and not autonomous:
 try:
 (newPhotoDescription, newFilename, skip) = Tkdialog(
 photoDescription, photo, filename).show_dialog()
@@ -305,7 +305,7 @@
 autonomous = True
 elif not autonomous:
 pywikibot.warning('Switching to autonomous mode because GUI 
interface cannot be used')
-pywikibot.warning(_tk_error)
+pywikibot.warning(Tkdialog)
 autonomous = True
 if autonomous:
 newPhotoDescription = photoDescription

-- 
To view, visit https://gerrit.wikimedia.org/r/296411
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80f82e7f0674bfca70688f28640620dacac1d80b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: AbdealiJK <abdealikoth...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use default tox pip install - change (pywikibot/core)

2016-06-28 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296410

Change subject: Use default tox pip install
..

Use default tox pip install

Removing options --process-dependency-links --pre on main testenv, which is 
effective on other testenvs and installs a pre-release of flake8 that is 
incompatible with flake-putty.

Bug: T138691
Change-Id: I0efc02ba536d88a503555fd4de30ad6b835dbbec
(cherry picked from commit 8c224e53e32ccaccc50549341e098a0ac31a6a46)
---
M tox.ini
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/10/296410/1

diff --git a/tox.ini b/tox.ini
index 3c525f1..7fc1161 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,7 +15,6 @@
 setenv = VIRTUAL_ENV={envdir}
 usedevelop = True
 commands = python setup.py test
-install_command = pip install --process-dependency-links --pre {opts} 
{packages}
 
 [testenv:flake8]
 commands = flake8 --ignore=D102,D103,D105,D211,E122,E127,E241,E402,E731 
{posargs}

-- 
To view, visit https://gerrit.wikimedia.org/r/296410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0efc02ba536d88a503555fd4de30ad6b835dbbec
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [DNM] Use released findx 0.9.9 - change (pywikibot/core)

2016-06-27 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296190

Change subject: [DNM] Use released findx 0.9.9
..

[DNM] Use released findx 0.9.9

(should fail)

Change-Id: I40158d4132689eeb909d990a64ff106f40e44810
---
M pwb.py
M tox.ini
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/90/296190/1

diff --git a/pwb.py b/pwb.py
index 88e40ee..03da726 100755
--- a/pwb.py
+++ b/pwb.py
@@ -26,6 +26,7 @@
 import os
 import sys
 import types
+import inspect
 
 from warnings import warn
 
diff --git a/tox.ini b/tox.ini
index bc027d7..98efc69 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,24 +25,24 @@
 deps = unittest2
 
 [testenv:pyflakes-py26]
-commands = ffind --ignore-vcs . '(?=1.0.2
+findx >= 0.9.9
 
 [testenv:pyflakes-py3]
 commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 
'user-config.py' : pyflakes
 basepython = python3
 deps =
-git+https://github.com/jayvdb/findx@exit_code
+findx >= 0.9.9
 pyflakes
 
 [testenv:pyflakes-pypy]
 commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 
'user-config.py' : pyflakes
 basepython = pypy
 deps =
-git+https://github.com/jayvdb/findx@exit_code
+findx >= 0.9.9
 pyflakes
 
 [testenv:flake8]

-- 
To view, visit https://gerrit.wikimedia.org/r/296190
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40158d4132689eeb909d990a64ff106f40e44810
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Jenkins testing using mwparserfromhell and bs4 - change (pywikibot/core)

2016-06-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296082

Change subject: Jenkins testing using mwparserfromhell and bs4
..

Jenkins testing using mwparserfromhell and bs4

Add mwparserfromhell and bs4 to the nose34 rule.

Change-Id: I1d6cabe3f5b58003b3ca922883548742e58d1685
---
M tox.ini
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/82/296082/1

diff --git a/tox.ini b/tox.ini
index bc027d7..64a7572 100644
--- a/tox.ini
+++ b/tox.ini
@@ -80,6 +80,8 @@
 nosetests --version
 nosetests --with-detecthttp -v -a '!net' tests
 deps =
+mwparserfromhell
+beautifulsoup4
 nose
 nose-detecthttp>=0.1.3
 six

-- 
To view, visit https://gerrit.wikimedia.org/r/296082
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d6cabe3f5b58003b3ca922883548742e58d1685
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use default tox pip install - change (pywikibot/core)

2016-06-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296079

Change subject: Use default tox pip install
..

Use default tox pip install

Removing options --process-dependency-links --pre

Change-Id: I0efc02ba536d88a503555fd4de30ad6b835dbbec
---
M tox.ini
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/79/296079/1

diff --git a/tox.ini b/tox.ini
index a7e3021..bc027d7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -20,7 +20,6 @@
 PYWIKIBOT2_NO_USER_CONFIG=2
 usedevelop = True
 commands = python setup.py test
-install_command = pip install --process-dependency-links --pre {opts} 
{packages}
 
 [testenv:py26]
 deps = unittest2

-- 
To view, visit https://gerrit.wikimedia.org/r/296079
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0efc02ba536d88a503555fd4de30ad6b835dbbec
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Show ffind version - change (pywikibot/core)

2016-06-17 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294907

Change subject: Show ffind version
..

Show ffind version

Change-Id: Iedfc0bf3a1a99d904aa3464a30eb6b2f594ed28d
---
M tox.ini
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/07/294907/1

diff --git a/tox.ini b/tox.ini
index 319e354..c281b5e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -26,21 +26,27 @@
 deps = unittest2
 
 [testenv:pyflakes-py26]
-commands = ffind --ignore-vcs . '(?=1.0.2
 
 [testenv:pyflakes-py3]
-commands = ffind --ignore-vcs . '(?=1.0.2
 
 [testenv:pyflakes-pypy]
-commands = ffind --ignore-vcs . '(?https://gerrit.wikimedia.org/r/294907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedfc0bf3a1a99d904aa3464a30eb6b2f594ed28d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add apt packages - change (pywikibot/core)

2016-06-02 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/292338

Change subject: Add apt packages
..

Add apt packages

Add trusty+sid job as precise does not have
many packages such as python-unicodecsv, and
precise+sid does not allow apt additions of
python packages, as they drag in many other
dependencies and the apt-get install fails.

Package versions added:
- bs4
- future
- pycountry
- stdnum 0.6
- unicodecsv
- unittest2

Bug: T136807
Bug: T136808
Change-Id: Idb781e5af96f8d713511457cd18afd08c3091b83
---
M .travis.yml
M pywikibot/cosmetic_changes.py
M requirements.txt
M scripts/isbn.py
M tests/isbn_tests.py
5 files changed, 79 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/38/292338/1

diff --git a/.travis.yml b/.travis.yml
index a0186ad..272703c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -132,9 +132,10 @@
 - LANGUAGE=en FAMILY=wikipedia PYWIKIBOT2_TEST_PROD_ONLY=1
 - LANGUAGE=zh FAMILY=wikisource PYSETUP_TEST_EXTRAS=1 
PYWIKIBOT2_TEST_PROD_ONLY=1 PYWIKIBOT2_TEST_NO_RC=1
 
+# Note: 2.7_with_system_site_packages is equivalent to virtualenv: 
system_site_packages: true
 matrix:
   include:
-- python: '2.7_with_system_site_packages'  # equivalent to virtualenv: 
system_site_packages: true
+- python: '2.7_with_system_site_packages'
   env: LANGUAGE=he FAMILY=wikivoyage DIST=precise-sudo 
PYWIKIBOT2_TEST_NO_RC=1
   dist: precise
   sudo: required
@@ -144,7 +145,13 @@
 - djvulibre-bin
 - graphviz
 - liblua5.1-0-dev
+# python-bs4: diff broken
 - python-ipaddr
+- python-pycountry
+- python-six
+- python-stdnum
+- python-tz
+- python-unittest2
 - python: '2.7_with_system_site_packages'
   env: LANGUAGE=nb FAMILY=wikipedia DIST=trusty PYSETUP_TEST_EXTRAS=1
   dist: trusty
@@ -155,7 +162,34 @@
 - djvulibre-bin
 - graphviz
 - liblua5.1-0-dev
+- python-bs4
 - python-ipaddr
+- python-pycountry
+- python-six
+- python-stdnum
+- python-tz
+- python-unicodecsv
+- python-unittest2
+- python: '2.7_with_system_site_packages'
+  env: LANGUAGE=test FAMILY=wikipedia DIST=trusty+sid PYSETUP_TEST_EXTRAS=1
+  dist: trusty
+  sudo: required
+  addons:
+apt:
+  sources:
+- debian-sid
+  packages:
+- djvulibre-bin
+- liblua5.1-0-dev
+- python-bs4
+- python-ipaddr
+- python-future
+- python-pycountry
+- python-six
+- python-stdnum
+- python-tz
+- python-unicodecsv
+- python-unittest2
 - python: '2.7'
   env: LANGUAGE=en FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="en.wikipedia.beta.wmflabs.org"
 - python: '3.3'
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 6afa7b0..577bdc0 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -64,9 +64,23 @@
 from warnings import warn
 
 try:
-import stdnum.isbn as stdnum_isbn
+from stdnum import isbn as stdnum_isbn
+# 0.8 includes validate which raises useful exceptions
+try:
+from stdnum.exceptions import ValidationError as StdNumValidationError
+from stdnum.isbn import validate as stdnum_isbn_validate
+except ImportError:
+stdnum_isbn_validate = None
+StdNumValidationError = ValueError
+try:
+from stdnum.isbn import is_valid as stdnum_isbn_is_valid
+except ImportError:
+from stdnum.isbn import validate as stdnum_isbn_is_valid
 except ImportError:
 stdnum_isbn = None
+stdnum_isbn_validate = None
+stdnum_isbn_is_valid = None
+StdNumValidationError = None
 
 import pywikibot
 
@@ -159,8 +173,13 @@
 isbn = match.group('code')
 if stdnum_isbn:
 try:
-stdnum_isbn.validate(isbn)
-except stdnum_isbn.ValidationError as e:
+if stdnum_isbn_validate:
+stdnum_isbn_validate(isbn)
+else:
+if not stdnum_isbn_is_valid(isbn):
+raise StdNumValidationError(
+'ISBN {0} not valid'.format(isbn))
+except StdNumValidationError as e:
 if strict:
 raise
 pywikibot.log('ISBN "%s" validation error: %s' % (isbn, e))
diff --git a/requirements.txt b/requirements.txt
index 9b4400a..907bcec 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -45,7 +45,7 @@
 unicodecsv ; python_version < '3' and python_version >= '2.7'
 
 # cosmetic_changes and scripts/isbn
-python-stdnum
+python-stdnum>=0.2
 
 # GUI
 Pil

[MediaWiki-commits] [Gerrit] Update archived google.com URL - change (pywikibot/core)

2016-05-31 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291873

Change subject: Update archived google.com URL
..

Update archived google.com URL

web.archive.org previously returned /web//http://www.google.com/
as the archived URL for https://google.com
It is now returning /web//http://google.com/

Change-Id: Ia928748b650554e629531e04effab32d55cd08f6
---
M tests/weblib_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/291873/1

diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py
index 7e82081..43e3b79 100644
--- a/tests/weblib_tests.py
+++ b/tests/weblib_tests.py
@@ -50,7 +50,7 @@
 parsed = urlparse(archivedversion)
 self.assertIn(parsed.scheme, [u'http', u'https'])
 self.assertEqual(parsed.netloc, u'web.archive.org')
-self.assertTrue(parsed.path.strip('/').endswith('www.google.com'), 
parsed.path)
+self.assertTrue(parsed.path.strip('/').endswith('google.com'), 
parsed.path)
 
 def testInternetArchiveOlder(self):
 """Test Internet Archive for https://google.com as of June 2006."""
@@ -58,7 +58,7 @@
 parsed = urlparse(archivedversion)
 self.assertIn(parsed.scheme, [u'http', u'https'])
 self.assertEqual(parsed.netloc, u'web.archive.org')
-self.assertTrue(parsed.path.strip('/').endswith('www.google.com'), 
parsed.path)
+self.assertTrue(parsed.path.strip('/').endswith('google.com'), 
parsed.path)
 self.assertIn('200606', parsed.path)
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/291873
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia928748b650554e629531e04effab32d55cd08f6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] flake8-future-import 0.4.0 support - change (pywikibot/core)

2016-05-30 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291729

Change subject: flake8-future-import 0.4.0 support
..

flake8-future-import 0.4.0 support

flake8-future-import 0.4.0 introduces two new codes FI16 and FI17
for future features nested_scopes and generators that are mandatory
on Python 2.6, and thus have not been listed in each file.

These two, and FI12 (with_statement) can be deactivated by using
the flake8-future-import option min-version = 2.6.

Rather than forcing all devs to upgrade, also add the new
codes to the ignore list.

Change-Id: I71a05cec2077ab07190c2286107ad70f475daa71
---
M tox.ini
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/29/291729/1

diff --git a/tox.ini b/tox.ini
index eb77d65..dcee400 100644
--- a/tox.ini
+++ b/tox.ini
@@ -126,8 +126,10 @@
 # E402: module level import not at top of file; see T87409
 # H201: Except: format
 # P102,P103: string does contain unindexed parameters; see I36355923
-ignore = 
E402,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H236,H301,H404,H405,I100,I101
+ignore = 
E402,D105,D211,FI10,FI13,FI15,FI5,H101,H201,H236,H301,H404,H405,I100,I101
+#ignore = 
E402,D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H201,H236,H301,H404,H405,I100,I101
 exclude = 
.tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
+min-version = 2.6
 max_line_length = 100
 accept-encodings = utf-8
 require-code = true

-- 
To view, visit https://gerrit.wikimedia.org/r/291729
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71a05cec2077ab07190c2286107ad70f475daa71
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix flow tests - change (pywikibot/core)

2016-05-30 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291713

Change subject: Fix flow tests
..

Fix flow tests

mediawiki 'Talk:Sandbox' was moved to 'Project talk:Sandbox/Flow test'
and the current revision now has a parent_id.

Change-Id: Icf3c5fc1e5d2fe7e4706b9e113ad660cff3b1c1d
---
M tests/flow_tests.py
1 file changed, 16 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/13/291713/1

diff --git a/tests/flow_tests.py b/tests/flow_tests.py
index cf76536..fc24841 100644
--- a/tests/flow_tests.py
+++ b/tests/flow_tests.py
@@ -22,24 +22,30 @@
 )
 
 
-class TestBoardBasePageMethods(BasePageMethodsTestBase):
+class TestMediaWikiFlowSandbox(TestCase):
 
-"""Test Flow board pages using BasePage-defined methods."""
+"""Test the Flow sandbox on MediaWiki.org."""
 
 family = 'mediawiki'
 code = 'mediawiki'
 
 def setUp(self):
 """Set up unit test."""
-self._page = Board(self.site, 'Talk:Sandbox')
-super(TestBoardBasePageMethods, self).setUp()
+self._page = Board(self.site, 'Project_talk:Sandbox/Flow test')
+super(TestMediaWikiFlowSandbox, self).setUp()
+
+
+class TestBoardBasePageMethods(BasePageMethodsTestBase,
+   TestMediaWikiFlowSandbox):
+
+"""Test Flow board pages using BasePage-defined methods."""
 
 def test_basepage_methods(self):
 """Test basic Page methods on a Flow board page."""
 self._test_invoke()
 self._test_return_datatypes()
 self.assertFalse(self._page.isRedirectPage())
-self.assertEqual(self._page.latest_revision.parent_id, 0)
+self.assertGreater(self._page.latest_revision.parent_id, 0)
 
 def test_content_model(self):
 """Test Flow page content model."""
@@ -70,17 +76,10 @@
 self.assertEqual(self._page.content_model, 'flow-board')
 
 
-class TestLoadRevisionsCaching(BasePageLoadRevisionsCachingTestBase):
+class TestLoadRevisionsCaching(BasePageLoadRevisionsCachingTestBase,
+   TestMediaWikiFlowSandbox):
 
 """Test site.loadrevisions() caching."""
-
-family = 'mediawiki'
-code = 'mediawiki'
-
-def setUp(self):
-"""Set up unit test."""
-self._page = Board(self.site, 'Talk:Sandbox')
-super(TestLoadRevisionsCaching, self).setUp()
 
 def test_page_text(self):
 """Test site.loadrevisions() with Page.text."""
@@ -88,18 +87,15 @@
 self._test_page_text()
 
 
-class TestFlowLoading(TestCase):
+class TestFlowLoading(TestMediaWikiFlowSandbox):
 
 """Test loading of Flow objects from the API."""
-
-family = 'mediawiki'
-code = 'mediawiki'
 
 cached = True
 
 def test_board_uuid(self):
 """Test retrieval of Flow board UUID."""
-board = Board(self.site, 'Talk:Sandbox')
+board = self._page
 self.assertEqual(board.uuid, 'rl7iby6wgksbpfno')
 
 def test_topic_uuid(self):
@@ -150,7 +146,7 @@
 
 def test_topiclist(self):
 """Test loading of topiclist."""
-board = Board(self.site, 'Talk:Sandbox')
+board = self._page
 i = 0
     for topic in board.topics(limit=7):
 i += 1

-- 
To view, visit https://gerrit.wikimedia.org/r/291713
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf3c5fc1e5d2fe7e4706b9e113ad660cff3b1c1d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[pypy-issue] Issue #2314: RuntimeError: maximum recursion depth exceeded when altering sys.path with PYTHONIOENCODING set (pypy/pypy)

2016-05-29 Thread John Vandenberg
New issue 2314: RuntimeError: maximum recursion depth exceeded when altering 
sys.path with PYTHONIOENCODING set
https://bitbucket.org/pypy/pypy/issues/2314/runtimeerror-maximum-recursion-depth

John Vandenberg:

With the sample script below, it works if PYTHONIOENCODING is not used, but 
fails when it is set with RuntimeError on v2.4.0-v5.1.1.

```python
# -*- coding: utf-8  -*-
u"""Foobar."""

import sys

sys.path = (u'.', ) + tuple(sys.path[1:])

def help():
print(__doc__)

if __name__ == '__main__':
help()
```

Sample code here: 
https://github.com/jayvdb/my-ci-test/tree/8abaffadb50abb95fe256a87a5443cba08bcb4c3

Test results here: https://travis-ci.org/jayvdb/my-ci-test/builds/133756245

```bash
$ python pwb.py
Foobar.
$ PYTHONIOENCODING=UTF8 python pwb.py
RuntimeError: maximum recursion depth exceeded
```

Removing use of `__doc__` or alteration of `sys.path` 'fixes' the problem.


___
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue


[MediaWiki-commits] [Gerrit] Use specific varied versions of Python - change (pywikibot/core)

2016-05-28 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291578

Change subject: Use specific varied versions of Python
..

Use specific varied versions of Python

Record the patch level of the Travis defaults,
and use the recently added capability of Travis
to install other versions on demand where possible.

Not available via Travis python versions:
- any other 2.6 except 2.6.9
- 2.7.0-2,4,5,7
- 3.3.0-2
- 3.4.0-1

Use pyenv to install 2.6.6 and 3.4.0

Change-Id: Ie87587dd8a841c9adeb9f74e35876bb3259fa89c
---
M .travis.yml
1 file changed, 28 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/78/291578/1

diff --git a/.travis.yml b/.travis.yml
index a0186ad..0348bc9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,11 +5,13 @@
 sudo: false
 
 python:
-  - '2.7'
-  - '3.3'
-  - '3.4'
-  - '3.5'
-  - '2.6'
+  # Python minor versions pre-installed by Travis, with default patch level
+  - '2.7.9'
+  - '3.3.5'
+  - '3.4.2'
+  - '2.6.9'
+  # Installed on demand
+  - '3.5.1'
 
 # OSX builds do not yet support Python
 os: linux
@@ -24,6 +26,14 @@
   - liblua5.1-0-dev
 
 before_install:
+  # Use pyenv to install versions specified by $PYENV_VERSION
+  - |
+git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
+$PYENV_ROOT/bin/pyenv install --skip-existing "$PYENV_VERSION"
+virtualenv --python="$PYENV_ROOT/versions/$PYENV_VERSION/bin/python" 
"$HOME/virtualenvs/$PYENV_VERSION"
+source "$HOME/virtualenvs/$PYENV_VERSION/bin/activate"
+python --version
+
   # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the
   # default 'install' step to install all dependencies listed in
   # requirements.txt to verify that a minimal install works as expected.
@@ -126,7 +136,8 @@
 # the github repository 'wikimedia/pywikibot-core'.
 # See http://docs.travis-ci.com/user/encryption-keys/ for more information.
 - secure: 
kofInMlisiTBt9o/Ustc/vySlkKfxGzGCX2LwA1D2waym8sDTS0o5gMJ5LsrT/BUKwZbe1vLozPHqZrrkQvsdTml+DpZuotzdILs0m0f3BUoexEC6OON5IDljuxFyETrD1Ug44ih5Mc4lVFOdTcBzg501ZmswGwQrBvg/OyEFfE=
-- TEST_TIMEOUT: 300
+- TEST_TIMEOUT=300
+- PYENV_ROOT=$HOME/.pyenv
 
   matrix:
 - LANGUAGE=en FAMILY=wikipedia PYWIKIBOT2_TEST_PROD_ONLY=1
@@ -134,6 +145,7 @@
 
 matrix:
   include:
+# precise uses 2.7.3
 - python: '2.7_with_system_site_packages'  # equivalent to virtualenv: 
system_site_packages: true
   env: LANGUAGE=he FAMILY=wikivoyage DIST=precise-sudo 
PYWIKIBOT2_TEST_NO_RC=1
   dist: precise
@@ -145,6 +157,7 @@
 - graphviz
 - liblua5.1-0-dev
 - python-ipaddr
+  # trusty uses 2.7.6
 - python: '2.7_with_system_site_packages'
   env: LANGUAGE=nb FAMILY=wikipedia DIST=trusty PYSETUP_TEST_EXTRAS=1
   dist: trusty
@@ -156,24 +169,24 @@
 - graphviz
 - liblua5.1-0-dev
 - python-ipaddr
-- python: '2.7'
+- python: '2.7.8'
   env: LANGUAGE=en FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="en.wikipedia.beta.wmflabs.org"
-- python: '3.3'
+- python: '3.3.3'
   env: LANGUAGE=zh FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="zh.wikipedia.beta.wmflabs.org"
 - python: '3.4'
-  env: LANGUAGE=en FAMILY=wsbeta SITE_ONLY=1
-- python: '2.7'
+  env: LANGUAGE=en FAMILY=wsbeta SITE_ONLY=1 PYENV_VERSION=3.4.0 
PYSETUP_TEST_EXTRAS=1
+- python: '2.7.11'
   env: LANGUAGE=wikia FAMILY=wikia PYWIKIBOT2_TEST_NO_RC=1
-- python: '3.3'
+- python: '3.3.6'
   env: LANGUAGE=en FAMILY=musicbrainz SITE_ONLY=1
-- python: '3.4'
+- python: '3.4.4'
   env: LANGUAGE=test FAMILY=wikipedia SITE_ONLY=1 
OAUTH_DOMAIN="test.wikipedia.org"
-- python: '3.4'
+- python: '3.4.3'
   env: LANGUAGE=test FAMILY=wikidata SITE_ONLY=1
-- python: '3.4'
+- python: '3.5.0'
   env: LANGUAGE=ar FAMILY=wiktionary PYWIKIBOT2_TEST_NO_RC=1
 - python: '2.6'
-  env: LANGUAGE=wikidata FAMILY=wikidata SITE_ONLY=1
+  env: LANGUAGE=wikidata FAMILY=wikidata SITE_ONLY=1 PYENV_VERSION=2.6.6 
PYSETUP_TEST_EXTRAS=1
 
 notifications:
   email:

-- 
To view, visit https://gerrit.wikimedia.org/r/291578
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie87587dd8a841c9adeb9f74e35876bb3259fa89c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Adjust recent added tests for case-sensitive site - change (pywikibot/core)

2016-05-28 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291577

Change subject: Adjust recent added tests for case-sensitive site
..

Adjust recent added tests for case-sensitive site

2230213 caused new errors on the Travis wiktionary jobs.

Also fix non-pep8 method names.

Bug: T134676
Change-Id: I4eabed2fb7ebeaf1516bb1f80c00a50050efb51c
---
M tests/textlib_tests.py
1 file changed, 25 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/77/291577/1

diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index e4dbc57..06d72ae 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1353,44 +1353,60 @@
 
 dry = True
 
-def test_noMatch(self):
+@classmethod
+def setUpClass(cls):
+"""Cache namespace 0 case sensitivity."""
+super(TestMultiTemplateMatchBuilder, cls).setUpClass()
+cls._ns0_not_case_sensitive = (
+cls.get_site().namespaces[0].case != 'case-sensitive')
+
+def test_no_match(self):
 """Test text without any desired templates."""
 string = 'The quick brown fox'
 builder = _MultiTemplateMatchBuilder(self.site)
 self.assertIsNone(re.search(builder.pattern('quick'), string))
 
-def test_Match(self):
+def test_match(self):
 """Test text with one match without parameters."""
 string = 'The {{quick}} brown fox'
 builder = _MultiTemplateMatchBuilder(self.site)
 self.assertIsNotNone(re.search(builder.pattern('quick'), string))
-self.assertIsNotNone(re.search(builder.pattern('Quick'), string))
+self.assertEqual(bool(re.search(builder.pattern('Quick'), string)),
+ self._ns0_not_case_sensitive)
 
 def test_match_with_params(self):
 """Test text with one match with parameters."""
-string = 'The {{Quick|brown}} fox'
+string = 'The {{quick|brown}} fox'
 builder = _MultiTemplateMatchBuilder(self.site)
 self.assertIsNotNone(re.search(builder.pattern('quick'), string))
-self.assertIsNotNone(re.search(builder.pattern('Quick'), string))
+self.assertEqual(bool(re.search(builder.pattern('Quick'), string)),
+ self._ns0_not_case_sensitive)
 
 def test_match_msg(self):
 """Test text with {{msg:..}}."""
 string = 'The {{msg:quick}} brown fox'
 builder = _MultiTemplateMatchBuilder(self.site)
 self.assertIsNotNone(re.search(builder.pattern('quick'), string))
-self.assertIsNotNone(re.search(builder.pattern('Quick'), string))
+self.assertEqual(bool(re.search(builder.pattern('Quick'), string)),
+ self._ns0_not_case_sensitive)
 
 def test_match_template_prefix(self):
 """Test pages with {{template:..}}."""
 string = 'The {{%s:%s}} brown fox'
 template = 'template'
 builder = _MultiTemplateMatchBuilder(self.site)
+if self._ns0_not_case_sensitive:
+quick_list = ('quick', 'Quick')
+else:
+quick_list = ('quick', )
+
 for t in (template.upper(), template.lower(), template.title()):
-for q in ('quick', 'Quick'):
+for q in quick_list:
 self.assertIsNotNone(re.search(builder.pattern('quick'),
string % (t, q)))
-self.assertIsNotNone(re.search(builder.pattern('Quick'),
-   string % (t, q)))
+self.assertEqual(bool(re.search(builder.pattern('Quick'),
+string % (t, q))),
+ self._ns0_not_case_sensitive)
 
 
 class TestGetLanguageLinks(SiteAttributeTestCase):

-- 
To view, visit https://gerrit.wikimedia.org/r/291577
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4eabed2fb7ebeaf1516bb1f80c00a50050efb51c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Clear exceptions in BaseBot.run before processing - change (pywikibot/core)

2016-05-28 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291523

Change subject: Clear exceptions in BaseBot.run before processing
..

Clear exceptions in BaseBot.run before processing

Bot classes use sys.exc_info, which can be a stale exception
under Python 2.

Bug: T136487
Change-Id: I01311cf9071ab45cb38bc5463153e887a76c5138
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/23/291523/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 7dbb8ef..378f2b2 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1414,6 +1414,10 @@
 if PY2:
 maxint = sys.maxint
 
+# Python 2 does not clear previous exceptions and method `exit`
+# relies on sys.exc_info returning exceptions occurring in `run`.
+sys.exc_clear()
+
 try:
 for page in self.generator:
 try:

-- 
To view, visit https://gerrit.wikimedia.org/r/291523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01311cf9071ab45cb38bc5463153e887a76c5138
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add asteroids that are being used as locations - change (pywikibot/core)

2016-05-27 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291199

Change subject: Add asteroids that are being used as locations
..

Add asteroids that are being used as locations

Used as globes for other items on Wikidata.
Source:

SELECT (count(?item) as ?c) ?globe ?globeLabel
WHERE
{
  ?item wdt:P376 ?globe .
  ?item wdt:P625 ?location .
  SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
  }
}
GROUP BY ?globe ?globeLabel
ORDER BY DESC(?c)


Change-Id: I049866d40d8ad4903f2445b6bf1fdf8a164202a3
(cherry picked from commit 9192099fb51570251e440e0be39959b0c8c7c465)
---
M pywikibot/families/wikidata_family.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/99/291199/1

diff --git a/pywikibot/families/wikidata_family.py 
b/pywikibot/families/wikidata_family.py
index 4340f3a..13f5546 100644
--- a/pywikibot/families/wikidata_family.py
+++ b/pywikibot/families/wikidata_family.py
@@ -56,12 +56,15 @@
 'dione': 'http://www.wikidata.org/entity/Q15040',
 'earth': 'http://www.wikidata.org/entity/Q2',
 'enceladus': 'http://www.wikidata.org/entity/Q3303',
+'eros': 'http://www.wikidata.org/entity/Q16711',
 'europa': 'http://www.wikidata.org/entity/Q3143',
 'ganymede': 'http://www.wikidata.org/entity/Q3169',
+'gaspra': 'http://www.wikidata.org/entity/Q158244',
 'hyperion': 'http://www.wikidata.org/entity/Q15037',
 'iapetus': 'http://www.wikidata.org/entity/Q17958',
 'io': 'http://www.wikidata.org/entity/Q3123',
 'jupiter': 'http://www.wikidata.org/entity/Q319',
+'lutetia': 'http://www.wikidata.org/entity/Q107556',
 'mars': 'http://www.wikidata.org/entity/Q111',
 'mercury': 'http://www.wikidata.org/entity/Q308',
 'mimas': 'http://www.wikidata.org/entity/Q15034',

-- 
To view, visit https://gerrit.wikimedia.org/r/291199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I049866d40d8ad4903f2445b6bf1fdf8a164202a3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add PyPy builds - change (pywikibot/core)

2016-05-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291155

Change subject: Add PyPy builds
..

Add PyPy builds

- unicodedata2 and lunatic-python are not PyPy compatible

Change-Id: Ide8bcef49499d7f3bb7bcbf00bde3d42936e5672
---
M .travis.yml
M pywikibot/__init__.py
M requirements.txt
M setup.py
M tests/api_tests.py
M tests/bot_tests.py
M tests/i18n_tests.py
M tests/pwb_tests.py
M tests/script_tests.py
M tests/tools_tests.py
M tox.ini
11 files changed, 156 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/55/291155/1

diff --git a/.travis.yml b/.travis.yml
index a0186ad..332e6a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,7 @@
 sudo: false
 
 python:
+  - 'pypy'
   - '2.7'
   - '3.3'
   - '3.4'
@@ -30,10 +31,27 @@
   # Instead install requests in the before_script step below.
   - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then rm requirements.txt ; fi
 
+  # PyPy `pwb` based tests fail under plain unittest, but work under pytest
+  - if [[ "$TRAVIS_PYTHON_VERSION" = "pypy" ]]; then USE_PYTEST=1; fi
+
   # When the env variable USE_NOSE or USE_PYTEST is set, the appropriate
   # tool is used, else PYTEST is taken as the default
-  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' && "$USE_NOSE" != '1' && "$USE_PYTEST" 
!= '1' ]]; then
-  export USE_PYTEST=1 ;
+  - |
+if [[ "$USE_NOSE" != '1' && "$USE_PYTEST" != '1' ]]; then
+  if [[ "$NO_NET" == '1' ]]; then
+export USE_PYTEST=1
+  elif [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then
+export USE_PYTEST=1
+  fi
+fi
+
+  - if [[ -z "$FAMILY" ]]; then FAMILY=test; fi
+  - if [[ -z "$LANGUAGE" ]]; then LANGUAGE=test; fi
+
+  - |
+if [[ "$NO_NET" == '1' ]]; then
+  echo "Running no tests requiring network access"
+  echo "(however generate_family_file uses network)"
 fi
 
   - if [[ "$SITE_ONLY" == '1' ]]; then
@@ -48,12 +66,29 @@
   export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
 fi
 
+  # Set the default pypy version to be 2.6.1
+  - if [[ "$PYPY_VERSION" != '' ]]; then PYPY_VERSION=2.6.1; fi
+
+  - |  # Based on Vlad Frolov's MIT licensed 
https://github.com/travis-ci/travis-ci/issues/5027#issuecomment-170939193
+if [[ "$TRAVIS_PYTHON_VERSION" = "pypy" && "$PYPY_VERSION" != 'default' 
]]; then
+  export PYENV_ROOT="$HOME/.pyenv"
+  if [[ -f "$PYENV_ROOT/bin/pyenv" ]]; then
+pushd "$PYENV_ROOT" && git pull && popd
+  else
+rm -rf "$PYENV_ROOT" && git clone --depth 1 
https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
+  fi
+  "$PYENV_ROOT/bin/pyenv" install --skip-existing "pypy-$PYPY_VERSION"
+  virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" 
"$HOME/virtualenvs/pypy-$PYPY_VERSION"
+  source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate"
+  python --version
+fi
+
 before_script:
   - pip install -r dev-requirements.txt
 
 script:
   # Install security packages for requests to support HTTPS in site_detect
-  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then
+  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' && "$NO_NET" != '1' ]]; then
   pip install mwoauth -r requests-requirements.txt ;
 fi
 
@@ -100,12 +135,17 @@
   nosetests --version ;
   if [[ "$SITE_ONLY" == "1" ]]; then
 python setup.py nosetests --tests tests --verbosity=2 -a 
"family=$FAMILY,code=$LANGUAGE" --with-trim --with-coverage --cover-package=. ;
+  elif [[ "$NO_NET" == "1" ]]; then
+python setup.py nosetests --tests tests --verbosity=2 -a "!net" 
--with-trim --with-coverage --cover-package=. ;
   else
 python setup.py nosetests --tests tests --verbosity=2 --with-trim 
--with-coverage --cover-package=. ;
   fi ;
 elif [[ "$USE_PYTEST" == "1" ]]; then
+  py.test --version ;
   if [[ "$SITE_ONLY" == "1" ]]; then
 python setup.py pytest --addopts="-vvv -s --timeout=$TEST_TIMEOUT 
--cov=. -a \"family=='$FAMILY' and code=='$LANGUAGE'\"" ;
+  elif [[ "$NO_NET" == "1" ]]; then
+python setup.py pytest --addopts="-vvv -s --timeout=$TEST_TIMEOUT 
--cov=. -a \"not net\"" ;
   else
 python setup.py pytest --addopts="-vvv -s --timeout=$TEST_TIMEOUT 
--cov=." ;
   fi
@@ -134,6 +174,14 @@
 
 matrix:
   include:
+# Test the Ubuntu precise pypy (2.5) without network
+- python:

[MediaWiki-commits] [Gerrit] [bugfix] Fix test_translateMagicWords test - change (pywikibot/core)

2016-05-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290927

Change subject: [bugfix] Fix test_translateMagicWords test
..

[bugfix] Fix test_translateMagicWords test

Bug: T132557
Change-Id: Ia845114619a40e639abdc415e37b793a1024f508
(cherry picked from commit 585a0d6d884cd5ec76f1969d2e6e40755c17b757)
---
M tests/cosmetic_changes_tests.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/27/290927/1

diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index f864c76..8d28a3c 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8  -*-
 """Test cosmetic_changes module."""
 #
-# (C) Pywikibot team, 2015
+# (C) Pywikibot team, 2015-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -45,11 +45,11 @@
 def test_translateMagicWords(self):
 """Test translateMagicWords method."""
 self.assertEqual(
-'[[File:Foo.bar|mini]]',
+'[[File:Foo.bar|miniatur]]',
 self.cct.translateMagicWords('[[File:Foo.bar|thumb]]'))
 self.assertEqual(
-'[[File:Foo.bar|mini]]',
-self.cct.translateMagicWords('[[File:Foo.bar|miniatur]]'))
+'[[File:Foo.bar|miniatur]]',
+self.cct.translateMagicWords('[[File:Foo.bar|mini]]'))
 
 def test_cleanUpLinks_pipes(self):
 """Test cleanUpLinks method."""

-- 
To view, visit https://gerrit.wikimedia.org/r/290927
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia845114619a40e639abdc415e37b793a1024f508
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix ID for Rhea - change (pywikibot/core)

2016-05-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290926

Change subject: Fix ID for Rhea
..

Fix ID for Rhea

Q108419 is the wrong Rhea - this is the female Titan,
Q15050 is the moon of Saturn

Change-Id: I1d15e017e1216c8c25af199da01d70be4c13478a
(cherry picked from commit 21570f1f25b2a390ee32b804b85971fa04cc0001)
---
M pywikibot/families/wikidata_family.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/26/290926/1

diff --git a/pywikibot/families/wikidata_family.py 
b/pywikibot/families/wikidata_family.py
index 181c4c4..4340f3a 100644
--- a/pywikibot/families/wikidata_family.py
+++ b/pywikibot/families/wikidata_family.py
@@ -71,7 +71,7 @@
 'phobos': 'http://www.wikidata.org/entity/Q7547',
 'phoebe': 'http://www.wikidata.org/entity/Q17975',
 'pluto': 'http://www.wikidata.org/entity/Q339',
-'rhea': 'http://www.wikidata.org/entity/Q108419',
+'rhea': 'http://www.wikidata.org/entity/Q15050',
 'tethys': 'http://www.wikidata.org/entity/Q15047',
 'titan': 'http://www.wikidata.org/entity/Q2565',
 'titania': 'http://www.wikidata.org/entity/Q3322',

-- 
To view, visit https://gerrit.wikimedia.org/r/290926
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d15e017e1216c8c25af199da01d70be4c13478a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add .coveragerc and codecov.yml - change (pywikibot/core)

2016-05-25 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290705

Change subject: Add .coveragerc and codecov.yml
..

Add .coveragerc and codecov.yml

Do not cover __main__ block in tests/ as they exists only
to allow tests to be invoked without a test runner.
Also ignore some test option code in tests/__init__.py

Change-Id: Iec6260e4d44713f0cbb0fa5dd8eacc7aa8de6c4d
---
A .codecov.yml
A .coveragerc
M tests/add_text_tests.py
M tests/api_tests.py
M tests/archivebot_tests.py
M tests/basepage_tests.py
M tests/bot_tests.py
M tests/cache_tests.py
M tests/category_bot_tests.py
M tests/category_tests.py
M tests/checkimages_tests.py
M tests/cosmetic_changes_tests.py
M tests/data_ingestion_tests.py
M tests/date_tests.py
M tests/deletionbot_tests.py
M tests/deprecation_tests.py
M tests/diff_tests.py
M tests/disambredir_tests.py
M tests/djvu_tests.py
M tests/dry_api_tests.py
M tests/dry_site_tests.py
M tests/edit_failure_tests.py
M tests/edit_tests.py
M tests/exceptions_tests.py
M tests/family_tests.py
M tests/file_tests.py
M tests/fixes_tests.py
M tests/http_tests.py
M tests/i18n_tests.py
M tests/interwiki_graph_tests.py
M tests/interwiki_link_tests.py
M tests/interwikidata_tests.py
M tests/isbn_tests.py
M tests/l10n_tests.py
M tests/link_tests.py
M tests/logentry_tests.py
M tests/mediawikiversion_tests.py
M tests/namespace_tests.py
M tests/oauth_tests.py
M tests/page_tests.py
M tests/pagegenerators_tests.py
M tests/paraminfo_tests.py
M tests/patrolbot_tests.py
M tests/plural_tests.py
M tests/proofreadpage_tests.py
M tests/protectbot_tests.py
M tests/pwb_tests.py
M tests/python_tests.py
M tests/reflinks_tests.py
M tests/replacebot_tests.py
M tests/script_tests.py
M tests/site_detect_tests.py
M tests/site_tests.py
M tests/sparql_tests.py
M tests/template_bot_tests.py
M tests/tests_tests.py
M tests/textlib_tests.py
M tests/thread_tests.py
M tests/timestamp_tests.py
M tests/timestripper_tests.py
M tests/tk_tests.py
M tests/tools_chars_tests.py
M tests/tools_formatter_tests.py
M tests/tools_ip_tests.py
M tests/tools_tests.py
M tests/ui_options_tests.py
M tests/ui_tests.py
M tests/upload_tests.py
M tests/uploadbot_tests.py
M tests/user_tests.py
M tests/weblib_tests.py
M tests/weblinkchecker_tests.py
M tests/wikibase_edit_tests.py
M tests/wikibase_tests.py
M tests/wikidataquery_tests.py
M tests/wikistats_tests.py
M tests/xmlreader_tests.py
77 files changed, 112 insertions(+), 75 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/05/290705/1

diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 000..9602e90
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,29 @@
+codecov:
+  bot: jayvdb
+
+coverage:
+  status:
+project:
+  default:
+enabled: yes
+patch:
+  default:
+enabled: yes
+changes:
+  default:
+enabled: yes
+
+  ignore:
+- ez_setup.py
+- tests/*edit*.py
+- tests/*upload*.py
+
+  notify:
+irc:
+  default:
+server: chat.freenode.net
+channel: pywikibot
+
+gitter:
+  default:
+url: https://webhooks.gitter.im/e/f312b840da1c40d9f4be
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 000..cf272bf
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,8 @@
+[report]
+exclude_lines =
+if __debug__ and not PY2:  # pyflakes workaround
+
+# Have to re-enable the standard pragma
+pragma: no cover
+
+if .PYWIKIBOT_TEST_.*. in os.environ:
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index 9c90ef6..5430858 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -46,5 +46,5 @@
 newtext)
 
 
-if __name__ == "__main__":
+if __name__ == '__main__':  # pragma: no cover
 unittest.main()
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 3e3e61a..c236f68 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -1026,7 +1026,7 @@
 self.assertEqual(result, expect)
 self.assertIsInstance(result, str)
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
 try:
 unittest.main()
 except SystemExit:
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index bf07034..9ea2ab8 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -93,7 +93,7 @@
 # 'th': year is 2552 while regex assumes 19..|20.., might be fixed
 
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
 try:
 unittest.main()
 except SystemExit:
diff --git a/tests/basepage_tests.py b/tests/basepage_tests.py
index 8017671..3a1e66b 100644
--- a/tests/basepage_tests.py
+++ b/tests/basepage_tests.py
@@ -113,7 +113,7 @@
 self.assertFalse(self._page.isCategoryRedirect())
 self.assertTrue(self._page.botMayEdit())
 
-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cove

[MediaWiki-commits] [Gerrit] Use Python 3 compatible flake8-mock - change (pywikibot/core)

2016-05-25 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290655

Change subject: Use Python 3 compatible flake8-mock
..

Use Python 3 compatible flake8-mock

a57f1c introduced flake8-mock, however it fails to install on
Windows on Python 3, an issue I had raised a month ago.
(https://github.com/aleGpereira/flake8-mock/issues/3)

Change-Id: I167f13918671d93075b8920527704113e868a90d
---
M dev-requirements.txt
M tox.ini
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/55/290655/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index 44499a0..e8bab19 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -17,7 +17,7 @@
 pyflakes>=0.9
 flake8
 flake8-docstrings>=0.2.6
-flake8-mock
+git+https://github.com/jayvdb/flake8-mock@use-ascii-readme
 codecov
 coverage
 mock ; python_version < '3'
diff --git a/tox.ini b/tox.ini
index ea79390..d0052b8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -38,7 +38,7 @@
flake8-import-order
flake8-tuple>=0.2.8
flake8-print>=2.0.1
-   flake8-mock
+   git+https://github.com/jayvdb/flake8-mock@use-ascii-readme
 
 [testenv:flake8-py3]
 commands =

-- 
To view, visit https://gerrit.wikimedia.org/r/290655
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I167f13918671d93075b8920527704113e868a90d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [bugfix] pass User page object to NotEmailableError - change (pywikibot/core)

2016-05-25 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290638

Change subject: [bugfix] pass User page object to NotEmailableError
..

[bugfix] pass User page object to NotEmailableError

NotEmailableError is derived from PageRelatedError and
expect a page object as first parameter but got a string.

Bug: T135364
Change-Id: I5aad3aaa76802884b744f89a633d716e1aab5286
---
M pywikibot/page.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/38/290638/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index a9c7a4e..a78ed9a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2843,7 +2843,7 @@
 @rtype: bool
 """
 if not self.isEmailable():
-raise NotEmailableError('%s is not mailable' % self.username)
+raise NotEmailableError(self)
 
 if not self.site.has_right('sendemail'):
 raise UserRightsError('You don\'t have permission to send mail')

-- 
To view, visit https://gerrit.wikimedia.org/r/290638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5aad3aaa76802884b744f89a633d716e1aab5286
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Run codecov on CI job failure - change (pywikibot/core)

2016-05-22 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290147

Change subject: Run codecov on CI job failure
..

Run codecov on CI job failure

Bug: T74863
Change-Id: Ic18750859336034c77d5e8757f6bd9cb7b74bd3a
---
M .appveyor.yml
M .travis.yml
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/47/290147/1

diff --git a/.appveyor.yml b/.appveyor.yml
index 6e24d79..c7eff52 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -97,7 +97,10 @@
   - set PYSETUP_TEST_NO_UI=1
   - "%CMD_IN_ENV% coverage run setup.py test"
 
-after_test:
+on_failure:
+  - codecov
+
+on_success:
   - codecov
 
 artifacts:
diff --git a/.travis.yml b/.travis.yml
index fa8fef8..87954ee 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -115,6 +115,9 @@
 after_success:
 codecov
 
+after_failure:
+codecov
+
 env:
   global:
 # This is the encrypted password for Wikimedia SUL user 'Pywikibot-test',

-- 
To view, visit https://gerrit.wikimedia.org/r/290147
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic18750859336034c77d5e8757f6bd9cb7b74bd3a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Travis workaround for TLSv1.2 on precise container - change (pywikibot/core)

2016-05-22 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290146

Change subject: Travis workaround for TLSv1.2 on precise container
..

Travis workaround for TLSv1.2 on precise container

Use debian-sid libssl1.0.0 on Precise containers.
This debian sid package conflicts with Ubuntu packages
graphviz and python-ipaddr, so they are only added on
Trusty and Precise sudo builds.

requests[security] was added in requests 2.4.1 and
requests[security] added a pyOpenSSL>=0.13 dependency
in requests 2.9.0.

As precise-sudo has pyOpenSSL 0.12, and trusty has
requests 2.2.1, these both need to be upgraded by pip
otherwise they fail in setup.py which will not overwrite
distribution packaged libraries with newer versions.

Bug: T134647
Change-Id: Iabf344a417299214cdb92c5776cbe580cb6989e5
---
M .travis.yml
M requests-requirements.txt
M requirements.txt
3 files changed, 27 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/46/290146/1

diff --git a/.travis.yml b/.travis.yml
index fa8fef8..e089d78 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,11 +16,12 @@
 
 addons:
   apt:
+sources:
+  - debian-sid
 packages:
+  - libssl1.0.0
   - djvulibre-bin
-  - graphviz
   - liblua5.1-0-dev
-  - python-ipaddr
 
 before_install:
   # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the
@@ -131,11 +132,27 @@
 matrix:
   include:
 - python: '2.7_with_system_site_packages'  # equivalent to virtualenv: 
system_site_packages: true
-  env: LANGUAGE=he FAMILY=wikivoyage SITE_ONLY=1
-- python: '2.7'
+  env: LANGUAGE=he FAMILY=wikivoyage DIST=precise-sudo 
PYWIKIBOT2_TEST_NO_RC=1
+  dist: precise
+  sudo: required
+  addons:
+apt:
+  packages:
+- djvulibre-bin
+- graphviz
+- liblua5.1-0-dev
+- python-ipaddr
+- python: '2.7_with_system_site_packages'
   env: LANGUAGE=nb FAMILY=wikipedia DIST=trusty
   dist: trusty
   sudo: required
+  addons:
+apt:
+  packages:
+- djvulibre-bin
+- graphviz
+- liblua5.1-0-dev
+- python-ipaddr
 - python: '2.7'
   env: LANGUAGE=en FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="en.wikipedia.beta.wmflabs.org"
 - python: '3.3'
diff --git a/requests-requirements.txt b/requests-requirements.txt
index 778c9f6..4ad0a88 100644
--- a/requests-requirements.txt
+++ b/requests-requirements.txt
@@ -1,7 +1,7 @@
-requests
+requests>=2.4.1
 
 # requests security extra
 # Bug T105767 on Python 2.7 release 9+
-pyOpenSSL ; python_full_version < '2.7.9' or python_version >= '3'
+pyOpenSSL>=0.13 ; python_full_version < '2.7.9' or python_version >= '3'
 ndg-httpsclient ; python_full_version < '2.7.9' or python_version >= '3'
 pyasn1 ; python_full_version < '2.7.9' or python_version >= '3'
diff --git a/requirements.txt b/requirements.txt
index 3658030..9b4400a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,10 +19,10 @@
 # $ awk -F '[#>=]' '{print $1}' requirements.txt | xargs apt-cache search
 
 # mandatory; see README.conversion.txt
-requests
+requests>=2.4.1
 
 # requests security extra
-pyOpenSSL ; python_full_version < '2.7.9'
+pyOpenSSL>=0.13 ; python_full_version < '2.7.9'
 ndg-httpsclient ; python_full_version < '2.7.9'
 pyasn1 ; python_full_version < '2.7.9'
 
@@ -82,6 +82,8 @@
 
 # scripts/script_wui.py depends on Lua, which is not available using pip
 # but can be obtained from: https://github.com/bastibe/lunatic-python
+# However, a better fork is: https://github.com/AlereDevices/lunatic-python
+# Also script_wui.py is not currently functional, so it isnt installed here.
 
 # core HTML comparison parser in diff module
 beautifulsoup4

-- 
To view, visit https://gerrit.wikimedia.org/r/290146
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabf344a417299214cdb92c5776cbe580cb6989e5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Exclude branch 'nexqt' from Travis and Appveyor - change (pywikibot/core)

2016-05-22 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/290141

Change subject: Exclude branch 'nexqt' from Travis and Appveyor
..

Exclude branch 'nexqt' from Travis and Appveyor

Xqt is using 'nexqt' as a private branch on the Wikimedia
account, where he +2's his own changes, which adds lots of odd
results to the official Wikimedia pywikibot-core repository on
https://travis-ci.org, https://ci.appveyor.com and https://codecov.io

Developers can run builds under their own account,
as described in tests/README.rst.

Change-Id: I218378f85b5c4ccaaf432d1b3ff83a500738a871
---
M .appveyor.yml
M .travis.yml
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/41/290141/1

diff --git a/.appveyor.yml b/.appveyor.yml
index 6e24d79..f4e0f84 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -100,5 +100,9 @@
 after_test:
   - codecov
 
+branches:
+  except:
+- nexqt
+
 artifacts:
   - path: dist\*  .coverage coverage.xml
diff --git a/.travis.yml b/.travis.yml
index fa8fef8..eed13bc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -155,6 +155,10 @@
 - python: '2.6'
   env: LANGUAGE=wikidata FAMILY=wikidata SITE_ONLY=1
 
+branches:
+  except:
+- nexqt
+
 notifications:
   email:
 recipients:

-- 
To view, visit https://gerrit.wikimedia.org/r/290141
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I218378f85b5c4ccaaf432d1b3ff83a500738a871
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use flake8-mock and fix mock.assert_called_once - change (pywikibot/core)

2016-05-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289894

Change subject: Use flake8-mock and fix mock.assert_called_once
..

Use flake8-mock and fix mock.assert_called_once

assert_called_once doesnt do anything.
assert_called_once_with is the correct function name,
but it is best avoided by using call_count.

Also enable flake8-mock, which flags this as M001.

Change-Id: I9f6e0c5c2b0f41b5b6d4cef33dcc3829b8dc1e05
---
M dev-requirements.txt
M tests/diff_tests.py
M tox.ini
3 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/94/289894/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index baed441..44499a0 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -17,6 +17,7 @@
 pyflakes>=0.9
 flake8
 flake8-docstrings>=0.2.6
+flake8-mock
 codecov
 coverage
 mock ; python_version < '3'
diff --git a/tests/diff_tests.py b/tests/diff_tests.py
index 402ad74..b94911f 100644
--- a/tests/diff_tests.py
+++ b/tests/diff_tests.py
@@ -94,7 +94,7 @@
 
 
 @patch('{0}.__import__'.format('__builtin__' if PY2 else 'builtins'),
-   side_effect=ImportError)
+   side_effect=ImportError, autospec=True)
 class TestNoBeautifulSoup(TestCase):
 
 """Test functions when BeautifulSoup is not installes."""
@@ -104,7 +104,7 @@
 def test_html_comparator(self, mocked_import):
 """Test html_comparator when bs4 not installed."""
 self.assertRaises(ImportError, html_comparator, '')
-mocked_import.assert_called_once()
+self.assertEqual(mocked_import.call_count, 1)
 self.assertIn('bs4', mocked_import.call_args[0])
 
 
diff --git a/tox.ini b/tox.ini
index 040e501..ea79390 100644
--- a/tox.ini
+++ b/tox.ini
@@ -38,6 +38,7 @@
flake8-import-order
flake8-tuple>=0.2.8
flake8-print>=2.0.1
+   flake8-mock
 
 [testenv:flake8-py3]
 commands =

-- 
To view, visit https://gerrit.wikimedia.org/r/289894
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f6e0c5c2b0f41b5b6d4cef33dcc3829b8dc1e05
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add a trusty build - change (pywikibot/core)

2016-05-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289818

Change subject: Add a trusty build
..

Add a trusty build

Use ht.wikipedia as it is an ArticlePlaceholder trial site

Change-Id: Ic248ecb7fa28a0168bf5c90750cc107924ab8c75
---
M .travis.yml
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/18/289818/1

diff --git a/.travis.yml b/.travis.yml
index efd9c68..ebf6b6a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -126,6 +126,10 @@
 - python: '2.7_with_system_site_packages'  # equivalent to virtualenv: 
system_site_packages: true
   env: LANGUAGE=he FAMILY=wikivoyage SITE_ONLY=1
 - python: '2.7'
+  env: LANGUAGE=ht FAMILY=wikipedia DIST=trusty
+  dist: trusty
+  sudo: required
+- python: '2.7'
   env: LANGUAGE=en FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="en.wikipedia.beta.wmflabs.org"
 - python: '3.3'
   env: LANGUAGE=zh FAMILY=wpbeta SITE_ONLY=1 
OAUTH_DOMAIN="zh.wikipedia.beta.wmflabs.org"

-- 
To view, visit https://gerrit.wikimedia.org/r/289818
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic248ecb7fa28a0168bf5c90750cc107924ab8c75
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Re-enable APT addon for jobs in matrix include - change (pywikibot/core)

2016-05-19 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289659

Change subject: Re-enable APT addon for jobs in matrix include
..

Re-enable APT addon for jobs in matrix include

The installation of apt packages was inadvertantly disabled in August 2015
with 8004cdfe29 due to https://github.com/travis-ci/travis-ci/issues/5405 .

Bug: T135701
Change-Id: Iaaa562a145b3aca8737af4ac3fc2418496d2747a
---
M .travis.yml
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/59/289659/1

diff --git a/.travis.yml b/.travis.yml
index 400862f..efd9c68 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,8 +12,7 @@
   - '2.6'
 
 # OSX builds do not yet support Python
-os:
-  - linux
+os: linux
 
 addons:
   apt:

-- 
To view, visit https://gerrit.wikimedia.org/r/289659
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaa562a145b3aca8737af4ac3fc2418496d2747a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use py.test for some Travis jobs with 300s timeout - change (pywikibot/core)

2016-05-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289385

Change subject: Use py.test for some Travis jobs with 300s timeout
..

Use py.test for some Travis jobs with 300s timeout

Use pytest-runner to run tests using py.test
and pytest-timeout to kill jobs which take too long.
Use py.text except for SITE_ONLY=1 or PYSETUP_TEST_EXTRAS=1

Bug: T115313
Change-Id: Iae8a77918a3a4ce5a1dba731be6d47716b1c8d02
---
M .travis.yml
M dev-requirements.txt
M tests/README.rst
M tests/script_tests.py
M tests/weblib_tests.py
M tox.ini
6 files changed, 48 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/85/289385/1

diff --git a/.travis.yml b/.travis.yml
index 90cbacb..15d08b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,7 +30,12 @@
   # Instead install requests in the before_script step below.
   - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then rm requirements.txt ; fi
 
-  - if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
+  - if [[ "$SITE_ONLY" == '1' ]]; then
+  export USE_NOSE=1 ;
+elif [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then
+  export USE_PYTEST=1 ;
+fi
+
   - export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
   - mkdir ~/.python-eggs
   - chmod 700 ~/.python-eggs
@@ -95,6 +100,9 @@
   else
 python setup.py nosetests --tests tests --verbosity=2 --with-coverage 
--cover-package=. ;
   fi ;
+elif [[ "$USE_PYTEST" == "1" ]]; then
+  pip install --upgrade pytest-runner pytest-cov pytest-timeout 
"pytest>=2.8.0" ;
+  python setup.py pytest --addopts="-vvv -s --timeout=300 --cov=." ;
 else
   coverage run setup.py test ;
 fi
diff --git a/dev-requirements.txt b/dev-requirements.txt
index d990436..65c3ee8 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -2,6 +2,14 @@
 #
 unittest2==0.8.0 ; python_full_version < '2.7.3'
 
+pytest
+# These are used by only some Travis builds
+# pytest-timeout needs >=2.8.0
+# pytest>=2.8.0
+# pytest-timeout
+# pytest-runner
+# pytest-cov
+
 six
 
 nose
diff --git a/tests/README.rst b/tests/README.rst
index 9c80c36..fff848f 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -34,6 +34,10 @@
 
 python setup.py nosetests --tests tests
 
+::
+
+pip install pytest-runner
+python setup.py pytest
 
 Module unittest
 ~~~
@@ -48,6 +52,13 @@
 ::
 
 nosetests -v
+
+pytest
+~~
+
+::
+
+py.test
 
 tox
 ~~~
@@ -67,6 +78,7 @@
 ::
 
 python -m unittest -v tests.api_tests tests.site_tests
+python -m unittest -v tests.api_tests.TestParamInfo.test_init
 
 nose
 
@@ -74,6 +86,15 @@
 ::
 
 nosetests -v tests.api_tests tests.site_tests
+python -m unittest -v tests.api_tests:TestParamInfo.test_init
+
+pytest
+~~
+
+::
+
+py.test -s -v tests/api_tests.py tests/site_tests.py
+py.test -s -v tests/api_tests.py::TestParamInfo::test_init
 
 pwb
 ~~~
@@ -82,6 +103,7 @@
 
 python pwb.py tests/api_tests.py -v
 python pwb.py tests/site_tests.py -v
+python pwb.py tests/api_tests.py -v TestParamInfo.test_init
 
 env
 ~~~
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 4fdd9ec..5837e98 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -363,6 +363,8 @@
 
 # Disable test by default in nosetests
 if script_name in unrunnable_script_list:
+# flag them as an expectedFailure due to py.test (T135594)
+dct[test_name] = unittest.expectedFailure(dct[test_name])
 dct[test_name].__test__ = False
 
 return super(TestScriptMeta, cls).__new__(cls, name, bases, dct)
diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py
index 13c5a13..3ef7c70 100644
--- a/tests/weblib_tests.py
+++ b/tests/weblib_tests.py
@@ -77,6 +77,7 @@
 self.assertOneDeprecation()
 return archivedversion
 
+@unittest.expectedFailure  # See T110640
 def testWebCiteOlder(self):
 """Test WebCite for https://google.com as of January 2013."""
 archivedversion = self._get_archive_url('https://google.com', 
'20130101')
diff --git a/tox.ini b/tox.ini
index 5d34c3a..040e501 100644
--- a/tox.ini
+++ b/tox.ini
@@ -152,3 +152,9 @@
 [pep257]
 # see explanations above
 ignore = D105,D211
+
+[pytest]
+python_files=tests/*.py
+# disable recursing into tests/pwb, as that prints the environment,
+# exposing any secure variables in Travis.
+norecursedirs=.git .svn .tox pwb

-- 
To view, visit https://gerrit.wikimedia.org/r/289385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae8a77918a3a4ce5a1dba731be6d47716b1c8d02
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vande

[MediaWiki-commits] [Gerrit] Activate nosetrim to reduce repeated errors - change (pywikibot/core)

2016-05-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289355

Change subject: Activate nosetrim to reduce repeated errors
..

Activate nosetrim to reduce repeated errors

The OAuth jobs for wmfbeta sites are failing due to an authentication
problem, causing mosts tests to fail.

Nose normally and helpfully emits a lot of logging information for failed jobs.
However when there is a systemic problem, as currently occurs with the
wmfbeta sites, the result is the job logs are very large, which affects
developers ability to understand the failures and it exceeds the Travis
maximum log size.

Change-Id: I048e04a9451d25bf6893755bf73007f944578191
---
M .travis.yml
M dev-requirements.txt
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/55/289355/1

diff --git a/.travis.yml b/.travis.yml
index 90cbacb..1930065 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -91,9 +91,9 @@
   nosetests --version ;
   if [[ "$SITE_ONLY" == "1" ]]; then
 echo "Running site tests only code ${LANGUAGE} on family ${FAMILY}" ;
-python setup.py nosetests --tests tests --verbosity=2 -a 
"family=$FAMILY,code=$LANGUAGE" --with-coverage --cover-package=. ;
+python setup.py nosetests --tests tests --verbosity=2 -a 
"family=$FAMILY,code=$LANGUAGE" --with-trim --with-coverage --cover-package=. ;
   else
-python setup.py nosetests --tests tests --verbosity=2 --with-coverage 
--cover-package=. ;
+python setup.py nosetests --tests tests --verbosity=2 --with-trim 
--with-coverage --cover-package=. ;
   fi ;
 else
   coverage run setup.py test ;
diff --git a/dev-requirements.txt b/dev-requirements.txt
index d990436..8243906 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -5,6 +5,7 @@
 six
 
 nose
+git+https://github.com/jayvdb/nosetrim@py3
 
 pep257>=0.6
 pyflakes>=0.9

-- 
To view, visit https://gerrit.wikimedia.org/r/289355
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I048e04a9451d25bf6893755bf73007f944578191
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] WikibaseSearchItemPageGenerator non-verbose mode - change (pywikibot/core)

2016-05-17 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289339

Change subject: WikibaseSearchItemPageGenerator non-verbose mode
..

WikibaseSearchItemPageGenerator non-verbose mode

Currently WikibaseSearchItemPageGenerator always
fetches all items twice in order to display an item count,
and then yield each item.

Also do not fetch all entities for test_searchitem*.

The test only needs to confirm one item is fetched,
and currently it can halt Travis builds due to fetching
~5000 items twice taking 10 mins without any output.

Change-Id: Ia8b0e97930a94945d3ed2cdf593887ebff8a3e5c
---
M pywikibot/pagegenerators.py
M tests/pagegenerators_tests.py
2 files changed, 20 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/39/289339/1

diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 6c7a2b2..e42ba58 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -838,7 +838,8 @@
 value = params[-1]
 lang = params[0] if len(params) == 2 else None
 gen = WikibaseSearchItemPageGenerator(value, language=lang,
-  site=self.site)
+  site=self.site,
+  
verbose=config.verbose_output)
 elif arg == '-search':
 if not value:
 value = pywikibot.input('What do you want to search for?')
@@ -2688,7 +2689,8 @@
 return WikidataPageFromItemGenerator(items_pages, site)
 
 
-def WikibaseSearchItemPageGenerator(text, language=None, total=None, 
site=None):
+def WikibaseSearchItemPageGenerator(text, language=None, total=None, site=None,
+verbose=None):
 """
 Generate pages that contain the provided text.
 
@@ -2702,6 +2704,8 @@
 @type total: int or None
 @param site: Site for generator results.
 @type site: L{pywikibot.site.BaseSite}
+@param verbose: Display an item count if True or None
+@type verbose: bool or None
 """
 if site is None:
 site = pywikibot.Site()
@@ -2710,7 +2714,9 @@
 repo = site.data_repository()
 
 data = repo.search_entities(text, language, limit=total)
-pywikibot.output(u'retrieved %d items' % len(list(data)))
+if verbose is None or verbose:
+data = list(data)
+pywikibot.output('retrieved %d items' % len(data))
 for item in data:
 yield pywikibot.ItemPage(repo, item['id'])
 
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index b1a0057..12caea2 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -970,7 +970,7 @@
 gf.handleArg('-searchitem:abc')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-self.assertGreater(len(set(gen)), 0)
+self.assertIsNotNone(next(gen))
 
 def test_searchitem_language(self):
 """Test -searchitem with custom language specified."""
@@ -978,13 +978,20 @@
 gf.handleArg('-searchitem:pl:abc')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-pages = set(gen)
+# ABC disambiguation
+page1 = next(gen)
+self.assertEqual(page1.title(), 'Q286874')
+
 gf = pagegenerators.GeneratorFactory(site=self.site)
 gf.handleArg('-searchitem:en:abc')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
-pages2 = set(gen)
-self.assertNotEqual(pages, pages2)
+# American Broadcasting Company
+page1 = next(gen)
+self.assertEqual(page1.title(), 'Q169889')
+# ABC disambiguation
+page2 = next(gen)
+self.assertEqual(page2.title(), 'Q286874')
 
 
 class TestLogeventsFactoryGenerator(DefaultSiteTestCase,

-- 
To view, visit https://gerrit.wikimedia.org/r/289339
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8b0e97930a94945d3ed2cdf593887ebff8a3e5c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[Bug 1560134] Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

2016-05-12 Thread John Vandenberg
The current patch addresses all previous review comments by reviewers.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1560134

Title:
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/1560134/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1560134] Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

2016-05-11 Thread John Vandenberg
With that one-line fix, the error message reported will be wrong. The
correct fix is in the github PR.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1560134

Title:
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/1560134/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[MediaWiki-commits] [Gerrit] Add mock to test dependencies - change (pywikibot/core)

2016-05-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/286293

Change subject: Add mock to test dependencies
..

Add mock to test dependencies

Change-Id: I5be552c7c0fe86113071ee03a4bec52567a7a9a0
---
M setup.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/93/286293/1

diff --git a/setup.py b/setup.py
index 2457f81..fa1da3a 100644
--- a/setup.py
+++ b/setup.py
@@ -178,7 +178,7 @@
 
 # These extra dependencies are needed other unittest fails to load tests.
 if sys.version_info[0] == 2:
-test_deps += extra_deps['csv']
+test_deps += extra_deps['csv'] + ['mock']
 else:
 test_deps += ['six']
 

-- 
To view, visit https://gerrit.wikimedia.org/r/286293
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5be552c7c0fe86113071ee03a4bec52567a7a9a0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] PyFlakes 1.1 has been released - change (pywikibot/core)

2016-04-07 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282306

Change subject: PyFlakes 1.1 has been released
..

PyFlakes 1.1 has been released

Change-Id: Id161e41c47acf44141817798f4128d6b8ac30934
---
M tox.ini
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/06/282306/1

diff --git a/tox.ini b/tox.ini
index e52aa93..d9fb25d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -28,7 +28,7 @@
 flake8 --doctests {posargs}
 basepython = python2.7
 deps = flake8
-   git+https://github.com/pyflakes/pyflakes.git
+   pyflakes >= 1.1
hacking
flake8-docstrings<0.2.2
flake8-putty>=0.2.0
@@ -45,7 +45,7 @@
 flake8 --doctests {posargs}
 basepython = python3
 deps = flake8
-   git+https://github.com/pyflakes/pyflakes.git
+   pyflakes >= 1.1
flake8-docstrings<0.2.2
flake8-putty>=0.2.0
 

-- 
To view, visit https://gerrit.wikimedia.org/r/282306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id161e41c47acf44141817798f4128d6b8ac30934
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use flake8-putty 0.3.0 auto ignore - change (pywikibot/core)

2016-04-06 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282082

Change subject: Use flake8-putty 0.3.0 auto ignore
..

Use flake8-putty 0.3.0 auto ignore

Instead of flake8's general # noqa, flake8-putty 0.3.0 allows
individual codes to be disabled with '# flake8: disable=xxx'

Change-Id: I21ee56755311c4c5f9cd427e2ce8aca35568b7f7
---
M pywikibot/comms/http.py
M scripts/flickrripper.py
M tox.ini
3 files changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/82/282082/1

diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 260f486..30df06f 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -93,7 +93,7 @@
 message = 'Closing network session.'
 if hasattr(sys, 'last_type'):
 # we quit because of an exception
-print(sys.last_type)  # noqa: print
+print(sys.last_type)  # flake8: disable=T001
 critical(message)
 else:
 log(message)
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 7fa9bce..7f5a20b 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -50,8 +50,8 @@
 import flickrapi# see: http://stuvel.eu/projects/flickrapi
 except ImportError as e:
 print('This script requires the python flickrapi module. \n'
-  'See: http://stuvel.eu/projects/flickrapi')  # noqa: print
-print(e)  # noqa: print
+  'See: http://stuvel.eu/projects/flickrapi')  # flake8: disable=T001
+print(e)  # flake8: disable=T001
 sys.exit(1)
 
 import pywikibot
diff --git a/tox.ini b/tox.ini
index e52aa93..93fe69f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -31,7 +31,7 @@
git+https://github.com/pyflakes/pyflakes.git
hacking
flake8-docstrings<0.2.2
-   flake8-putty>=0.2.0
+   flake8-putty>=0.3.0
flake8-coding
flake8-future-import
flake8-string-format
@@ -47,7 +47,7 @@
 deps = flake8
git+https://github.com/pyflakes/pyflakes.git
flake8-docstrings<0.2.2
-   flake8-putty>=0.2.0
+   flake8-putty>=0.3.0
 
 [testenv:nose]
 commands =
@@ -116,6 +116,7 @@
 max_line_length = 100
 accept-encodings = utf-8
 require-code = true
+putty-auto-ignore = true
 putty-ignore =
 pwb.py,scripts/interwiki.py,scripts/flickrripper.py,pywikibot/site.py, /# 
noqa: E731/ : +E731
 generate_family_file.py : +T001, T003

-- 
To view, visit https://gerrit.wikimedia.org/r/282082
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ee56755311c4c5f9cd427e2ce8aca35568b7f7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix incorrect use of quad quotes for docstring - change (pywikibot/core)

2016-03-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278704

Change subject: Fix incorrect use of quad quotes for docstring
..

Fix incorrect use of quad quotes for docstring

Added in 5a94f9e1

Change-Id: Icb86387d6f8457f6091d75b39fde68ba4c292501
---
M pywikibot/cosmetic_changes.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/04/278704/1

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 7ba4c8e..6afa7b0 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -617,7 +617,7 @@
 return text
 
 def resolveHtmlEntities(self, text):
-""""Resolve html entities."""
+"""Replace HTML entities with unicode."""
 ignore = [
 38, # Ampersand ()
 39, # Single quotation mark () - bug T26093

-- 
To view, visit https://gerrit.wikimedia.org/r/278704
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb86387d6f8457f6091d75b39fde68ba4c292501
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Additional tests for CC fixArabicLetters - change (pywikibot/core)

2016-03-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278599

Change subject: Additional tests for CC fixArabicLetters
..

Additional tests for CC fixArabicLetters

More coverage of functionality, especially of comma
exception.

Change-Id: I019e13bc91cd65554d609de47efeecfd94e24f08
---
M tests/cosmetic_changes_tests.py
1 file changed, 35 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/99/278599/1

diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index 80a0595..0a9ca16 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -300,12 +300,45 @@
 family = 'wikipedia'
 code = 'fa'
 
-def test_fixArabicLetters(self):
-"""Test fixArabicLetters."""
+def test_fixArabicLetters_comma(self):
+"""Test fixArabicLetters comma."""
+self.assertEqual(self.cct.fixArabicLetters(','), '،')
 self.assertEqual(self.cct.fixArabicLetters('A,b,ا,۴,'),
  'A,b،ا،۴،')
+
+def test_fixArabicLetters_comma_skip(self):
+"""Test fixArabicLetters Latin comma not replaced."""
+self.assertEqual(self.cct.fixArabicLetters('a", b'), 'a", b')
+self.assertEqual(self.cct.fixArabicLetters('a, "b'), 'a, "b')
+self.assertEqual(self.cct.fixArabicLetters('a", "b'), 'a", "b')
+# spaces are not required
+self.assertEqual(self.cct.fixArabicLetters('a",b'), 'a",b')
+self.assertEqual(self.cct.fixArabicLetters('a,"b'), 'a,"b')
+self.assertEqual(self.cct.fixArabicLetters('a","b'), 'a","b')
+# quotes are a 'non-Farsi' character; additional non-Farsi not needed
+self.assertEqual(self.cct.fixArabicLetters('",b'), '",b')
+self.assertEqual(self.cct.fixArabicLetters('a,"'), 'a,"')
+self.assertEqual(self.cct.fixArabicLetters('","'), '","')
+
+# A single quotation is a 'non-Farsi' character
+self.assertEqual(self.cct.fixArabicLetters("',b"), "',b")
+self.assertEqual(self.cct.fixArabicLetters("a,'"), "a,'")
+self.assertEqual(self.cct.fixArabicLetters("','"), "','")
+
+# A space is a 'non-Farsi' character
+self.assertEqual(self.cct.fixArabicLetters('a", ۴'), 'a", ۴')
+self.assertEqual(self.cct.fixArabicLetters(' , '), ' , ')
+
+def test_fixArabicLetters_letters(self):
+self.assertEqual(self.cct.fixArabicLetters('ك'),
+ 'ک')
+self.assertEqual(self.cct.fixArabicLetters('ي'),
+ 'ی')
+self.assertEqual(self.cct.fixArabicLetters('ى'),
+ 'ی')
 self.assertEqual(self.cct.fixArabicLetters('كي'),
  'کی')
+
 # Once numbering fixes are enabled we can add tests.
 
 if __name__ == '__main__':

-- 
To view, visit https://gerrit.wikimedia.org/r/278599
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I019e13bc91cd65554d609de47efeecfd94e24f08
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] tests.utils.execute: accept locale 'C' or missing - change (pywikibot/core)

2016-03-19 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278300

Change subject: tests.utils.execute: accept locale 'C' or missing
..

tests.utils.execute: accept locale 'C' or missing

As per f7ecddb, for the test suite

Bug: T129406
Change-Id: If097b88c44a9726958511ec77ce57b90db37d00d
---
M tests/utils.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/00/278300/1

diff --git a/tests/utils.py b/tests/utils.py
index bc5cfa2..9c09991 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -806,7 +806,11 @@
 # A complete locale string needs to be created, so the country code
 # is guessed, however it is discarded when loading config.
 if config.userinterface_lang:
-current_locale = locale.getdefaultlocale()[0].split('.')[0]
+current_locale = locale.getdefaultlocale()[0]
+if current_locale in [None, 'C']:
+current_locale = 'en'
+else:
+current_locale = current_locale.split('.')[0]
 locale_prefix = str(config.userinterface_lang + '_')
 
 if not current_locale.startswith(locale_prefix):

-- 
To view, visit https://gerrit.wikimedia.org/r/278300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If097b88c44a9726958511ec77ce57b90db37d00d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Disable other languages for musicbrainz wiki - change (pywikibot/core)

2016-03-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278309

Change subject: Disable other languages for musicbrainz wiki
..

Disable other languages for musicbrainz wiki

wiki.musicbrainz.org is reporting that it has languages
'ab' and 'lb', when these are actually interwiki links not
interlanguage links.

Bug: T130381
Change-Id: I4761396f4c4ede1cb2dd90cfb9cfac56220b8b9a
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/09/278309/1

diff --git a/.travis.yml b/.travis.yml
index 81b9956..90cbacb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -50,7 +50,7 @@
 
   - mkdir ~/.pywikibot
 
-  - python pwb.py generate_family_file 'https://wiki.musicbrainz.org/' 
musicbrainz
+  - python pwb.py generate_family_file 'https://wiki.musicbrainz.org/' 
musicbrainz 'n'
   - if [[ $FAMILY == 'wpbeta' ]]; then
   python -m generate_family_file 
'http://'$LANGUAGE'.wikipedia.beta.wmflabs.org/' 'wpbeta' 'n' ;
 fi

-- 
To view, visit https://gerrit.wikimedia.org/r/278309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4761396f4c4ede1cb2dd90cfb9cfac56220b8b9a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Check a valid WebCite memento link - change (pywikibot/core)

2016-03-14 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277213

Change subject: Check a valid WebCite memento link
..

Check a valid WebCite memento link

The WebCite timegate URL returns a 400 error if a URI is not provided.
Use a valid timemap URL instead, as it has a small response payload.

Bug: T128998
Change-Id: I9cb473279bb95d056751a3ce41fe809fb62ed283
---
M tests/weblinkchecker_tests.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/13/277213/1

diff --git a/tests/weblinkchecker_tests.py b/tests/weblinkchecker_tests.py
index 2080d98..5e052e2 100644
--- a/tests/weblinkchecker_tests.py
+++ b/tests/weblinkchecker_tests.py
@@ -52,7 +52,8 @@
 """Test WebCite Memento using old weblib tests."""
 
 timegate_uri = 'http://timetravel.mementoweb.org/webcite/timegate/'
-hostname = timegate_uri
+hostname = ('http://timetravel.mementoweb.org/webcite/'
+'timemap/json/http://google.com')
 
 
 class TestMementoWebCite(MementoTestCase):
@@ -60,7 +61,8 @@
 """New WebCite Memento tests."""
 
 timegate_uri = 'http://timetravel.mementoweb.org/webcite/timegate/'
-hostname = timegate_uri
+hostname = ('http://timetravel.mementoweb.org/webcite/'
+'timemap/json/http://google.com')
 
 def test_newest(self):
 """Test WebCite for newest https://google.com."";

-- 
To view, visit https://gerrit.wikimedia.org/r/277213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cb473279bb95d056751a3ce41fe809fb62ed283
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Revert "[IMPR] Simplify arg parsing in handle_args method" - change (pywikibot/core)

2016-03-08 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275776

Change subject: Revert "[IMPR] Simplify arg parsing in handle_args method"
..

Revert "[IMPR] Simplify arg parsing in handle_args method"

This reverts commit 665d824e4c1a1ba0edab85077ea52d20329a6dca.

Change-Id: Ida03771a1e446673b5d33d34f58878284235de18
---
M pywikibot/bot.py
1 file changed, 33 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/76/275776/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index a1a837a..18436db 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -841,32 +841,35 @@
 username = None
 do_help = None if do_help else False
 for arg in args:
-option, sep, value = arg.partition(':')
-if do_help is not False and option == '-help':
+if do_help is not False and arg == '-help':
 do_help = True
-elif option == '-dir':
+elif arg.startswith('-dir:'):
 pass
-elif option == '-family':
-config.family = value
-elif option == '-lang':
-config.mylang = value
-elif option == '-user:':
-username = value
-elif option in ('-putthrottle', '-pt'):
-config.put_throttle = int(value)
-elif option == '-log':
+elif arg.startswith('-family:'):
+config.family = arg[len("-family:"):]
+elif arg.startswith('-lang:'):
+config.mylang = arg[len("-lang:"):]
+elif arg.startswith("-user:"):
+username = arg[len("-user:"):]
+elif arg.startswith('-putthrottle:'):
+config.put_throttle = int(arg[len("-putthrottle:"):])
+elif arg.startswith('-pt:'):
+config.put_throttle = int(arg[len("-pt:"):])
+elif arg == '-log':
 if moduleName not in config.log:
 config.log.append(moduleName)
-if value:
-config.logfilename = value
-elif option == '-nolog':
+elif arg.startswith('-log:'):
+if moduleName not in config.log:
+config.log.append(moduleName)
+config.logfilename = arg[len("-log:"):]
+elif arg == '-nolog':
 if moduleName in config.log:
 config.log.remove(moduleName)
-elif option in ('-cosmeticchanges', '-cc'):
+elif arg in ('-cosmeticchanges', '-cc'):
 config.cosmetic_changes = not config.cosmetic_changes
 output(u'NOTE: option cosmetic_changes is %s\n'
% config.cosmetic_changes)
-elif option == '-simulate':
+elif arg == '-simulate':
 config.simulate = True
 #
 #  DEBUG control:
@@ -893,28 +896,31 @@
 #If used, "-debug" turns on file logging, regardless of any
 #other settings.
 #
-elif option == '-debug':
+elif arg == '-debug':
 if moduleName not in config.log:
 config.log.append(moduleName)
-if value:
-if value not in config.debug_log:
-config.debug_log.append(value)
-elif '' not in config.debug_log:
+if "" not in config.debug_log:
 config.debug_log.append("")
-elif option in ('-verbose', '-v'):
+elif arg.startswith("-debug:"):
+if moduleName not in config.log:
+config.log.append(moduleName)
+component = arg[len("-debug:"):]
+if component not in config.debug_log:
+config.debug_log.append(component)
+elif arg in ('-verbose', '-v'):
 config.verbose_output += 1
-elif option == '-daemonize':
-redirect_std = value if value else None
+elif arg.startswith('-daemonize'):
+redirect_std = arg[len('-daemonize:'):] if ':' in arg else None
 daemonize.daemonize(redirect_std=redirect_std)
 else:
 # the argument depends on numerical config settings
 # e.g. -maxlag:
 try:
-_arg = option[1:]
+_arg, _val = arg[1:].split(':')
 # explicitly check for int (so bool doesn't match)
 if not isinstance(getattr(config, _arg), int):
 raise TypeError
-setattr(config, _arg, int(value))
+setattr(config, _arg, int(_val))
 except (ValueError, TypeError, AttributeError):
 # argument not global -> specific bot script will take care
 nonGlobalArgs.append(arg)

-- 
To view, visit https://gerrit.wikimedia.org/r/275776
To unsubscribe, visit https://gerrit.wikimedia.org/r/s

[MediaWiki-commits] [Gerrit] Re-add featured script to the auto run list - change (pywikibot/core)

2016-03-07 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275717

Change subject: Re-add featured script to the auto run list
..

Re-add featured script to the auto run list

It was removed in 38ac044 when featured was moved into scripts/archive.

Also tidy other parts of that commit, including adding a deprecation
warning to the featured.py script.

Bug: T128955
Change-Id: I1e373b9229b479227e3df30b51cb20915d1f0c47
---
M scripts/archive/README
M scripts/archive/featured.py
M tests/script_tests.py
M tox.ini
4 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/17/275717/1

diff --git a/scripts/archive/README b/scripts/archive/README
index 92d5958..1e70cad 100644
--- a/scripts/archive/README
+++ b/scripts/archive/README
@@ -1 +1,6 @@
-This folder consists scripts that will not maintened but we keep them for 
historical reasons.
+This folder consists scripts that will not be improved, but are kept for
+backwards compatibility with a deprecation notice.
+
+featured.py is no longer compatible with Wikimedia sites, and no other wiki
+online could be found that is compatible with this script.
+See https://phabricator.wikimedia.org/T128955 for more information.
diff --git a/scripts/archive/featured.py b/scripts/archive/featured.py
index a29b05f..92d21de 100755
--- a/scripts/archive/featured.py
+++ b/scripts/archive/featured.py
@@ -75,6 +75,7 @@
 from pywikibot import i18n, textlib, config
 
 from pywikibot.pagegenerators import PreloadingGenerator
+from pywikibot.tools import issue_deprecation_warning
 from pywikibot.tools.formatter import color_format
 
 if sys.version_info[0] > 2:
@@ -619,6 +620,9 @@
 @param args: command line arguments
 @type args: list of unicode
 """
+issue_deprecation_warning(
+'featured.py script', 'Wikibase Client extension',
+0, UserWarning)
 options = {}
 for arg in pywikibot.handle_args(args):
 if arg.startswith('-fromlang:'):
diff --git a/tests/script_tests.py b/tests/script_tests.py
index c0bb625..4fdd9ec 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -122,6 +122,7 @@
 'checkimages',
 'clean_sandbox',
 'disambredir',
+'featured',
 'imagerecat',
 'login',
 'lonelypages',
diff --git a/tox.ini b/tox.ini
index b01f51a..b3f567d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -128,7 +128,7 @@
 tests/pwb/ : +T001, T003
 scripts/casechecker.py,scripts/imagetransfer.py : +T001, T003
 scripts/maintenance/make_i18n_dict.py : +T001, T003
-scripts/archive/ : +D102, D103
+scripts/archive/featured.py : +D102, D103
 scripts/script_wui.py : +D102
 scripts/makecat.py : +D103
 scripts/interwiki.py,/""/ : +P102

-- 
To view, visit https://gerrit.wikimedia.org/r/275717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e373b9229b479227e3df30b51cb20915d1f0c47
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Expand wikistats datatype tests - change (pywikibot/core)

2016-03-07 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275511

Change subject: Expand wikistats datatype tests
..

Expand wikistats datatype tests

Bug: T128990
Change-Id: I6529c73c327da7272486cb479c6de8a2052b20a5
---
M tests/wikistats_tests.py
1 file changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/275511/1

diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py
index 4d59623..e255968 100644
--- a/tests/wikistats_tests.py
+++ b/tests/wikistats_tests.py
@@ -30,6 +30,9 @@
 self.assertIn('prefix', top)
 self.assertIn('total', top)
 self.assertEqual(top['prefix'], 'en')
+self.assertTrue(all(isinstance(key, UnicodeType)
+for key in top.keys()
+if key is not None))
 self.assertIsInstance(top['total'], UnicodeType)
 self.assertEqual(ws.languages_by_size('wikipedia')[0], 'en')
 self.assertEqual(ws.languages_by_size('wikisource')[0], 'fr')
@@ -44,7 +47,13 @@
 self.assertIn('en', data)
 self.assertIn('ht', data)
 self.assertGreater(int(data['en']['total']), 400)
-data = ws.get_dict
+data = data['en']
+self.assertTrue(all(isinstance(key, UnicodeType)
+for key in data.keys()
+if key is not None))
+self.assertIsInstance(data['total'], UnicodeType)
+self.assertIn('prefix', data)
+self.assertIn('total', data)
 
 def test_xml(self):
 """Test XML."""
@@ -54,6 +63,13 @@
 self.assertIn('en', data)
 self.assertIn('id', data)
 self.assertGreater(int(data['fr']['total']), 160)
+data = data['fr']
+self.assertTrue(all(isinstance(key, UnicodeType)
+for key in data.keys()
+if key is not None))
+self.assertIsInstance(data['total'], UnicodeType)
+self.assertIn('prefix', data)
+self.assertIn('total', data)
 
 
 if __name__ == '__main__':

-- 
To view, visit https://gerrit.wikimedia.org/r/275511
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6529c73c327da7272486cb479c6de8a2052b20a5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix -cat pagegenerator - change (pywikibot/core)

2016-03-05 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275272

Change subject: Fix -cat pagegenerator
..

Fix -cat pagegenerator

-cat without an argument was broken in 343b875
This broken unit test test_pagegen_i18n_input

Also properly deprecated the old 'arg' argument for
public GeneratorFactory.getCategory and .getCategoryGen
which was also a breaking change in 343b875.

Change-Id: Ifca4c65737e1f67f14576f540bdafcd0b82daf4c
---
M pywikibot/pagegenerators.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/72/275272/1

diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 2f80a3b..7c9854e 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -475,6 +475,7 @@
 
 return dupfiltergen
 
+@deprecated_args(arg='category')
 def getCategory(self, category):
 """
 Return Category and start as defined by category.
@@ -483,7 +484,7 @@
 @type category: str
 @rtype: tuple
 """
-if category.startswith('-'):  # old arg parameter
+if category and category.startswith('-'):
 categoryname = category.partition(':')[2]
 issue_deprecation_warning(
 'The usage of "{0}" as actual parameter of '
@@ -491,6 +492,7 @@
 categoryname, 2, ArgumentDeprecationWarning)
 else:
 categoryname = category
+
 if not categoryname:
 categoryname = i18n.input(
 'pywikibot-enter-category-name',
@@ -512,6 +514,7 @@
 defaultNamespace=14))
 return cat, startfrom
 
+@deprecated_args(arg='category')
 def getCategoryGen(self, category, recurse=False, content=False,
gen_func=None):
 """

-- 
To view, visit https://gerrit.wikimedia.org/r/275272
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifca4c65737e1f67f14576f540bdafcd0b82daf4c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] listpages.py: Fix help docstring - change (pywikibot/core)

2016-03-05 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275267

Change subject: listpages.py: Fix help docstring
..

listpages.py: Fix help docstring

Replace -dir with -save in docstring.

Change-Id: Ic17d6255a532c3959ac0924314fe2f01f4d53ea6
(cherry picked from commit 08af9606decaf405a034f4f5a9275c7eb56a4b32)
---
M scripts/listpages.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/67/275267/1

diff --git a/scripts/listpages.py b/scripts/listpages.py
index c89be5a..30d71ca 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -43,7 +43,7 @@
 -get Page content is printed.
 
 -saveSave Page content to a file named as page.title(as_filename=True).
- Directory can be set with -dir:dir_name
+ Directory can be set with -save:dir_name
  If no dir is specified, current direcory will be used.
 
 -encode  File encoding can be specified with '-encode:name' (name must be a

-- 
To view, visit https://gerrit.wikimedia.org/r/275267
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic17d6255a532c3959ac0924314fe2f01f4d53ea6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.w...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update config.default_edit_summary - change (pywikibot/core)

2016-03-04 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275129

Change subject: Update config.default_edit_summary
..

Update config.default_edit_summary

Pywikibot master is now 3.0, but config.default_edit_summary
is reporting 'Pywikibot v.2'.  Set the config variable to

'Pywikibot ' + __release__

Change-Id: I189220154db22abe608e2d683eb0d395066f928c
---
M pywikibot/config2.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/29/275129/1

diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 7fc9d7a..23bdcd8 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -52,6 +52,7 @@
 
 from warnings import warn
 
+from pywikibot import __release__
 from pywikibot.logging import error, output, warning
 from pywikibot.tools import PY2
 
@@ -218,7 +219,7 @@
 # edit summary to use if not supplied by bot script
 # WARNING: this should NEVER be used in practice, ALWAYS supply a more
 #  relevant summary for bot edits
-default_edit_summary = u'Pywikibot v.2'
+default_edit_summary = 'Pywikibot ' + __release__
 
 # What permissions to use to set private files to it
 # such as password file.

-- 
To view, visit https://gerrit.wikimedia.org/r/275129
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I189220154db22abe608e2d683eb0d395066f928c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add flake8-tuple - change (pywikibot/core)

2016-03-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/274075

Change subject: Add flake8-tuple
..

Add flake8-tuple

Detects `x = a,` requiring that construct is `x = (a, )`

Change-Id: I7c5133fef51c768369488319349290cac994d596
---
M tox.ini
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/75/274075/1

diff --git a/tox.ini b/tox.ini
index b01f51a..110ae33 100644
--- a/tox.ini
+++ b/tox.ini
@@ -36,6 +36,7 @@
flake8-future-import
flake8-string-format
flake8-import-order
+   flake8-tuple>=0.2.4
flake8-print>=2.0.1
 
 [testenv:flake8-py3]

-- 
To view, visit https://gerrit.wikimedia.org/r/274075
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c5133fef51c768369488319349290cac994d596
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use flake8-docstrings>=0.2.5 - change (pywikibot/core)

2016-02-17 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/271425

Change subject: Use flake8-docstrings>=0.2.5
..

Use flake8-docstrings>=0.2.5

(Fails at the moment)

Bug: T119790
Change-Id: I8d42e5e710f544e365063047e8e17e4d56a8b7a7
---
M tox.ini
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/25/271425/1

diff --git a/tox.ini b/tox.ini
index 5437e66..fb6cc07 100644
--- a/tox.ini
+++ b/tox.ini
@@ -30,7 +30,7 @@
 deps = flake8
git+https://github.com/pyflakes/pyflakes.git
hacking
-   flake8-docstrings<0.2.2
+   flake8-docstrings>=0.2.5
flake8-putty>=0.2.0
flake8-coding
flake8-future-import
@@ -45,7 +45,7 @@
 basepython = python3
 deps = flake8
git+https://github.com/pyflakes/pyflakes.git
-   flake8-docstrings<0.2.2
+   flake8-docstrings>=0.2.5
flake8-putty>=0.2.0
 
 [testenv:nose]

-- 
To view, visit https://gerrit.wikimedia.org/r/271425
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d42e5e710f544e365063047e8e17e4d56a8b7a7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove multiple spaces before operator - change (operations...kafkatee)

2016-02-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/267660

Change subject: Remove multiple spaces before operator
..

Remove multiple spaces before operator

Allows pep8 rule E221 to be enabled.

Change-Id: I037ebefdeb05a890cf4b4c1af8a051be77a95594
---
M files/kafkatee_ganglia.py
M tox.ini
2 files changed, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/kafkatee 
refs/changes/60/267660/1

diff --git a/files/kafkatee_ganglia.py b/files/kafkatee_ganglia.py
index 16cc994..f2fd2e8 100755
--- a/files/kafkatee_ganglia.py
+++ b/files/kafkatee_ganglia.py
@@ -153,15 +153,15 @@
 per_second_key_suffix = 'per_second'
 
 def __init__(self, stats_file='/var/cache/kafkatee/kafkatee.stats.json', 
key_separator='.'):
-self.stats_file   = stats_file
-self.key_separator= key_separator
+self.stats_file = stats_file
+self.key_separator = key_separator
 
 # NOTE:  It might be more elegant to
 # store the JSON object as it comes back from stats_file,
 # rather than keeping the state in the flattened hash.
 
 # latest flattnened stats as read from stats_file
-self.flattened_stats  = {}
+self.flattened_stats = {}
 # previous flattened stats as read from stats_file
 self.flattened_stats_previous = {}
 
@@ -260,7 +260,7 @@
 JSON stats, not the time since update_stats() was last called.
 '''
 # The timestamp will be keyed as 'kafka.rdkafka.time'
-timestamp_key = 
self.key_separator.join(key.split(self.key_separator)[0:2]  + ['time'])
+timestamp_key = 
self.key_separator.join(key.split(self.key_separator)[0:2] + ['time'])
 
 # if we don't yet have a previous value from which to calculate a
 # rate, just return 0 for now
@@ -333,10 +333,10 @@
 global time_max
 global last_run_timestamp
 
-stats_file = params.get('stats_file', 
'/var/cache/kafkatee/kafkatee.stats.json')
-key_separator  = params.get('key_separator', '.')
+stats_file = params.get('stats_file', 
'/var/cache/kafkatee/kafkatee.stats.json')
+key_separator = params.get('key_separator', '.')
 ganglia_groups = params.get('groups', 'kafka')
-time_max   = int(params.get('tmax', time_max))
+time_max = int(params.get('tmax', time_max))
 
 kafkatee_stats = KafkateeStats(stats_file, key_separator)
 # Run update_stats() so that we'll have a list of stats keys that will
@@ -565,7 +565,7 @@
 cmdline.print_help()
 cmdline.error("Must supply statsfile argument.")
 
-cli_options.stats_file  = arguments[0]
+cli_options.stats_file = arguments[0]
 
 # Turn the optparse.Value object into a regular dict
 # so we can pass it to metric_init
diff --git a/tox.ini b/tox.ini
index 776ee15..897a40b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,6 +13,5 @@
 
 [flake8]
 max-line-length = 150
-; E221 multiple spaces before operator
 ; E241 multiple spaces after ':'
-ignore = E221,E241
+ignore = E241

-- 
To view, visit https://gerrit.wikimedia.org/r/267660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I037ebefdeb05a890cf4b4c1af8a051be77a95594
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/kafkatee
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove old unneeded URL exclusion rules - change (pywikibot/core)

2016-01-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265442

Change subject: Remove old unneeded URL exclusion rules
..

Remove old unneeded URL exclusion rules

No problems are experienced now accessing these URLs.

Bug: T124015
Change-Id: I1f33969058fc67f8437f2f92325faba636a9c81c
---
M scripts/weblinkchecker.py
1 file changed, 3 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/42/265442/1

diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index d1f0834..7aa40b0 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -162,19 +162,13 @@
 
 # Other special cases
 # bot somehow can't handle their redirects:
+# TODO: T124140
 re.compile(r'.*[\./@]gso\.gbv\.de(/.*)?'),
+
 re.compile(r'.*[\./@]berlinonline\.de(/.*)?'),
 # above entry to be manually fixed per request at 
[[de:Benutzer:BLueFiSH.as/BZ]]
 # bot can't handle their redirects:
-re.compile(r'.*[\./@]bodo\.kommune\.no(/.*)?'),
-re.compile(r'.*[\./@]jpl\.nasa\.gov(/.*)?'),  # bot rejected on the site
-re.compile(r'.*[\./@]itis\.gov(/.*)?'),  # bot rejected on the site
-re.compile(r'.*[\./@]cev\.lu(/.*)?'),  # bot rejected on the site
-# very slow response resulting in bot error:
-re.compile(r'.*[\./@]science\.ksc\.nasa\.gov(/.*)?'),
-re.compile(r'.*[\./@]britannica\.com(/.*)?'),  # HTTP redirect loop
-# bot rejected on the site:
-re.compile(r'.*[\./@]quickfacts\.census\.gov(/.*)?'),
+
 # bot rejected on the site, already archived
 re.compile(r'.*[\./@]web\.archive\.org(/.*)?'),
 ]

-- 
To view, visit https://gerrit.wikimedia.org/r/265442
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f33969058fc67f8437f2f92325faba636a9c81c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] color logging fixes - change (pywikibot/core)

2016-01-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265462

Change subject: color logging fixes
..

color logging fixes

afe2555d7 implemented color_format, which uses str.format {} syntax,
but two messages in reflinks were not converted from %s syntax to {}.

Bug: T123887
Change-Id: I8e6916153428689dc4c6410bebfc9c771d8813d8
---
M scripts/reflinks.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/62/265462/1

diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 0474deb..814e1ce 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -38,7 +38,7 @@
   one from i18n/reflinks.py
 """
 # (C) Nicolas Dumazet (NicDumZ), 2008
-# (C) Pywikibot team, 2008-2015
+# (C) Pywikibot team, 2008-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -587,7 +587,7 @@
 # example : 
http://www.adminet.com/jo/20010615¦/ECOC0100037D.html
 # in [[fr:Cyanure]]
 pywikibot.output(color_format(
-'{lightred}Bad link{default} : %s in %s',
+'{lightred}Bad link{default} : {0} in {1}',
 ref.url, page.title(asLink=True)))
 continue
 except (URLError,
@@ -638,7 +638,7 @@
 continue
 elif not self.MIME.search(contentType):
 pywikibot.output(color_format(
-'{lightyellow}WARNING{default} : media : %s ',
+'{lightyellow}WARNING{default} : media : {0} ',
 ref.link))
 repl = ref.refLink()
 new_text = new_text.replace(match.group(), repl)

-- 
To view, visit https://gerrit.wikimedia.org/r/265462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e6916153428689dc4c6410bebfc9c771d8813d8
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Include family name in assertion - change (pywikibot/core)

2016-01-20 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265225

Change subject: Include family name in assertion
..

Include family name in assertion

If a family module contains an invalid character an
assertion is raised, however it doesnt indicate which
family module is incorrectly named.

Change-Id: I337ff16663a3d875a7dd56679a869ae82499db1c
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/25/265225/1

diff --git a/pywikibot/family.py b/pywikibot/family.py
index ce3f6c4..7a5f23b 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -896,7 +896,7 @@
 fam = config.family
 
 assert all(x in NAME_CHARACTERS for x in fam), \
-'Name of family must be ASCII character'
+'Name of family %s must be ASCII characters' % fam
 
 if fam in Family._families:
 return Family._families[fam]

-- 
To view, visit https://gerrit.wikimedia.org/r/265225
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I337ff16663a3d875a7dd56679a869ae82499db1c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Allow Coordinate.precision to be None - change (pywikibot/core)

2016-01-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/264740

Change subject: Allow Coordinate.precision to be None
..

Allow Coordinate.precision to be None

Wikibase has coordinates without a precision.
They cause an exception when saving unmodified.

Also add a setter for Coordinate.precision, so
existing data without a precision can be improved.

Bug: T123910
Change-Id: I9ce758c7271c78ba9b97bf2f52b4b34160d935e1
---
M pywikibot/__init__.py
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/40/264740/1

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index c2f4dd5..d3353d4 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -331,6 +331,11 @@
 u"""
 Return the precision of the geo coordinate.
 
+The precision is calculated if the Coordinate does not have a 
precision,
+and self._dim is set.
+
+When no precision and no self._dim exists, None is returned.
+
 The biggest error (in degrees) will be given by the longitudinal error;
 the same error in meters becomes larger (in degrees) further up north.
 We can thus ignore the latitudinal error.
@@ -346,13 +351,19 @@
 
 Therefore::
 precision = 
math.degrees(self._dim/(radius*math.cos(math.radians(self.lat
+
+@rtype: float or None
 """
-if not self._precision:
+if self._precision is None and self._dim is not None:
 radius = 6378137  # TODO: Support other globes
 self._precision = math.degrees(
 self._dim / (radius * math.cos(math.radians(self.lat
 return self._precision
 
+@precision.setter
+def precision(self, value):
+self._precision = value
+
 def precisionToDim(self):
 """Convert precision from Wikibase to GeoData's dim."""
 raise NotImplementedError

-- 
To view, visit https://gerrit.wikimedia.org/r/264740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ce758c7271c78ba9b97bf2f52b4b34160d935e1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove unneeded catching of httplib ValueError - change (pywikibot/core)

2016-01-18 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/264931

Change subject: Remove unneeded catching of httplib ValueError
..

Remove unneeded catching of httplib ValueError

Bug: T124010
Change-Id: I5f1b5bca386610c4f974358792d45ad01756c20d
---
M scripts/reflinks.py
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/31/264931/1

diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 0474deb..03ac5ca 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -597,10 +597,7 @@
 pywikibot.output(u'Can\'t retrieve page %s : %s'
  % (ref.url, e))
 continue
-except ValueError:
-# Known bug of httplib, google for :
-# "httplib raises ValueError reading chunked content"
-continue
+
 # remove 

[MediaWiki-commits] [Gerrit] Sync ps_mem.py from origin - change (operations/puppet)

2016-01-13 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/264028

Change subject: Sync ps_mem.py from origin
..

Sync ps_mem.py from origin

Sync ps_mem.py from https://github.com/pixelb/ps_mem/
which has been improved to pass pyflakes.

Change-Id: If24ac49e96adb1e471764b615c3e87a647627c3f
---
M modules/admin/files/home/ori/.binned/ps_mem.py
1 file changed, 103 insertions(+), 127 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/28/264028/1

diff --git a/modules/admin/files/home/ori/.binned/ps_mem.py 
b/modules/admin/files/home/ori/.binned/ps_mem.py
index 274c955..f3fd2e5 100755
--- a/modules/admin/files/home/ori/.binned/ps_mem.py
+++ b/modules/admin/files/home/ori/.binned/ps_mem.py
@@ -3,9 +3,9 @@
 # Try to determine how much RAM is currently being used per program.
 # Note per _program_, not per process. So for example this script
 # will report RAM used by all httpd process together. In detail it reports:
-# sum(private RAM for program processes) + sum(Shared RAM for program
-# processes) The shared RAM is problematic to calculate, and this script
-# automatically selects the most accurate method available for your kernel.
+# sum(private RAM for program processes) + sum(Shared RAM for program 
processes)
+# The shared RAM is problematic to calculate, and this script automatically
+# selects the most accurate method available for your kernel.
 
 # Licence: LGPLv2
 # Author:  p...@draigbrady.com
@@ -31,13 +31,12 @@
 #   which fixes the possible race between reading
 #   RSS with ps, and shared memory with this program.
 #   Also we can show non truncated command names.
-# V1.8  28 Sep 2007 More accurate matching for stats in
-#   /proc/$pid/smaps as otherwise could match libraries
-#   causing a crash.
+# V1.8  28 Sep 2007 More accurate matching for stats in 
/proc/$pid/smaps
+#   as otherwise could match libraries causing a crash.
 #   Patch from patrice.bouchand.fed...@gmail.com
 # V1.9  20 Feb 2008 Fix invalid values reported when PSS is available.
 #   Reported by Andrey Borzenkov <arvidj...@mail.ru>
-# V3.3  24 Jun 2014
+# V3.6  16 Oct 2015
 #   http://github.com/pixelb/scripts/commits/master/scripts/ps_mem.py
 
 # Notes:
@@ -45,7 +44,7 @@
 # All interpreted programs where the interpreter is started
 # by the shell or with env, will be merged to the interpreter
 # (as that's what's given to exec). For e.g. all python programs
-# starting with "# !/usr/bin/env python" will be grouped under python.
+# starting with "#!/usr/bin/env python" will be grouped under python.
 # You can change this by using the full command line but that will
 # have the undesirable affect of splitting up programs started with
 # differing parameters (for e.g. mingetty tty[1-6]).
@@ -80,16 +79,6 @@
 import os
 import sys
 
-try:
-# md5 module is deprecated on python 2.6
-# so try the newer hashlib first
-import hashlib
-md5_new = hashlib.md5
-except ImportError:
-import md5
-md5_new = md5.new
-
-
 # The following exits cleanly on Ctrl-C or EPIPE
 # while treating other exceptions as before.
 def std_exceptions(etype, value, tb):
@@ -106,24 +95,12 @@
 #   Define some global variables
 #
 
-PAGESIZE = os.sysconf("SC_PAGE_SIZE") / 1024  # KiB
+PAGESIZE = os.sysconf("SC_PAGE_SIZE") / 1024 #KiB
 our_pid = os.getpid()
 
 have_pss = 0
-help_msg = """Usage: ps_mem [OPTION]...
-Show program core memory usage
-
-  -h, -help   Show this help
-  -p [,pid2,...pidN] Only show memory usage PIDs in the specified list
-  -s, --split-argsShow and separate by, all command line arguments
-  -t, --total Show only the total value
-  -w   Measure and show process memory every N seconds
-
-"""
-
 
 class Proc:
-
 def __init__(self):
 uname = os.uname()
 if uname[0] == "FreeBSD":
@@ -136,11 +113,14 @@
 
 def open(self, *args):
 try:
-return open(self.path(*args))
+if sys.version_info < (3,):
+return open(self.path(*args))
+else:
+return open(self.path(*args), errors='ignore')
 except (IOError, OSError):
 val = sys.exc_info()[1]
-if (val.errno == errno.ENOENT or  # kernel thread or process gone
-val.errno == errno.EPERM):
+if (val.errno == errno.ENOENT or # kernel thread or process gone
+val.errno == errno.EPERM):
 raise LookupError
 raise
 
@@ -192,14 +172,19 @@
 
 return (split_args, pids_to_show, watch,

[MediaWiki-commits] [Gerrit] Incorrect syntax in RCStreamCollector.collect - change (operations/puppet)

2016-01-13 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263848

Change subject: Incorrect syntax in RCStreamCollector.collect
..

Incorrect syntax in RCStreamCollector.collect

`except IOError, ValueError:` assigns the exception to ValueError.
Added in 21be64bf.

Change-Id: I361261b2ba58d44fd0774859432f720790aca980
---
M modules/rcstream/files/diamond_collector.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/263848/1

diff --git a/modules/rcstream/files/diamond_collector.py 
b/modules/rcstream/files/diamond_collector.py
index 5ea44bb..3be0d87 100644
--- a/modules/rcstream/files/diamond_collector.py
+++ b/modules/rcstream/files/diamond_collector.py
@@ -40,7 +40,7 @@
 for backend in backends:
 try:
 stat = self.get_backend_stats(backend)
-except IOError, ValueError:
+except (IOError, ValueError):
 self.log.exception('Failed to check backend %s', backend)
 else:
 stats.append(stat)

-- 
To view, visit https://gerrit.wikimedia.org/r/263848
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I361261b2ba58d44fd0774859432f720790aca980
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add flake8 rule for selected modules - change (operations/puppet)

2016-01-13 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263866

Change subject: Add flake8 rule for selected modules
..

Add flake8 rule for selected modules

Significant number of Python files fail pyflakes rules.
Fix the simplest of them, and exclude the remainder
to be analysed more carefully for side-effects.

Change-Id: I9c921213e36d1d8a3aafce1cf2039172b3c882c9
---
M files/misc/PacketLossLogtailer.py
M files/misc/demux.py
M files/misc/rolematcher.py
M modules/base/files/labs/puppetalert.py
M modules/dataset/files/labs/wmfdumpsmirror.py
M modules/diamond/files/collector/localcrontab.py
M modules/elasticsearch/files/monitor/wmfelastic.py
M modules/hhvm/files/monitoring/hhvm_apc.py
M modules/icinga/files/check_legal_html.py
M modules/icinga/files/purge-nagios-resources.py
M modules/mw_rc_irc/files/monitor/ircd_stats.py
M modules/openstack/files/spreadcheck.py
M modules/pybal/files/pybal_state.py
M modules/swift/files/SwiftMedia/wmf/rewrite_integration_test.py
M modules/toollabs/files/gridscripts/runninggridjobsmail.py
M modules/toollabs/files/gridscripts/runninggridtasks.py
M modules/toollabs/files/kube2dynproxy.py
M modules/toollabs/manifests/genpp/genpp.py
M modules/toollabs/manifests/genpp/python.py
M modules/varnish/files/zerofetch.py
M modules/wdqs/files/monitor/wdqs_updater.py
M tox.ini
22 files changed, 38 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/66/263866/1

diff --git a/files/misc/PacketLossLogtailer.py 
b/files/misc/PacketLossLogtailer.py
index 4c342a0..0cff4a2 100644
--- a/files/misc/PacketLossLogtailer.py
+++ b/files/misc/PacketLossLogtailer.py
@@ -171,7 +171,9 @@
 self.lock.acquire()
 try:
 mydata = self.deep_copy()
-check_time = self.get_check_duration()
+# get_check_duration called only to raise LogtailerStateException
+# if appropriate
+self.get_check_duration()
 self.reset_state()
 self.lock.release()
 except LogtailerStateException, e:
diff --git a/files/misc/demux.py b/files/misc/demux.py
index 26b452c..a58130f 100755
--- a/files/misc/demux.py
+++ b/files/misc/demux.py
@@ -6,7 +6,6 @@
 # Simple python script for demultiplexing MediaWiki log files
 
 import argparse
-import os
 import re
 import string
 import sys
diff --git a/files/misc/rolematcher.py b/files/misc/rolematcher.py
index 583c134..6493a19 100644
--- a/files/misc/rolematcher.py
+++ b/files/misc/rolematcher.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
 
 '''
 This script parses the packet-loss.log file and for each server entry
@@ -15,6 +15,7 @@
 PacketLossLogTailer.py is the regular point of entry.
 '''
 
+import httplib
 import re
 import urllib2
 import json
diff --git a/modules/base/files/labs/puppetalert.py 
b/modules/base/files/labs/puppetalert.py
index facd0e2..4fade7f 100755
--- a/modules/base/files/labs/puppetalert.py
+++ b/modules/base/files/labs/puppetalert.py
@@ -17,7 +17,6 @@
 Send an alert email to project admins about a puppet failure.  This is
 meant to be run on the affected instance.
 """
-import argparse
 import calendar
 import time
 import ldap
diff --git a/modules/dataset/files/labs/wmfdumpsmirror.py 
b/modules/dataset/files/labs/wmfdumpsmirror.py
index e735c89..fae9ef9 100644
--- a/modules/dataset/files/labs/wmfdumpsmirror.py
+++ b/modules/dataset/files/labs/wmfdumpsmirror.py
@@ -2,9 +2,9 @@
 import os
 import re
 import sys
-import subprocess
 import shutil
 import multiprocessing
+
 from subprocess import Popen, PIPE
 from Queue import Empty
 
diff --git a/modules/diamond/files/collector/localcrontab.py 
b/modules/diamond/files/collector/localcrontab.py
index 17ef717..0b6aabb 100644
--- a/modules/diamond/files/collector/localcrontab.py
+++ b/modules/diamond/files/collector/localcrontab.py
@@ -8,8 +8,9 @@
 """
 
 import subprocess
-import os
+
 import diamond.collector
+
 from diamond.collector import str_to_bool
 
 
diff --git a/modules/elasticsearch/files/monitor/wmfelastic.py 
b/modules/elasticsearch/files/monitor/wmfelastic.py
index 462094a..f96b073 100644
--- a/modules/elasticsearch/files/monitor/wmfelastic.py
+++ b/modules/elasticsearch/files/monitor/wmfelastic.py
@@ -213,7 +213,7 @@
 for metric in self.health_metrics:
 try:
 gmetrics[metric] = chealth[metric]
-except KeyError, e:
+except KeyError:
 self.errors += 1
 pass
 return gmetrics
@@ -226,7 +226,7 @@
 try:
 value = self.dict_digger(depth, cstats)
 gmetrics[m] = value
-except KeyError, e:
+except KeyError:
 self.errors += 1
 pass
 return gmetrics
@@ -241,7 +241,7 @@
  

[MediaWiki-commits] [Gerrit] Pin pep8==1.5.7 - change (pywikibot/core)

2016-01-12 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263662

Change subject: Pin pep8==1.5.7
..

Pin pep8==1.5.7

pep8 1.7.0 includes a regression in the handling of E731
which causes '# noqa' to be ignored.

Change-Id: If8a22d57f4b2b22695314810825b80c7b581a07b
---
M dev-requirements.txt
M tox.ini
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/62/263662/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index 81f4b4a..a597c7c 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -6,6 +6,7 @@
 
 nose
 
+pep8==1.5.7
 pep257>=0.6
 pyflakes>=0.9
 flake8
diff --git a/tox.ini b/tox.ini
index bd09641..42f02d5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -29,6 +29,7 @@
 basepython = python2.7
 deps = flake8
hacking
+   pep8==1.5.7
flake8-docstrings<0.2.2
flake8-putty>=0.2.0
flake8-coding
@@ -43,6 +44,7 @@
 flake8 --ignore={[flake8]ignore} {posargs}
 basepython = python3
 deps = flake8
+   pep8==1.5.7
flake8-docstrings<0.2.2
flake8-putty>=0.2.0
 

-- 
To view, visit https://gerrit.wikimedia.org/r/263662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8a22d57f4b2b22695314810825b80c7b581a07b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
Hello jenkins-bot,

I'd like you to reexamine a change.  Please visit

https://gerrit.wikimedia.org/r/234734

to look at the new patch set (#5).

Change subject: Replacing references from Bugzilla to Phabricator
..

Replacing references from Bugzilla to Phabricator

Also replace an old sf.net bug ID with a new Phabricator ID.
Remove mention of two closed bugs in script_tests.

Bug: T94683
Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43
---
M pwb.py
M pywikibot/cosmetic_changes.py
M pywikibot/data/api.py
M pywikibot/exceptions.py
M pywikibot/logentries.py
M pywikibot/login.py
M pywikibot/page.py
M pywikibot/pagegenerators.py
M pywikibot/site.py
M pywikibot/textlib.py
M scripts/blockpageschecker.py
M scripts/reflinks.py
M scripts/unusedfiles.py
M tests/archivebot_tests.py
M tests/script_tests.py
M tests/site_tests.py
16 files changed, 31 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/34/234734/5
-- 
To view, visit https://gerrit.wikimedia.org/r/234734
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <strig...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits@lists.wikimedia.org>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

___
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits


[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change.

Change subject: Replacing references from Bugzilla to Phabricator
..


Patch Set 4:

PS4 is rebase only

-- 
To view, visit https://gerrit.wikimedia.org/r/234734
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <strig...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits@lists.wikimedia.org>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-HasComments: No

___
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits


[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change.

Change subject: Replacing references from Bugzilla to Phabricator
..


Patch Set 4:

(1 comment)

https://gerrit.wikimedia.org/r/#/c/234734/4/pywikibot/textlib.py
File pywikibot/textlib.py:

Line 311: # can't handle lookahead or lookbehind (see bug 
#1731008)(bug not found):
> This bug was renumbered at sf. It could be found at [1]. The bug has been (
ya; this was just a rebase; see comments on earlier PS


-- 
To view, visit https://gerrit.wikimedia.org/r/234734
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <strig...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits@lists.wikimedia.org>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-HasComments: Yes

___
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits


[Pywikibot-commits] [Gerrit] Replacing references from Bugzilla to Phabricator - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has posted comments on this change.

Change subject: Replacing references from Bugzilla to Phabricator
..


Patch Set 1:

(8 comments)

https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/data/api.py
File pywikibot/data/api.py:

Line 1785: # bug 66619 (T68619), after gerrit 124323 breaking change we 
have a
> Why do you keep “bug 66619”? Also “gerrit 124323” is not a good identifier.
Done


Line 2082: # maybe removed when T48535 is solved
> remove this second line; T48535 is mentioned on the line above, T48535 is s
Done


https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/exceptions.py
File pywikibot/exceptions.py:

Line 293: This is considered invalid in Pywikibot. See Bug T75184.
> lowercase bug?
Done


https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/login.py
File pywikibot/login.py:

Line 286: # TODO: investigate other unhandled API codes (bug 75539)
> need to add 'T'
Done


https://gerrit.wikimedia.org/r/#/c/234734/1/pywikibot/textlib.py
File pywikibot/textlib.py:

Line 303: # can't handle lookahead or lookbehind (see bug 
#1731008)(bug not found):
> this is a SF.net bug number; see https://www.mediawiki.org/wiki/Manual:Pywi
Created T123185 for this


https://gerrit.wikimedia.org/r/#/c/234734/1/tests/script_tests.py
File tests/script_tests.py:

Line 129: 'editarticle': 'Nothing changed',  # This masks related bug 
T70645 but that
> T70645 is fixed; need to determine if this comment is still useful.
No longer needed IMO; removed.


Line 142: 'transferbot': 'Target site not different from source site',  # 
Bug T70662
> T70662 is fixed; need to determine if this comment is still useful.
No longer needed IMO; removed.


https://gerrit.wikimedia.org/r/#/c/234734/1/tests/site_tests.py
File tests/site_tests.py:

Line 608: # Bug # T17985 - reverse and start combined; fixed in v 1.14
> I guess the second # was used as “number” which does seem odd (and afaik an
Done


-- 
To view, visit https://gerrit.wikimedia.org/r/234734
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib775bfdbc96311ccb09ad9a1ee77b9970c09fd43
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <strig...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits@lists.wikimedia.org>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-HasComments: Yes

___
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits


[MediaWiki-commits] [Gerrit] Remove Wikipedia special cases from interwiki.py - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263223

Change subject: Remove Wikipedia special cases from interwiki.py
..

Remove Wikipedia special cases from interwiki.py

Wikipedia now uses Wikidata for interwiki links,
so any special cases in interwiki.py for Wikipedia
are unused code.

Change-Id: I41d2b254ce265c4f44e0ad7e72790f5dc52b0014
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/23/263223/1

diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 8887c5b..4944211 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -145,8 +145,7 @@
   * scand: All Scandinavian languages.
 
Names of families that forward their interlanguage links
-   to the wiki family being worked upon can be used (with
-   -family=wikipedia only), they are:
+   to the wiki family being worked upon can be used, they are:
   * commons:   Interlanguage links of Mediawiki Commons.
   * incubator: Links in pages on the Mediawiki Incubator.
   * meta:  Interlanguage links of named pages on Meta.
@@ -1723,65 +1722,9 @@
 break
 else:
 for (site, page) in new.items():
-# edit restriction for some templates on zh-wiki where
-# interlanguage keys are included by /doc subpage
-smallWikiAllowed = not (page.site.sitename == 'wikipedia:zh' 
and
-page.namespace() == 10 and
-u'Country data' in 
page.title(withNamespace=False))
-# edit restriction on is-wiki
-# https://is.wikipedia.org/wiki/Wikipediaspjall:V%C3%A9lmenni
-# and zh-wiki for template namespace which prevents increasing 
the queue
-# allow edits for the same conditions as -whenneeded
-# or the last edit wasn't a bot
-# or the last edit was 1 month ago
-if (smallWikiAllowed and
-globalvar.autonomous and
-(page.site.sitename == 'wikipedia:is' or
- page.site.sitename == 'wikipedia:zh' and
- page.namespace() == 10
- )):
-old = {}
-try:
-for mypage in new[page.site].interwiki():
-old[mypage.site] = mypage
-except pywikibot.NoPage:
-pywikibot.output(u"BUG>>> %s no longer exists?"
- % new[site])
-continue
-mods, mcomment, adding, removing, modifying \
-= compareLanguages(old, new, insite=site)
-# cannot create pywikibot.User with IP
-smallWikiAllowed = (
-page.isIpEdit() or
-len(removing) > 0 or
-len(old) == 0 or
-len(adding) + len(modifying) > 2 or
-(
-len(removing) + len(modifying) == 0 and
-adding == [page.site]
-)
-)
-if not smallWikiAllowed:
-user = pywikibot.User(page.site, page.userName())
-# erstmal auch keine namen mit bot
-if 'bot' not in user.groups() \
-   and 'bot' not in page.userName().lower():
-smallWikiAllowed = True
-else:
-_now = datetime.datetime.utcnow()
-_editTime = page.editTime()
-if abs((_now - _editTime).days) > 30:
-smallWikiAllowed = True
-else:
-pywikibot.output(
-u'NOTE: number of edits are restricted at 
%s'
-% page.site.sitename
-)
-
 # if we have an account for this site
 if site.family.name in config.usernames and \
site.code in config.usernames[site.family.name] and \
-   smallWikiAllowed and \
not site.has_transcluded_data:
 # Try to do the changes
 try:
@@ -1915,11 +1858,7 @@
 # put it to new means don't delete it
 if (
 not globalvar.cleanup or
-  

[MediaWiki-commits] [Gerrit] Enable flake8 checking of templatecount docstrings - change (pywikibot/core)

2016-01-10 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263220

Change subject: Enable flake8 checking of templatecount docstrings
..

Enable flake8 checking of templatecount docstrings

2b356aab fixed the docstring errors

Change-Id: Idc2ae9240f66a9b92e4298f5db6a811c4e975401
---
M tox.ini
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/20/263220/1

diff --git a/tox.ini b/tox.ini
index ed974da..bd09641 100644
--- a/tox.ini
+++ b/tox.ini
@@ -116,7 +116,7 @@
 scripts/casechecker.py,scripts/imagetransfer.py : +T001
 scripts/maintenance/make_i18n_dict.py : +T001
 
scripts/archivebot.py,scripts/casechecker.py,scripts/commons_link.py,scripts/cfd.py,scripts/featured.py,scripts/imagecopy.py,scripts/imagecopy_self.py,scripts/interwiki.py,scripts/replicate_wiki.py,scripts/solve_disambiguation.py,scripts/maintenance/compat2core.py
 : +D102, D103
-
scripts/checkimages.py,scripts/freebasemappingupload.py,scripts/imagetransfer.py,scripts/lonelypages.py,scripts/movepages.py,scripts/nowcommons.py,scripts/redirect.py,scripts/isbn.py,scripts/reflinks.py,scripts/script_wui.py,scripts/templatecount.py,scripts/revertbot.py,scripts/weblinkchecker.py,scripts/welcome.py
 : +D102
+
scripts/checkimages.py,scripts/freebasemappingupload.py,scripts/imagetransfer.py,scripts/lonelypages.py,scripts/movepages.py,scripts/nowcommons.py,scripts/redirect.py,scripts/isbn.py,scripts/reflinks.py,scripts/script_wui.py,scripts/revertbot.py,scripts/weblinkchecker.py,scripts/welcome.py
 : +D102
 
scripts/catall.py,scripts/imageharvest.py,scripts/makecat.py,scripts/maintenance/cache.py,scripts/maintenance/wikimedia_sites.py
 : +D103
 scripts/interwiki.py,/""/ : +P102
 pywikibot/__init__.py,/link_regex/ : +P103

-- 
To view, visit https://gerrit.wikimedia.org/r/263220
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc2ae9240f66a9b92e4298f5db6a811c4e975401
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   3   4   5   6   7   8   9   10   >