Changeset 11654:3c47a792586a in orange


Ignore:
Timestamp:
08/12/13 18:47:14 (8 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Changed the global 'addons_corrupted' flag to a function.

Location:
Orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngCanvas.pyw

    r11024 r11654  
    847847        lastRefresh = self.settings["lastAddonsRefresh"] 
    848848        dlg = orngDlgs.AddOnManagerDialog(self, self) 
    849         if t - lastRefresh > 7*24*3600 or Orange.utils.addons.addons_corrupted: 
     849        if t - lastRefresh > 7*24*3600 or Orange.utils.addons.addons_corrupted(): 
    850850            dlg.show() 
    851             if Orange.utils.addons.addons_corrupted or \ 
     851            if Orange.utils.addons.addons_corrupted() or \ 
    852852               QMessageBox.question(self, "Refresh", 
    853853                                    "List of add-ons in repository has not been refreshed for more than a week. Do you want to download the list now?", 
  • Orange/OrangeCanvas/orngDlgs.py

    r11479 r11654  
    958958            lastRefresh = self.loadtimefn() 
    959959        t = time.time() 
    960         if t - lastRefresh > 7*24*3600 or Orange.utils.addons.addons_corrupted: 
    961             if Orange.utils.addons.addons_corrupted or \ 
     960        if t - lastRefresh > 7*24*3600 or Orange.utils.addons.addons_corrupted(): 
     961            if Orange.utils.addons.addons_corrupted() or \ 
    962962               QMessageBox.question(self, "Refresh", 
    963963                                    "List of available add-ons has not been refreshed for more than a week. Do you want to download the list now?", 
  • Orange/utils/addons.py

    r11653 r11654  
    6565    return addons 
    6666 
    67 global addons_corrupted 
    68 with closing(open_addons()) as addons: 
    69     addons_corrupted = len(addons)==0 
    70  
    71 del addons 
     67 
     68def addons_corrupted(): 
     69    with closing(open_addons()) as addons: 
     70        return len(addons) == 0 
    7271 
    7372addon_refresh_callback = [] 
     
    119118        readthedocs = None 
    120119 
    121     global addons_corrupted 
    122120    docs = {} 
    123121    if progress_callback: 
     
    154152            if progress_callback: 
    155153                progress_callback(len(pkg_dict)+1, i+2) 
    156         addons_corrupted = False 
    157154 
    158155    rebuild_index() 
Note: See TracChangeset for help on using the changeset viewer.