summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-12-08 01:26:09 -0500
committeryenatch <yenatch@gmail.com>2013-12-08 01:26:09 -0500
commitf35bb2c5cc390ec0008cede2721104592dbcb29d (patch)
treee67b050699c67113e34902e410d1219e60511820
parentf5ddc3370560a4b5f58ea79a513d4bf1207fa9f4 (diff)
scan_includes: join names properly and actually use conf.path
-rw-r--r--pokemontools/scan_includes.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pokemontools/scan_includes.py b/pokemontools/scan_includes.py
index 138f011..7f34e92 100644
--- a/pokemontools/scan_includes.py
+++ b/pokemontools/scan_includes.py
@@ -22,13 +22,15 @@ def recursive_scan(filename, includes = []):
include = line.split('"')[1]
if include not in includes:
includes += [include]
- includes = recursive_scan(include, includes)
+ includes = recursive_scan(os.path.join(conf.path, include), includes)
break
return includes
if __name__ == '__main__':
filenames = sys.argv[1:]
+ dependencies = []
for filename in filenames:
- dependencies = recursive_scan(os.path.join(conf.path, filename))
- sys.stdout.write(' '.join(dependencies))
+ dependencies += recursive_scan(os.path.join(conf.path, filename))
+ dependencies = list(set(dependencies))
+ sys.stdout.write(' '.join(dependencies))