Use pathclass.glob.
This commit is contained in:
parent
25feaf60a5
commit
7c3ef856e8
1 changed files with 6 additions and 2 deletions
|
@ -14,8 +14,12 @@ log = vlogging.getLogger(__name__, 'lint_argparse_returns')
|
||||||
def main(argv):
|
def main(argv):
|
||||||
return_status = 0
|
return_status = 0
|
||||||
|
|
||||||
files = pathclass.glob('*.py')
|
patterns = argv[:]
|
||||||
files = (f for f in files if f.is_file)
|
if patterns:
|
||||||
|
files = pathclass.glob_many(patterns, files=True)
|
||||||
|
else:
|
||||||
|
files = pathclass.glob('*.py', files=True)
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
no_py = file.replace_extension('').basename
|
no_py = file.replace_extension('').basename
|
||||||
text = file.open('r', encoding='utf-8').read()
|
text = file.open('r', encoding='utf-8').read()
|
||||||
|
|
Loading…
Reference in a new issue