-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e477df0
Showing
3 changed files
with
593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
.DEFAULT_GOAL := run | ||
|
||
.PHONY: compile | ||
compile: journey.abs ## Compile the model | ||
absc -e journey.abs | ||
|
||
.PHONY: run | ||
run: compile ## Compile and run the model | ||
gen/erl/run | python extract-summary-files.py | ||
|
||
.PHONY: serve | ||
serve: compile ## Compile and run the model, including web api on port 8080 | ||
gen/erl/run -p 8080 | ||
|
||
.PHONY: clean | ||
clean: ## Clean build artifacts | ||
rm -rf gen/ *.csv | ||
|
||
# "make print-PATH" prints the value of PATH, etc. | ||
print-%: ; @echo $*=$($*) | ||
|
||
.PHONY: help | ||
help: ## Output this help message | ||
@grep -E '^[a-zA-Z_%-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import re | ||
import sys | ||
|
||
def write_to_file(filename, lines): | ||
with open(filename, 'w') as file: | ||
for line in lines: | ||
file.write(line) | ||
|
||
def main(): | ||
current_file = None | ||
current_lines = [] | ||
|
||
filename_pattern = re.compile(r"===== ([a-zA-Z0-9._]+) =====") | ||
|
||
for line in sys.stdin: | ||
match = filename_pattern.match(line.strip()) | ||
if match: | ||
if current_file is not None: | ||
write_to_file(current_file, current_lines) | ||
current_lines = [] | ||
|
||
current_file = match.group(1) # Extract the filename from the matched pattern | ||
else: | ||
current_lines.append(line) | ||
|
||
if current_file is not None: | ||
write_to_file(current_file, current_lines) | ||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.