Add a list of files to the current component as specified in the glob pattern. Individual files can be excluded in the exclude list.
(self, pattern, exclude = None)
| 378 | return logical |
| 379 | |
| 380 | def glob(self, pattern, exclude = None): |
| 381 | """Add a list of files to the current component as specified in the |
| 382 | glob pattern. Individual files can be excluded in the exclude list.""" |
| 383 | try: |
| 384 | files = os.listdir(self.absolute) |
| 385 | except OSError: |
| 386 | return [] |
| 387 | if pattern[:1] != '.': |
| 388 | files = (f for f in files if f[0] != '.') |
| 389 | files = fnmatch.filter(files, pattern) |
| 390 | for f in files: |
| 391 | if exclude and f in exclude: continue |
| 392 | self.add_file(f) |
| 393 | return files |
| 394 | |
| 395 | def remove_pyc(self): |
| 396 | "Remove .pyc files on uninstall" |
no test coverage detected