Changeset 9061:ea69ad26ccfa in orange


Ignore:
Timestamp:
10/05/11 14:56:50 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
075a5e0b640ce50ea162972b6b715d587ebd5b31
Message:

Move add-on repository list to orange settings directory (from canvas settings directory).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/misc/addons.py

    r8955 r9061  
    114114import re 
    115115import os 
     116import shutil 
    116117import sys 
    117118import glob 
     
    14791480    """ 
    14801481    Return the full filename of pickled add-on repository list. It resides 
    1481     within Canvas settings directory.  
    1482     """ 
    1483     canvasSettingsDir = os.path.realpath(Orange.misc.environ.canvas_settings_dir) 
    1484     listFileName = os.path.join(canvasSettingsDir, "repositoryList.pickle") 
    1485     return listFileName 
     1482    within Orange settings directory.  
     1483    """ 
     1484    orange_settings_dir = os.path.realpath(Orange.misc.environ.orange_settings_dir) 
     1485    list_file_name = os.path.join(orange_settings_dir, "repositoryList.pickle") 
     1486    if not os.path.isfile(list_file_name): 
     1487        # Try to move the config from the old location. 
     1488        try: 
     1489            canvas_settings_dir = os.path.realpath(Orange.misc.environ.canvas_settings_dir) 
     1490            old_list_file_name = os.path.join(canvas_settings_dir, "repositoryList.pickle") 
     1491            shutil.move(old_list_file_name, list_file_name) 
     1492        except: 
     1493            pass 
     1494     
     1495    return list_file_name 
    14861496 
    14871497available_repositories = None 
Note: See TracChangeset for help on using the changeset viewer.