From 8adf54c7b4b038740c4efef069d1091d6ddd5229 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 1 Jun 2009 21:11:48 -0700 Subject: [PATCH] Misc. fixes --- installer/windows/calibre/calibre.mpi | 2 -- src/calibre/utils/fonts/__init__.py | 2 +- src/calibre/utils/ipc/launch.py | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/installer/windows/calibre/calibre.mpi b/installer/windows/calibre/calibre.mpi index ad7a8f5ded..aed72bc2bd 100644 --- a/installer/windows/calibre/calibre.mpi +++ b/installer/windows/calibre/calibre.mpi @@ -392,7 +392,6 @@ File ::6ED1C675-C4D5-6BFF-7C8A-9AB4BF39D00C -name _hashlib.pyd -parent 8E5D85A4- File ::21F7F333-3063-71E3-85F5-5C88584B15CC -name IM_MOD_RL_tga_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::26741B21-C241-E100-8BB1-8B679BC3E662 -name configure.xml -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::7D491E89-C6D3-1E6E-F4BD-8E55260FE33E -name libexpat.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 -File ::A4910EB3-0F1C-F6F0-CD2D-16A64BBAA92B -name calibre-fontconfig.exe.local -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::476CB977-5155-D56F-26CA-EB243AEBBA99 -name unrar.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::2E2A9EDA-5386-444E-8479-557386794552 -name IM_MOD_RL_uil_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::D3301E15-1B1A-E2AB-1B04-30A601B3FB44 -name IM_MOD_RL_cut_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 @@ -458,7 +457,6 @@ File ::3F6735E8-D4E6-A6F9-C9F8-4219E6BBC827 -name CORE_RL_jpeg_.dll -parent 8E5D File ::918BE500-1E97-90C0-3FB3-4056FE8D0E15 -name IM_MOD_RL_wbmp_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::D59F7D54-24A7-774D-79EB-423A64E8CB21 -name IM_MOD_RL_stegano_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::17F9A868-E52D-F961-9DB7-8AC69BA702EA -name CORE_RL_jp2_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 -File ::81715796-F363-675F-998E-EEEF890009A2 -name calibre-fontconfig.exe -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::878003DC-9B1D-7C58-29F8-14D4565ABA64 -name IM_MOD_RL_yuv_.dll -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::602B3244-CF6C-F934-E86C-8161800DB150 -name coder.xml -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 File ::C23261F0-19EA-2216-A8D6-45FCC4ECBECE -name win32file.pyd -parent 8E5D85A4-7608-47A1-CF7C-309060D5FF40 diff --git a/src/calibre/utils/fonts/__init__.py b/src/calibre/utils/fonts/__init__.py index f492132534..bc6b117147 100644 --- a/src/calibre/utils/fonts/__init__.py +++ b/src/calibre/utils/fonts/__init__.py @@ -135,7 +135,7 @@ class FontConfig(Thread): }) except UnicodeDecodeError: continue - return fonts if all else fonts[0] + return fonts if all else (fonts[0] if fonts else None) fontconfig = FontConfig() fontconfig.start() diff --git a/src/calibre/utils/ipc/launch.py b/src/calibre/utils/ipc/launch.py index 14530d7fea..2a578ed7d9 100644 --- a/src/calibre/utils/ipc/launch.py +++ b/src/calibre/utils/ipc/launch.py @@ -101,6 +101,10 @@ class Worker(object): contents = os.path.join(self.osx_contents_dir, 'console.app', 'Contents') resources = os.path.join(contents, 'Resources') fd = os.path.join(contents, 'Frameworks') + sp = os.path.join(resources, 'lib', 'python'+sys.version[:3], 'site-packages.zip') + self.osx_prefix = 'import sys; sys.frameworks_dir = "%s"; sys.frozen = "macosx_app"; '%fd + self.osx_prefix += 'sys.path.insert(0, %s); '%repr(sp) + self._env['PYTHONHOME'] = resources self._env['MAGICK_HOME'] = os.path.join(fd, 'ImageMagick') self._env['DYLD_LIBRARY_PATH'] = os.path.join(fd, 'ImageMagick', 'lib') @@ -124,7 +128,7 @@ class Worker(object): priority = prefs['worker_process_priority'] cmd = [exe] if isosx: - cmd += ['-c', 'from calibre.utils.worker import main; main()'] + cmd += ['-c', self.osx_prefix + 'from calibre.utils.ipc.worker import main; main()'] args = { 'env' : env, 'cwd' : _cwd,