diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..59e439b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include pythonlua/*.lua \ No newline at end of file diff --git a/README.md b/README.md index affe2ff..6e68435 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ Lua version: 5.2 **I want to know more about [FEATURES](#features)!** +## Installation + +```console +pip install -U git+https://github.com/dmitrii-eremin/python-lua.git +``` ## Usage diff --git a/__main__.py b/pythonlua/__main__.py similarity index 95% rename from __main__.py rename to pythonlua/__main__.py index 27b0641..e4a4c5b 100644 --- a/__main__.py +++ b/pythonlua/__main__.py @@ -33,10 +33,8 @@ def main(): parser = create_arg_parser() argv = parser.parse_args() - if not argv.no_lua_init and not argv.show_ast: - print(Translator.get_luainit()) - if argv.only_lua_init: + print(Translator.get_luainit()) return 0 input_filename = argv.inputfilename @@ -45,7 +43,7 @@ def main(): "The given filename ('{}') is not a file.".format(input_filename)) content = None - with open(input_filename, "r") as file: + with open(input_filename, "r", encoding='utf-8') as file: content = file.read() if not content: @@ -54,6 +52,9 @@ def main(): translator = Translator(Config(argv.configfilename), show_ast=argv.show_ast) lua_code = translator.translate(content) + + if not argv.no_lua_init and not argv.show_ast: + print(Translator.get_luainit()) if not argv.only_lua_init and not argv.show_ast: print(lua_code) diff --git a/setup.py b/setup.py index def0854..7104c27 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ url="https://github.com/NeonMercury/python-lua", author="Eremin Dmitry", author_email="mail@eremindmitry.ru", - licence="Apache 2.0", + license="Apache 2.0", python_requires=">=3.4", packages=find_packages(), long_description="", @@ -19,4 +19,14 @@ "Topic :: Software Development", "Topic :: Utilities", ], + install_requires=[ + "colorama==0.3.7", + "PyYAML==5.4" + ], + entry_points={ + "console_scripts": [ + "python-lua = pythonlua.__main__:main", + ], + }, + include_package_data=True, )