Compare commits

...

5 Commits

Author SHA1 Message Date
ktyl 45fc27f1a8 only strip newlines 2022-10-04 22:00:10 +01:00
ktyl b615241f8c dont print filename lol 2022-05-27 00:39:32 +01:00
ktyl 0a89675cca allow multiple include dirs 2022-05-27 00:34:36 +01:00
ktyl 1c1265c6fe update todo 2021-12-23 22:55:26 +00:00
ktyl 62af4e0210 update todo 2021-12-16 20:42:37 +00:00
2 changed files with 11 additions and 2 deletions

10
ppp.py
View File

@ -11,6 +11,8 @@ if argc < 3:
print_usage()
sys.exit(1)
includes = sys.argv[2:]
# figure out src dir from root argument
sep="/"
src_dir = sep.join(sys.argv[2].split(sep)[:-1])
@ -26,7 +28,7 @@ def preprocess_file(path):
with open(path) as f:
content = f.readlines()
content = [x.strip() for x in content]
content = [x.strip('\n') for x in content]
lines=len(content)
for l in content:
@ -36,7 +38,11 @@ def preprocess_file(path):
include_path = l.split(" ")[1]
# prepend directory
include_path = "/".join([src_dir, include_path])
#include_path = "/".join([src_dir, include_path])
for inc in includes:
if os.path.basename(inc) == include_path:
include_path = inc
break
preprocess_file(include_path)
continue

View File

@ -0,0 +1,3 @@
* [ ] strip strings
* [ ] template parameters
* [ ] inject position parameters into #0# #1# in template file