查找满足pattern的文件
(pattern, path)
| 15 | |
| 16 | |
| 17 | def find_files(pattern, path): |
| 18 | ''' |
| 19 | 查找满足pattern的文件 |
| 20 | ''' |
| 21 | result = [] |
| 22 | for root, dirs, files in os.walk(path): |
| 23 | for name in files: |
| 24 | if fnmatch.fnmatch(name, pattern): |
| 25 | result.append(os.path.join(root, name)) |
| 26 | for name in dirs: |
| 27 | if fnmatch.fnmatch(name, pattern): |
| 28 | result.append(os.path.join(root, name)) |
| 29 | return result |
| 30 | |
| 31 | def get_commit_id(): |
| 32 | # check if git repository is clean |
no outgoing calls
no test coverage detected