mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 18:56:28 +00:00
Command-line version don't require PyQT anymore
This commit is contained in:
@@ -33,7 +33,10 @@ from shutil import rmtree
|
|||||||
from shutil import make_archive
|
from shutil import make_archive
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from multiprocessing import Pool, Queue, freeze_support
|
from multiprocessing import Pool, Queue, freeze_support
|
||||||
from PyQt4 import QtCore
|
try:
|
||||||
|
from PyQt4 import QtCore
|
||||||
|
except ImportError:
|
||||||
|
QtCore = None
|
||||||
import image
|
import image
|
||||||
import cbxarchive
|
import cbxarchive
|
||||||
import pdfjpgextract
|
import pdfjpgextract
|
||||||
@@ -630,7 +633,7 @@ def Usage():
|
|||||||
|
|
||||||
|
|
||||||
def main(argv=None, qtGUI=None):
|
def main(argv=None, qtGUI=None):
|
||||||
global parser, options, epub_path, splitCount
|
global parser, options, epub_path, splitCount, GUI
|
||||||
usage = "Usage: %prog [options] comic_file|comic_folder"
|
usage = "Usage: %prog [options] comic_file|comic_folder"
|
||||||
parser = OptionParser(usage=usage, version=__version__)
|
parser = OptionParser(usage=usage, version=__version__)
|
||||||
parser.add_option("-p", "--profile", action="store", dest="profile", default="KHD",
|
parser.add_option("-p", "--profile", action="store", dest="profile", default="KHD",
|
||||||
@@ -674,9 +677,10 @@ def main(argv=None, qtGUI=None):
|
|||||||
options, args = parser.parse_args(argv)
|
options, args = parser.parse_args(argv)
|
||||||
checkOptions()
|
checkOptions()
|
||||||
if qtGUI:
|
if qtGUI:
|
||||||
global GUI
|
|
||||||
GUI = qtGUI
|
GUI = qtGUI
|
||||||
GUI.emit(QtCore.SIGNAL("progressBarTick"), 1)
|
GUI.emit(QtCore.SIGNAL("progressBarTick"), 1)
|
||||||
|
else:
|
||||||
|
GUI = None
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user