DrTrigon has uploaded a new change for review. https://gerrit.wikimedia.org/r/79977
Change subject: * solve sub-optimal messages to user (indicate needed admin rights) * add missing ubuntu package names * message improved in case if NO was chosen ...................................................................... * 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, 15 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/77/79977/1 diff --git a/externals/__init__.py b/externals/__init__.py index e7db1c4..d3f57da 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,14 @@ 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.") + " 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("Give externals permission to try to install package?" " (y/N)") v = raw_input().upper() @@ -306,7 +307,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 @@ -391,13 +392,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: newchange Gerrit-Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: DrTrigon <dr.tri...@surfeu.ch> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits