mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 10:46:40 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,6 +3,5 @@
|
|||||||
*.cbr
|
*.cbr
|
||||||
.idea
|
.idea
|
||||||
build
|
build
|
||||||
KindleComicConverter.egg-info
|
|
||||||
awkcc
|
awkcc
|
||||||
dist
|
.DS_Store
|
||||||
|
|||||||
@@ -266,9 +266,7 @@ def applyImgOptimization(img, isSplit=False, toRight=False):
|
|||||||
|
|
||||||
|
|
||||||
def dirImgProcess(path):
|
def dirImgProcess(path):
|
||||||
global options
|
global options, splitCount
|
||||||
global splitCount
|
|
||||||
splitCount = 0
|
|
||||||
if options.righttoleft:
|
if options.righttoleft:
|
||||||
facing = "right"
|
facing = "right"
|
||||||
else:
|
else:
|
||||||
@@ -423,7 +421,7 @@ def Usage():
|
|||||||
|
|
||||||
|
|
||||||
def main(argv=None):
|
def main(argv=None):
|
||||||
global parser, options, epub_path
|
global parser, options, epub_path, splitCount
|
||||||
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",
|
||||||
@@ -462,6 +460,7 @@ def main(argv=None):
|
|||||||
path = getWorkFolder(args[0])
|
path = getWorkFolder(args[0])
|
||||||
if options.title == 'defaulttitle':
|
if options.title == 'defaulttitle':
|
||||||
options.title = os.path.splitext(os.path.basename(args[0]))[0]
|
options.title = os.path.splitext(os.path.basename(args[0]))[0]
|
||||||
|
splitCount = 0
|
||||||
if options.imgproc:
|
if options.imgproc:
|
||||||
print "Processing images..."
|
print "Processing images..."
|
||||||
dirImgProcess(path + "/OEBPS/Images/")
|
dirImgProcess(path + "/OEBPS/Images/")
|
||||||
|
|||||||
77
setup.py
77
setup.py
@@ -1,29 +1,28 @@
|
|||||||
"""
|
"""
|
||||||
py2app/py2exe build script for KCC.
|
cx_freeze/py2app build script for KCC.
|
||||||
|
|
||||||
Will automatically ensure that all build prerequisites are available
|
Will automatically ensure that all build prerequisites are available via ez_setup
|
||||||
via ez_setup
|
|
||||||
|
|
||||||
Usage (Mac OS X):
|
|
||||||
python setup.py py2app
|
|
||||||
|
|
||||||
Usage (Windows):
|
Usage (Windows):
|
||||||
python setup.py build
|
python setup.py build
|
||||||
|
|
||||||
|
Usage (OS X):
|
||||||
|
python setup.py py2app
|
||||||
"""
|
"""
|
||||||
from ez_setup import use_setuptools
|
from ez_setup import use_setuptools
|
||||||
use_setuptools()
|
use_setuptools()
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
NAME = 'KindleComicConverter'
|
NAME = "KindleComicConverter"
|
||||||
VERSION = "2.7"
|
VERSION = "2.7"
|
||||||
mainscript = 'kcc.py'
|
MAIN = "kcc.py"
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == "darwin":
|
||||||
|
from setuptools import setup
|
||||||
extra_options = dict(
|
extra_options = dict(
|
||||||
setup_requires=['py2app'],
|
setup_requires=['py2app'],
|
||||||
app=[mainscript],
|
app=[MAIN],
|
||||||
options=dict(
|
options=dict(
|
||||||
py2app=dict(
|
py2app=dict(
|
||||||
argv_emulation=True,
|
argv_emulation=True,
|
||||||
@@ -39,50 +38,42 @@ if sys.platform == 'darwin':
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == "win32":
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
base = "Win32GUI"
|
base = "Win32GUI"
|
||||||
extra_options = dict(
|
extra_options = dict(
|
||||||
executables=[Executable("kcc.py", base=base, icon='comic2ebook.ico',
|
options = {"build_exe": {"include_files": ["comic2ebook.ico"]}},
|
||||||
appendScriptToExe=True, appendScriptToLibrary=False)],
|
executables=[Executable(MAIN, base=base, icon="comic2ebook.ico", appendScriptToExe=True, appendScriptToLibrary=False, compress=True)]
|
||||||
options=dict(
|
|
||||||
build_exe=dict(
|
|
||||||
compressed=True
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
extra_options = dict(
|
extra_options = dict(
|
||||||
# Normally unix-like platforms will use "setup.py install"
|
scripts=[MAIN],
|
||||||
# and install the main script as such
|
|
||||||
scripts=[mainscript],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=NAME,
|
name = NAME,
|
||||||
version=VERSION,
|
version = VERSION,
|
||||||
author="Ciro Mattia Gonano",
|
author = "Ciro Mattia Gonano",
|
||||||
author_email="ciromattia@gmail.com",
|
author_email = "ciromattia@gmail.com",
|
||||||
description="A tool to convert comics (CBR/CBZ/PDFs/image folders) to Mobipocket.",
|
description = "A tool to convert comics (CBR/CBZ/PDFs/image folders) to MOBI.",
|
||||||
license="ISC License (ISCL)",
|
license = "ISC License (ISCL)",
|
||||||
keywords="kindle comic mobipocket mobi cbz cbr manga",
|
keywords = "kindle comic mobipocket mobi cbz cbr manga",
|
||||||
url="http://github.com/ciromattia/kcc",
|
url = "http://github.com/ciromattia/kcc",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta'
|
'Development Status :: 4 - Beta'
|
||||||
'License :: OSI Approved :: ISC License (ISCL)',
|
'License :: OSI Approved :: ISC License (ISCL)',
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
'Environment :: MacOS X',
|
'Environment :: MacOS X',
|
||||||
'Environment :: Win32 (MS Windows)',
|
'Environment :: Win32 (MS Windows)',
|
||||||
'Environment :: X11 Applications',
|
'Environment :: X11 Applications',
|
||||||
'Intended Audience :: End Users/Desktop',
|
'Intended Audience :: End Users/Desktop',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 3',
|
||||||
'Topic :: Multimedia :: Graphics :: Graphics Conversion',
|
'Topic :: Multimedia :: Graphics :: Graphics Conversion',
|
||||||
'Topic :: Utilities'
|
'Topic :: Utilities'
|
||||||
],
|
],
|
||||||
packages=['kcc'],
|
packages=['kcc'],
|
||||||
# make sure to add custom_fixers to the MANIFEST.in
|
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
**extra_options
|
**extra_options
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ import sys
|
|||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
sys.path.insert(0, 'kcc')
|
sys.path.insert(0, 'kcc')
|
||||||
|
|
||||||
setup( name = "KindleComicConverter",
|
setup(
|
||||||
version = "2.7",
|
name = "KindleComicConverter",
|
||||||
author = "Ciro Mattia Gonano",
|
version = "2.7",
|
||||||
author_email = "ciromattia@gmail.com",
|
author = "Ciro Mattia Gonano",
|
||||||
description = "A tool to convert comics (CBR/CBZ/PDFs/image folders) to MOBI.",
|
author_email = "ciromattia@gmail.com",
|
||||||
license= " ISC License (ISCL)",
|
description = "A tool to convert comics (CBR/CBZ/PDFs/image folders) to MOBI.",
|
||||||
keywords= "kindle comic mobipocket mobi cbz cbr manga",
|
license= "ISC License (ISCL)",
|
||||||
url = "http://github.com/ciromattia/kcc",
|
keywords= "kindle comic mobipocket mobi cbz cbr manga",
|
||||||
options = {"build_exe": {}},
|
url = "http://github.com/ciromattia/kcc",
|
||||||
executables = [Executable("kcc/comic2ebook.py", appendScriptToExe=True, appendScriptToLibrary=False),
|
executables = [Executable("kcc/comic2ebook.py", appendScriptToExe=True, appendScriptToLibrary=False),
|
||||||
Executable("kcc/kindlestrip.py", appendScriptToExe=True, appendScriptToLibrary=False)]
|
Executable("kcc/kindlestrip.py", appendScriptToExe=True, appendScriptToLibrary=False)]
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user