diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ + diff --git a/setup.py b/setup.py index 3358c17..1bb5b4b 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name = "tinypub-HakierGrzonzo", - version = "1.9", + version = "1.9.1.2", author = "Grzegorz Koperwas", author_email = "Grzegorz.Koperwas.dev@gmail.com", description = "A console based epub ebook reader.", @@ -20,5 +20,10 @@ "Development Status :: 4 - Beta", "Intended Audience :: End Users/Desktop" ], + entry_points={ + 'console_scripts': [ + 'tinypub=tinyPub.__main__:main' + ] + }, python_requires='>=3.8.1' ) diff --git a/tinyPub/__main__.py b/tinyPub/__main__.py index 2590c19..618183b 100755 --- a/tinyPub/__main__.py +++ b/tinyPub/__main__.py @@ -3,12 +3,12 @@ A python .epub ebook reader Used to be based on prompt_toolkit, but since version 1.9 is based on py_cui. """ -from htmlParser import Chapter +from tinyPub.htmlParser import Chapter import py_cui as pycui from ebooklib import epub import json, os, ebooklib, argparse from multiprocessing import Pool, cpu_count -from navParser import parse_navigation +from tinyPub.navParser import parse_navigation __version__ = '1.9' # Debug functions @@ -361,7 +361,8 @@ def handle_adnotation_menu_enter(self): self.addnotationsMenu.handle_adnotation() self.master.move_focus(self.textDisplayer) -if __name__ == '__main__': +def main(): + global config # set default path for config configPath = os.path.expanduser('~/.tinypub.json') parser = argparse.ArgumentParser(description = 'A simple ebook reader with console interface by Grzegorz Koperwas', prog = 'tinyPub', epilog = 'Configuration and reading progress is stored in ~/.tinypub.json', allow_abbrev = True) @@ -399,3 +400,7 @@ def handle_adnotation_menu_enter(self): # After exit write to config file with open(args.config, 'w+') as f: f.write(json.dumps(config, indent = 4)) + +config = None +if __name__ == '__main__': + main()