DrTrigon has uploaded a new change for review.

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


Change subject: bug fix; solve bug introduced by r11524 and reported by 
totoazero and xqt
......................................................................

bug fix; solve bug introduced by r11524 and reported by totoazero and xqt

Change-Id: I30c0efab5cb2c3dfc0cb574792e7a17a5a00e2a3
---
M externals/__init__.py
1 file changed, 15 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/17/76317/1

diff --git a/externals/__init__.py b/externals/__init__.py
index dfd4f20..7b18c26 100644
--- a/externals/__init__.py
+++ b/externals/__init__.py
@@ -279,14 +279,21 @@
         return False
     else:
         files = dependency_dictionary[distro]
-        if files and show_question(files):
-            callable_ = globals()[distro.replace('-', '_') + '_install']
+        func = distro.replace('-', '_') + '_install'
+        if files and (func in globals()) and show_question(files):
+            callable_ = globals()[func]
             return callable_(files)
         else:
             return False
 
 
+def sunos_install(dependency_dictionary):
+    lowlevel_warning(u'Not implemented yet, download mode will be used.')
+    return False    # skip this in order to trigger 'download_install' next
+
+
 def windows_install(dependency_dictionary):
+    lowlevel_warning(u'Not available in windows OS, download mode will be 
used.')
     return False    # skip this in order to trigger 'download_install' next
 
 ### END of VisTrails inspired and copied code   ### ### ### ### ### ### ### ###
@@ -373,11 +380,15 @@
         return
 
     # install the missing module
-    dist = guess_system().split(u'-')
-    if globals()[dist[0] + '_install'](modules_needed[m][0]):
+    dist = guess_system()
+    func = dist.split(u'-')[0] + '_install'
+    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
+    lowlevel_warning(u'Trying to install by download from source URL:')
     if download_install(modules_needed[m][1], m, path):
         return
+    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

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30c0efab5cb2c3dfc0cb574792e7a17a5a00e2a3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to