2 from os
.path
import exists
11 path
= os
.environ
['CHOICESPATH']
12 paths
= string
.split(path
, ':')
14 paths
= [ os
.environ
['HOME'] + '/Choices',
15 '/usr/local/share/Choices',
16 '/usr/share/Choices' ]
19 "Eg ('Edit', 'Options') - > '/usr/local/share/Choices/Edit/Options'"
26 full
= path
+ '/' + dir + '/' + leaf
32 def save(dir, leaf
, create
= 1):
33 "As for load. Returns a path to save to, or None if saving is disabled."
34 "If 'create' is FALSE then no directories are created."
42 if create
and not os
.path
.exists(p
):
45 if create
and not os
.path
.exists(p
):