From 3d3c6c3f30cd8f3a0a4630e9795f782818a72436 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Sep 2008 15:24:49 -0700 Subject: [PATCH] Fix #1000 (Incorrect handling of CSS siblings) --- installer/osx/freeze.py | 4 ++-- setup.py | 22 +++++++++---------- src/calibre/__init__.py | 1 - src/calibre/ebooks/lrf/html/convert_from.py | 1 + src/calibre/gui2/__init__.py | 3 --- src/calibre/gui2/main.py | 1 - src/calibre/trac/plugins/download.py | 8 +++---- .../trac/plugins/templates/distro.html | 13 +++++++---- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/installer/osx/freeze.py b/installer/osx/freeze.py index 289f00e3fb..2061506a11 100644 --- a/installer/osx/freeze.py +++ b/installer/osx/freeze.py @@ -48,7 +48,7 @@ os.chmod(loader_path, 0700) os.environ['PYTHONHOME'] = resources_dir os.environ['FC_CONFIG_DIR'] = os.path.join(resources_dir, 'fonts') os.environ['MAGICK_HOME'] = os.path.join(frameworks_dir, 'ImageMagick') -os.environ['DYLD_LIBRARY_PATH'] = os.path.join(frameworks_dir, 'ImageMagick', 'lib') +os.environ['DYLD_LIBRARY_PATH'] = '%%s:%%s'%%(frameworks_dir, os.path.join(frameworks_dir, 'ImageMagick', 'lib')) os.execv(loader_path, sys.argv) ''' CHECK_SYMLINKS_PRESCRIPT = \ @@ -344,7 +344,7 @@ def main(): 'LSEnvironment':{ 'FC_CONFIG_DIR':'@executable_path/../Resources/fonts', 'MAGICK_HOME':'@executable_path/../Frameworks/ImageMagick', - 'DYLD_LIBRARY_PATH':'@executable_path/../Frameworks/ImageMagick/lib', + 'DYLD_LIBRARY_PATH':'@executable_path/../Frameworks/:@executable_path/../Frameworks/ImageMagick/lib', } }, }, diff --git a/setup.py b/setup.py index 549a0e42bd..f76abbbff1 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ if __name__ == '__main__': def finalize_options(self): pass class pot(Command): - ''' Create the .pot template for all translatable strings ''' + description = '''Create the .pot template for all translatable strings''' PATH = os.path.join('src', APPNAME, 'translations') @@ -104,7 +104,8 @@ if __name__ == '__main__': sys.path.remove(os.path.abspath(self.PATH)) class manual(Command): - ''' Build the User Manual ''' + description='''Build the User Manual ''' + def run(self): cwd = os.path.abspath(os.getcwd()) os.chdir(os.path.join('src', 'calibre', 'manual')) @@ -127,9 +128,7 @@ if __name__ == '__main__': shutil.rmtree(path) class resources(Command): - ''' - Compile various resource files used in calibre. - ''' + description='''Compile various resource files used in calibre. ''' RESOURCES = dict( opf_template = 'ebooks/metadata/opf.xml', @@ -180,9 +179,7 @@ if __name__ == '__main__': os.remove(path) class translations(Command): - ''' - Compile the translations - ''' + description='''Compile the translations''' PATH = os.path.join('src', APPNAME, 'translations') DEST = os.path.join(PATH, 'compiled.py') @@ -215,9 +212,7 @@ if __name__ == '__main__': class gui(Command): - ''' - Compile all GUI forms and image related resources. - ''' + description='''Compile all GUI forms and images''' PATH = os.path.join('src', APPNAME, 'gui2') IMAGES_DEST = os.path.join(PATH, 'images_rc.py') @@ -299,7 +294,7 @@ if __name__ == '__main__': os.remove(images) class clean(Command): - ''' Delete all computer generated files in the source tree''' + description='''Delete all computer generated files in the source tree''' def run(self): print 'Cleaning...' @@ -424,3 +419,6 @@ if __name__ == '__main__': if 'develop' in ' '.join(sys.argv) and islinux: subprocess.check_call('calibre_postinstall --do-not-reload-udev-hal', shell=True) + if 'install' in sys.argv and islinux: + subprocess.check_call('calibre_postinstall', shell=True) + diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 8b9221410d..536ac5002a 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -2,7 +2,6 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from lxml import etree # Needed on OSX to ensure the correct libxml2 is loaded import sys, os, re, logging, time, subprocess, mechanize, atexit from htmlentitydefs import name2codepoint from math import floor diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index 456cfc409f..665dbd0119 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -410,6 +410,7 @@ class HTMLConverter(object, LoggingInterface): for key in sel[0].split(','): val = self.parse_style_properties(sel[1]) key = key.strip().lower() + if '+' in key: continue if ':' in key: key, sep, pseudo = key.partition(':') if key in pdict: diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index cb699052da..2727d7b7cb 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -14,9 +14,6 @@ from calibre.startup import get_lang from calibre.utils.config import Config, ConfigProxy, dynamic import calibre.resources as resources -if isosx: - from lxml import html # Needed otherwise the GUI segfaults - NONE = QVariant() #: Null value to return from the data function of item models def _config(): diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index f707a595a4..5ae96b469f 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1,6 +1,5 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' -from lxml import html # Needed otherwise the GUI segfaults on OS X import os, sys, textwrap, collections, traceback, time, re from xml.parsers.expat import ExpatError from functools import partial diff --git a/src/calibre/trac/plugins/download.py b/src/calibre/trac/plugins/download.py index aa41278cca..90a53efa4a 100644 --- a/src/calibre/trac/plugins/download.py +++ b/src/calibre/trac/plugins/download.py @@ -45,7 +45,7 @@ class Distribution(object): AS_ROOT = (True, False, True) TITLEMAP = {'gentoo':'Gentoo', 'ubuntu':'Ubuntu Gutsy Gibbon', - 'fedora':'Fedora 8', 'debian':'Debian Sid', 'generic': 'Generic Unix'} + 'fedora':'Fedora 8', 'debian':'Debian Sid', 'generic': 'Install from source'} MANUAL_MAP = { 'fedora' : '''
  • You have to upgrade Qt to at least 4.4.0 and PyQt to at least 4.4.2
  • ''', @@ -70,7 +70,7 @@ class Distribution(object): for dep in self.DEPENDENCIES: if len(cmd) > 70+offset: offset += 70 - cmd += pre + cmd += pre cmd += ' ' if dep[index]: cmd += dep[index] self.command = cmd.strip() @@ -125,7 +125,7 @@ class Download(Component): elif os == 'linux': return self.linux(req) elif 'binary' in os: - return self.linux_binary(req) + return self.linux_binary(req) else: return self.linux_distro(req, os) @@ -232,7 +232,7 @@ If not, head over to

    $title

    - See the
    Changelog for the changes in the latest version. Note: As of 0.4.80 this install - will not work on 64-bit CPUs. Try the precompiled binary available here instead. + See the Changelog for the changes in the latest version. Note: As of 0.4.80 this install + will not work on 64-bit CPUs. Try the precompiled binary available here instead.
    First verify that you have a sufficiently new installation of python
    python --version
    should return at least 2.5.1
    @@ -35,8 +35,13 @@
    1. Make sure that your system has python >= 2.5
    2. -
    3. Install the various dependencies listed below: Make sure that any python packages are installed into python2.5 (e.g. setuptools, python-imaging, PyQt4, etc)
    4. -
    5. As root run the command
      easy_install-2.5 -U TTFQuery calibre && calibre_postinstall
    6. +
    7. Install the various dependencies listed below: Make sure that any python packages are installed into python2.5 (e.g. setuptools, python-imaging, PyQt4, etc). You will also have to install the development versions of the packages (these packages usually have -dev added to their names.
    8. +
    9. Run the following commands in a terminal (replacing the version number with the latest calibre version): +
      +wget -O- http://calibre.kovidgoyal.net/downloads/calibre-0.4.83.tar.bz2 | tar xvj 
      +cd calibre*
      +python setup.py build && sudo python setup.py install
      +            

    Dependencies