aboutsummaryrefslogtreecommitdiffstats
path: root/src/epy_reader/__main__.py
blob: ce7d1b28e142ec134a31028d1d83bb93fffce40f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()