jenkins-bot has submitted this change and it was merged.
Change subject: bug fix for 1655
......................................................................
bug fix for 1655
* solve sub-optimal messages to user (indicate needed admin rights)
* add missing ubuntu package names
* message improved in case if NO was chosen
Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e
---
M externals/__init__.py
1 file changed, 16 insertions(+), 8 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/externals/__init__.py b/externals/__init__.py
index 3bb6677..c94047c 100644
--- a/externals/__init__.py
+++ b/externals/__init__.py
@@ -55,12 +55,12 @@
# spelling
http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/
# $ git submodule add
https://gerrit.wikimedia.org/r/p/pywikibot/spelling.git externals/spelling
'BeautifulSoup.py': ({'linux-fedora':
['python-BeautifulSoup'],
- 'linux-ubuntu': ['']},
+ 'linux-ubuntu': ['python-beautifulsoup']},
{ 'url':
'https://pypi.python.org/packages/source/B/BeautifulSoup/BeautifulSoup-3.2.0.tar.gz',
'path':
'BeautifulSoup-3.2.0/BeautifulSoup.py'},
{}), # OK
'irclib': ({'linux-fedora': ['python-irclib'],
- 'linux-ubuntu': ['']},
+ 'linux-ubuntu': ['python-irclib']},
{}, #
http://python-irclib.sourceforge.net/
{}), # OK
'mwparserfromhell': ({},
@@ -197,13 +197,15 @@
return ("%s-%s" % (platform.system(), platform.dist()[0])).lower()
-def show_question(which_files):
+def show_question(which_files, admin=True):
lowlevel_warning("Required package missing: %s" % which_files)
lowlevel_warning("A required package is missing, but externals can"
- " automatically install it."
- " If you say Yes, externals will need administrator"
- " privileges, and you might be asked for the
administrator"
- " password. For more info, please confer:\n"
+ " automatically install it.")
+ if admin:
+ lowlevel_warning("If you say Yes, externals will need administrator"
+ " privileges, and you might be asked for the"
+ " administrator password.")
+ lowlevel_warning("For more info, please confer:\n"
"
http://www.mediawiki.org/wiki/Manual:Pywikipediabot/"
"Installation#Dependencies")
lowlevel_warning("Give externals permission to try to install package?"
@@ -308,7 +310,7 @@
def download_install(package, module, path):
- if package and show_question(module):
+ if package and show_question(module, admin=False):
lowlevel_warning(u'Download package "%s" from %s'
% (module, package['url']))
import mimetypes
@@ -393,13 +395,19 @@
lowlevel_warning(u'Trying to install by use of "%s" package management
system:' % dist)
if (func in globals()) and globals()[func](modules_needed[m][0]):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Trying to install by download from source URL:')
if download_install(modules_needed[m][1], m, path):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Trying to install by use of mercurial:')
if (len(modules_needed[m]) > 2) and\
mercurial_repo_install(modules_needed[m][2], m, path):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Package "%s" could not be found nor installed!'
% m)
lowlevel_warning(u'Several scripts might fail, if some modules are not'
--
To view, visit
https://gerrit.wikimedia.org/r/79977
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Nikerabbit <niklas.laxstrom(a)gmail.com>
Gerrit-Reviewer: jenkins-bot