def GetPrefs(prefname, creator='Pyth'): import macostools, os if _prefscache.has_key(prefname): return _prefscache[prefname] # Find the preferences folder and our prefs file, create if needed. fsr = Folder.FSFindFolder(Folders.kOnSystemDisk, 'pref', 1) prefsfolder = fsr.as_pathname() path = os.path.join(prefsfolder, prefname) head, tail = os.path.split(path) # make sure the folder(s) exist macostools.mkdirs(head) preffile = PrefFile(path, creator) _prefscache[prefname] = preffile return preffile
def GetPrefs(prefname, creator = 'Pyth'): import macostools, os if _prefscache.has_key(prefname): return _prefscache[prefname] # Find the preferences folder and our prefs file, create if needed. fsr = Folder.FSFindFolder(Folders.kOnSystemDisk, 'pref', 1) prefsfolder = fsr.as_pathname() path = os.path.join(prefsfolder, prefname) head, tail = os.path.split(path) # make sure the folder(s) exist macostools.mkdirs(head) preffile = PrefFile(path, creator) _prefscache[prefname] = preffile return preffile
"""An attempt at an unweave script.