diff --git a/installer/osx/freeze.py b/installer/osx/freeze.py index c1e458caf8..1861596f61 100644 --- a/installer/osx/freeze.py +++ b/installer/osx/freeze.py @@ -246,7 +246,9 @@ _check_symlinks_prescript() print print 'Adding pdftohtml' - os.link(os.path.expanduser('~/pdftohtml'), os.path.join(frameworks_dir, 'pdftohtml')) + os.link(os.path.expanduser('~/pdftohtml/pdftohtml'), os.path.join(frameworks_dir, 'pdftohtml')) + os.link(os.path.expanduser('~/pdftohtml/libpoppler.4.dylib'), + os.path.join(frameworks_dir, 'libpoppler.4.dylib')) print 'Adding plugins' module_dir = os.path.join(resource_dir, 'lib', 'python2.6', 'lib-dynload') print 'Adding fontconfig' diff --git a/installer/windows/freeze.py b/installer/windows/freeze.py index 0829907d01..99cbb0be38 100644 --- a/installer/windows/freeze.py +++ b/installer/windows/freeze.py @@ -9,7 +9,7 @@ Freeze app into executable using py2exe. QT_DIR = 'C:\\Qt\\4.4.3' LIBUSB_DIR = 'C:\\libusb' LIBUNRAR = 'C:\\Program Files\\UnrarDLL\\unrar.dll' -PDFTOHTML = 'C:\\pdftohtml\\pdftohtml.exe' +PDFTOHTML = 'C:\\cygwin\\home\\kovid\\poppler-0.10.6\\rel\\pdftohtml.exe' IMAGEMAGICK_DIR = 'C:\\ImageMagick' FONTCONFIG_DIR = 'C:\\fontconfig' VC90 = r'C:\VC90.CRT' @@ -98,6 +98,8 @@ class BuildEXE(py2exe.build_exe.py2exe): shutil.copyfile(LIBUNRAR, os.path.join(PY2EXE_DIR, os.path.basename(LIBUNRAR))) print '\tAdding pdftohtml' shutil.copyfile(PDFTOHTML, os.path.join(PY2EXE_DIR, os.path.basename(PDFTOHTML))) + shutil.copyfile(PDFTOHTML+'.manifest', os.path.join(PY2EXE_DIR, + os.path.basename(PDFTOHTML)+'.manifest')) print '\tAdding ImageMagick' for f in os.listdir(IMAGEMAGICK_DIR): shutil.copyfile(os.path.join(IMAGEMAGICK_DIR, f), os.path.join(PY2EXE_DIR, f)) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index ff641cfbeb..2bebda380a 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.5.8' +__version__ = '0.5.9' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 6444eaa691..9dee6b2a86 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -17,10 +17,10 @@ def option_parser(): Run an embedded python interpreter. ''') - parser.add_option('--update-module', + parser.add_option('-u', '--update-module', default=False, + action='store_true', help='Update the specified module in the frozen library. '+ - 'Module specifications are of the form full.name.of.module,path_to_module.py', - default=None + 'Module specifications are of the form full.name.of.module path_to_module.py', ) parser.add_option('-c', '--command', help='Run python code.', default=None) parser.add_option('-e', '--exec-file', default=None, help='Run the python code in file.') @@ -143,7 +143,7 @@ def main(args=sys.argv): from calibre.gui2.main import main main(['calibre']) elif opts.update_module: - mod, path = opts.update_module.partition(',')[0], opts.update_module.partition(',')[-1] + mod, path = args[1:3] update_module(mod, os.path.expanduser(path)) elif opts.command: sys.argv = args[:1] diff --git a/src/calibre/ebooks/epub/input.py b/src/calibre/ebooks/epub/input.py index 919416ffdc..f134ea6abd 100644 --- a/src/calibre/ebooks/epub/input.py +++ b/src/calibre/ebooks/epub/input.py @@ -110,7 +110,7 @@ class EPUBInput(InputFormatPlugin): parts = os.path.split(opf) opf = OPF(opf, os.path.dirname(os.path.abspath(opf))) - if len(parts) > 1: + if len(parts) > 1 and parts[0]: delta = '/'.join(parts[:-1])+'/' for elem in opf.itermanifest(): elem.set('href', delta+elem.get('href')) diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index a43ca4e5e3..d5f0a9349a 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -6,13 +6,15 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import os +import os, shutil from urllib import unquote from calibre.customize.conversion import OutputFormatPlugin from calibre.ptempfile import TemporaryDirectory from calibre.constants import __appname__, __version__ from calibre import strftime, guess_type +from calibre.customize.conversion import OptionRecommendation + from lxml import etree @@ -22,6 +24,14 @@ class EPUBOutput(OutputFormatPlugin): author = 'Kovid Goyal' file_type = 'epub' + options = set([ + OptionRecommendation(name='extract_to', + help=_('Extract the contents of the generated EPUB file to the ' + 'specified directory. The contents of the directory are first ' + 'deleted, so be careful.')) + ]) + + TITLEPAGE_COVER = '''\ @@ -43,6 +53,7 @@ class EPUBOutput(OutputFormatPlugin): TITLEPAGE = '''\ + %(title)s