- dirs = cmdOutput('kpsewhich --show-path=' + kpsetype).replace('!!', '').strip()
- # remove excessive //
- dirs = re.sub('//+', '/', dirs)
-
- file_ext = '.' + type
- out = open(outfile, 'w')
- for dir in dirs.split(path_sep):
- # for each valid directory
- if os.path.isdir(dir):
- # walk down the file hierarchy
- for root,path,files in os.walk(dir):
- # check file type
- for file in files:
- if len(file) > 4 and file[-4:] == file_ext:
- # force the use of / since miktex uses / even under windows
- print >> out, root.replace('\\', '/') + '/' + file
- out.close()
+ dirs = cmdOutput('kpsewhich --show-path=' + kpsetype).replace('!!', '').strip()
+ # remove excessive //
+ dirs = re.sub('//+', '/', dirs)
+
+ file_ext = '.' + type
+ out = open(outfile, 'w')
+ for dir in dirs.split(path_sep):
+ # for each valid directory
+ if not os.path.isdir(dir):
+ continue
+ # walk down the file hierarchy
+ for root,path,files in os.walk(dir):
+ # check file type
+ for file in files:
+ if len(file) > 4 and file[-4:] == file_ext:
+ # force the use of / since miktex uses / even under windows
+ print >> out, root.replace('\\', '/') + '/' + file
+ out.close()