Changeset 3661:540ab680f0bf in orange


Ignore:
Timestamp:
05/17/07 12:10:03 (7 years ago)
Author:
Gregor <Gregor@…>
Branch:
default
Convert:
6c24c9def4a45159a48d537697b15cc2a8112aec
Message:
  • bug fix
Location:
orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeCanvas/orngRegistry.py

    r3563 r3661  
    213213        print "Error. Directory %s not found. Unable to locate widget icons." % picsDir 
    214214 
     215    home = user.home 
     216    if home[-1] == ":": 
     217        home += "\\" 
    215218    if os.name == "nt": 
    216         applicationDir = os.path.join(user.home, "Application Data") 
     219        applicationDir = os.path.join(home, "Application Data") 
    217220        if not os.path.exists(applicationDir): 
    218221            try: os.mkdir(applicationDir) 
     
    220223        outputDir = os.path.join(applicationDir, "Orange")                  # directory for saving settings and stuff 
    221224    elif sys.platform == "darwin": 
    222         applicationDir = os.path.join(user.home, "Library") 
     225        applicationDir = os.path.join(home, "Library") 
    223226        applicationDir = os.path.join(applicationDir, "Application Support") 
    224227        outputDir = os.path.join(applicationDir, "Orange") 
    225228    else: 
    226         outputDir = os.path.join(user.home, "Orange")                  # directory for saving settings and stuff 
     229        outputDir = os.path.join(home, "Orange")                  # directory for saving settings and stuff 
    227230    if not os.path.exists(outputDir): 
    228231        try: os.mkdir(outputDir)        # Vista has roaming profiles that will say that this folder does not exist and will then fail to create it, because it exists... 
     
    241244 
    242245def addWidgetDirectories(): 
     246    sys.path.append(orangeDir) 
     247    sys.path.append(widgetDir) 
    243248    if os.path.exists(widgetDir): 
    244249        for name in os.listdir(widgetDir): 
  • orange/OrangeWidgets/OWBaseWidget.py

    r3567 r3661  
    105105 
    106106        # create output directory for widget settings 
     107        home = user.home 
     108        if home[-1] == ":": 
     109            home += "\\" 
    107110        if os.name == "nt": 
    108             if not os.path.exists(os.path.join(user.home, "Application Data")): 
    109                 os.mkdir(os.path.join(user.home, "Application Data")) 
    110             self.outputDir = os.path.join(os.path.join(user.home, "Application Data"), "Orange")                  # directory for saving settings and stuff 
     111            if not os.path.exists(os.path.join(home, "Application Data")): 
     112                os.mkdir(os.path.join(home, "Application Data")) 
     113            self.outputDir = os.path.join(os.path.join(home, "Application Data"), "Orange")                  # directory for saving settings and stuff 
    111114        elif sys.platform == "darwin": 
    112             self.outputDir = os.path.join(user.home, "Library") 
     115            self.outputDir = os.path.join(home, "Library") 
    113116            self.outputDir = os.path.join(self.outputDir, "Application Support") 
    114117            self.outputDir = os.path.join(self.outputDir, "Orange") 
    115118        else: 
    116             self.outputDir = os.path.join(user.home, "Orange")                  # directory for saving settings and stuff 
     119            self.outputDir = os.path.join(home, "Orange")                  # directory for saving settings and stuff 
     120 
    117121        if not os.path.exists(self.outputDir): 
    118122            try: os.mkdir(self.outputDir)            # Vista has roaming profiles that will say that this folder does not exist and will then fail to create it, because it exists... 
    119123            except: pass 
     124             
    120125        self.outputDir = os.path.join(self.outputDir, "widgetSettings") 
    121126        if not os.path.exists(self.outputDir): 
Note: See TracChangeset for help on using the changeset viewer.