diff options
Diffstat (limited to 'kindlecomicconverter/startup.py')
| -rw-r--r-- | kindlecomicconverter/startup.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/kindlecomicconverter/startup.py b/kindlecomicconverter/startup.py new file mode 100644 index 0000000..4c47a17 --- /dev/null +++ b/kindlecomicconverter/startup.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]> +# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]> +# +# Permission to use, copy, modify, and/or distribute this software for +# any purpose with or without fee is hereby granted, provided that the +# above copyright notice and this permission notice appear in all +# copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +# OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# + +import os +import sys +from . import __version__ +from .shared import dependencyCheck + +def start(): + dependencyCheck(3) + from . import KCC_gui + os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = "1" + KCCAplication = KCC_gui.QApplicationMessaging(sys.argv) + if KCCAplication.isRunning(): + if len(sys.argv) > 1: + KCCAplication.sendMessage(sys.argv[1]) + else: + KCCAplication.sendMessage('ARISE') + else: + KCCWindow = KCC_gui.QMainWindowKCC() + KCCUI = KCC_gui.KCCGUI(KCCAplication, KCCWindow) + if len(sys.argv) > 1: + KCCUI.handleMessage(sys.argv[1]) + sys.exit(KCCAplication.exec_()) + +def startC2E(): + dependencyCheck(2) + from .comic2ebook import main + print('comic2ebook v' + __version__ + ' - Written by Ciro Mattia Gonano and Pawel Jastrzebski.') + sys.exit(main(sys.argv[1:])) + +def startC2P(): + dependencyCheck(1) + from .comic2panel import main + print('comic2panel v' + __version__ + ' - Written by Ciro Mattia Gonano and Pawel Jastrzebski.') + sys.exit(main(sys.argv[1:])) \ No newline at end of file |