aboutsummaryrefslogtreecommitdiffstats
path: root/src/epy_reader/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/epy_reader/__main__.py')
-rw-r--r--src/epy_reader/__main__.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/epy_reader/__main__.py b/src/epy_reader/__main__.py
new file mode 100644
index 0000000..ce7d1b2
--- /dev/null
+++ b/src/epy_reader/__main__.py
@@ -0,0 +1,23 @@
+import curses
+import multiprocessing
+import sys
+
+import epy_reader.cli as cli
+import epy_reader.reader as reader
+
+
+def main():
+ # On Windows, calling this method is necessary
+ # On Linux/OSX, this method does nothing
+ multiprocessing.freeze_support()
+ filepath, dump_only = cli.find_file()
+ if dump_only:
+ sys.exit(cli.dump_ebook_content(filepath))
+
+ while True:
+ filepath = curses.wrapper(reader.start_reading, filepath)
+
+
+# https://setuptools.pypa.io/en/latest/userguide/entry_point.html
+if __name__ == "__main__":
+ main()