diff --git a/pickora.py b/pickora.py index e11aca3..6888952 100644 --- a/pickora.py +++ b/pickora.py @@ -25,7 +25,7 @@ def excepthook(etype, value, tb): sys.excepthook = excepthook -if __name__ == "__main__": +def cli(): description = "A toy compiler that can convert Python scripts to pickle bytecode." epilog = "Documentation can be found at https://github.com/splitline/Pickora" parser = argparse.ArgumentParser(description=description, epilog=epilog) @@ -59,3 +59,6 @@ def excepthook(etype, value, tb): if args.eval: ret = pickle.loads(bytecode) print("[+] pickle.loads returns:", repr(ret)) + +if __name__ == "__main__": + cli() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..03de159 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.poetry] +name = "pickora" +version = "0.1.0" +description = "A toy compiler that can convert Python scripts to pickle bytecode." +documentation = "https://github.com/splitline/Pickora" +authors = ["splitline "] +include = ["compiler.py", "helper.py"] + +[tool.poetry.dependencies] +python = "^3.8" + +[tool.poetry.scripts] +pickora = 'pickora:cli' + +[tool.poetry.urls] +"Documentation" = "https://github.com/splitline/Pickora" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api"