From cdc8c44d801f0b20ad4600f7a6bb44cb2ca0c3d0 Mon Sep 17 00:00:00 2001 From: vicky Date: Tue, 7 Jun 2022 00:25:29 +0200 Subject: [PATCH] v0.1 --- src/bootstraparse/__main__.py | 19 +++++++++++++++++++ src/bootstraparse/bparse.py | 4 ---- src/bootstraparse/modules/sitecreator.py | 2 ++ tests/test_bparse.py | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100755 src/bootstraparse/__main__.py delete mode 100644 src/bootstraparse/bparse.py diff --git a/src/bootstraparse/__main__.py b/src/bootstraparse/__main__.py new file mode 100755 index 0000000..50af74f --- /dev/null +++ b/src/bootstraparse/__main__.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 + +# Main program, use this to start parsing +import rich + +from bootstraparse.modules import sitecreator +import argparse + +if __name__ == "__main__": + parser = argparse.ArgumentParser(prog="bootstraparse", description='Parses a folder for all .bpr files and ' + 'magically recreates the same architecture ' + 'with html translated files.') + parser.add_argument('origin', help='the root folder of all files to parse.') + parser.add_argument('destination', help="path of the folder where to output all the magic.") + # parser.add_argument("-v", "verbosity") + args = parser.parse_args() + if sitecreator.create_website(args.origin, args.destination) == 0: + rich.print("Bootstraparse run successful!") + diff --git a/src/bootstraparse/bparse.py b/src/bootstraparse/bparse.py deleted file mode 100644 index c303efd..0000000 --- a/src/bootstraparse/bparse.py +++ /dev/null @@ -1,4 +0,0 @@ -# Main program, use this to start parsing - -def to_test(): - print("This is a test") diff --git a/src/bootstraparse/modules/sitecreator.py b/src/bootstraparse/modules/sitecreator.py index 38d90a4..9d89e6c 100644 --- a/src/bootstraparse/modules/sitecreator.py +++ b/src/bootstraparse/modules/sitecreator.py @@ -15,6 +15,8 @@ def create_website(origin, destination): for element, destination in crwlr: save(preparse_parse(element), destination, env) + return 0 + def create_environment(origin, destination): """ diff --git a/tests/test_bparse.py b/tests/test_bparse.py index 394b753..ed2167b 100644 --- a/tests/test_bparse.py +++ b/tests/test_bparse.py @@ -1,5 +1,5 @@ # Test the base parser -from bootstraparse import bparse +from bootstraparse import __main__ def test_to_test():