Changeset 3507:a53c9b32c757 in orange


Ignore:
Timestamp:
04/06/07 12:14:49 (7 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
b56d55999bb9b89008ab470f9a6f753563d8ac90
Message:
  • fixed a problem with adding new categories after moving user settings on windows to users home directory
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeCanvas/orngRegistry.py

    r3495 r3507  
    173173def readAdditionalCategories(): 
    174174    dirs = __getDirectoryNames() 
    175     return [tuple([x.strip() for x in lne.split("\t")]) for lne in open(os.path.join(dirs["outputDir"], "additionalCategories"), "r")] 
     175    addCatFile = os.path.join(dirs["outputDir"], "additionalCategories") 
     176    if os.path.exists(addCatFile): 
     177        return [tuple([x.strip() for x in lne.split("\t")]) for lne in open(addCatFile, "r")] 
     178    else: 
     179        return [] 
    176180 
    177181def writeAdditionalCategories(categories): 
    178182    dirs = __getDirectoryNames() 
    179     open(os.path.join(dirs["canvasDir"], "additionalCategories"), "w").write("\n".join(["\t".join(l) for l in categories])) 
     183    open(os.path.join(dirs["outputDir"], "additionalCategories"), "w").write("\n".join(["\t".join(l) for l in categories])) 
    180184 
    181185def addWidgetCategory(category, directory, add = True): 
Note: See TracChangeset for help on using the changeset viewer.