75 If this is given, file must be a single file name. |
75 If this is given, file must be a single file name. |
76 """ |
76 """ |
77 if isinstance(fn, list): |
77 if isinstance(fn, list): |
78 files = fn |
78 files = fn |
79 elif os.path.isdir(fn): |
79 elif os.path.isdir(fn): |
|
80 # TODO: make this dependant on configured extensions |
80 files = Utilities.direntries(fn, 1, '*.py', 0) |
81 files = Utilities.direntries(fn, 1, '*.py', 0) |
81 files += Utilities.direntries(fn, 1, '*.pyw', 0) |
82 files += Utilities.direntries(fn, 1, '*.pyw', 0) |
82 files += Utilities.direntries(fn, 1, '*.ptl', 0) |
83 files += Utilities.direntries(fn, 1, '*.ptl', 0) |
83 else: |
84 else: |
84 files = [fn] |
85 files = [fn] |
|
86 # TODO: make this dependant on configured extensions |
85 files = [f for f in files \ |
87 files = [f for f in files \ |
86 if f.endswith(".py") or f.endswith(".pyw") or f.endswith(".ptl")] |
88 if f.endswith(".py") or f.endswith(".pyw") or f.endswith(".ptl")] |
87 |
89 |
88 if (codestring and len(files) == 1) or \ |
90 if (codestring and len(files) == 1) or \ |
89 (not codestring and len(files) > 0): |
91 (not codestring and len(files) > 0): |