Skip to content

Commit

Permalink
python3 only
Browse files Browse the repository at this point in the history
  • Loading branch information
nath@thesis committed Nov 18, 2016
1 parent 2073539 commit a360c80
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions vhdltree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand All @@ -23,8 +23,7 @@ def _vhdltree(level, filepath, pattern, vhd_files):
yield level, entity, ''
else:
yield level, entity, path
for l, e, p in _vhdltree(level + 1, path, pattern, vhd_files):
yield l, e, p
yield from _vhdltree(level + 1, path, pattern, vhd_files)


def find_entities(lines, pattern):
Expand All @@ -41,8 +40,7 @@ def find_vhd(directory):
yield entry[:-4].lower(), entrypath
elif os.path.isdir(entrypath):
if all(excluder not in entry.lower() for excluder in EXCLUDES):
for component, path in find_vhd(entrypath):
yield component, path
yield from find_vhd(entrypath)


def vhdltree(filepath, proot):
Expand Down Expand Up @@ -75,6 +73,7 @@ def parse_args():
args = parser.parse_args()
return args.main, args.project


if __name__ == '__main__':
vhd_main, proot = parse_args()
vhdltree(vhd_main, proot)

0 comments on commit a360c80

Please sign in to comment.