117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# read dirs
def scan_dirs(self):
self.categories = []
# add main directory
for main in self.dir:
main = re.sub("^~", os.environ.get("HOME"))
main = re.sub("[$]([A-Z_]+)", lambda m: os.environ.get(m.group(1)), main)
if os.path.exists(main):
self.categories.append(main)
# prepare subdirectories list
sub = []
self.categories.append(sub)
|
|
<
|
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# read dirs
def scan_dirs(self):
self.categories = []
# add main directory
for main in self.dir:
main = os.path.expanduser(os.path.expandvars(main))
if os.path.exists(main):
self.categories.append(main)
# prepare subdirectories list
sub = []
self.categories.append(sub)
|