Ignore:
Timestamp:
11/14/12 13:29:40 (17 months ago)
Author:
Matija Polajnar <matija.polajnar@…>
Branch:
default
Message:

Add-ons: enable uninstallation on systems with pip installed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngDlgs.py

    r11023 r11025  
    77from orngCanvasItems import MyCanvasText 
    88import OWGUI, sys, os 
     9 
     10has_pip = True 
     11try: 
     12    import pip.req 
     13except ImportError: 
     14    has_pip = False 
    915 
    1016# this class is needed by signalDialog to show widgets and lines 
     
    941947 
    942948    def cbToggled(self, item): 
     949        ao = self.getAddOnFromItem(item) 
     950        if ao and not has_pip and ao.installed_version and item.checkState()==Qt.Unchecked: 
     951            QMessageBox.warning(self, "Unable to uninstall", "Pip is not installed on your system. Without it, automated removal of add-ons is not possible.\n\nInstall pip (try 'easy_install --user pip') and restart Orange to make this action possible.") 
     952            item.setCheckState(Qt.Checked) 
    943953        self.refreshInfoPane(item) 
    944954 
Note: See TracChangeset for help on using the changeset viewer.