Fix #1000 (Incorrect handling of CSS siblings)

This commit is contained in:
Kovid Goyal 2008-09-08 15:24:49 -07:00
parent 4dfbd4e344
commit 3d3c6c3f30
8 changed files with 26 additions and 27 deletions

View File

@ -48,7 +48,7 @@ os.chmod(loader_path, 0700)
os.environ['PYTHONHOME'] = resources_dir os.environ['PYTHONHOME'] = resources_dir
os.environ['FC_CONFIG_DIR'] = os.path.join(resources_dir, 'fonts') os.environ['FC_CONFIG_DIR'] = os.path.join(resources_dir, 'fonts')
os.environ['MAGICK_HOME'] = os.path.join(frameworks_dir, 'ImageMagick') 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) os.execv(loader_path, sys.argv)
''' '''
CHECK_SYMLINKS_PRESCRIPT = \ CHECK_SYMLINKS_PRESCRIPT = \
@ -344,7 +344,7 @@ def main():
'LSEnvironment':{ 'LSEnvironment':{
'FC_CONFIG_DIR':'@executable_path/../Resources/fonts', 'FC_CONFIG_DIR':'@executable_path/../Resources/fonts',
'MAGICK_HOME':'@executable_path/../Frameworks/ImageMagick', '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',
} }
}, },
}, },

View File

@ -71,7 +71,7 @@ if __name__ == '__main__':
def finalize_options(self): pass def finalize_options(self): pass
class pot(Command): 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') PATH = os.path.join('src', APPNAME, 'translations')
@ -104,7 +104,8 @@ if __name__ == '__main__':
sys.path.remove(os.path.abspath(self.PATH)) sys.path.remove(os.path.abspath(self.PATH))
class manual(Command): class manual(Command):
''' Build the User Manual ''' description='''Build the User Manual '''
def run(self): def run(self):
cwd = os.path.abspath(os.getcwd()) cwd = os.path.abspath(os.getcwd())
os.chdir(os.path.join('src', 'calibre', 'manual')) os.chdir(os.path.join('src', 'calibre', 'manual'))
@ -127,9 +128,7 @@ if __name__ == '__main__':
shutil.rmtree(path) shutil.rmtree(path)
class resources(Command): class resources(Command):
''' description='''Compile various resource files used in calibre. '''
Compile various resource files used in calibre.
'''
RESOURCES = dict( RESOURCES = dict(
opf_template = 'ebooks/metadata/opf.xml', opf_template = 'ebooks/metadata/opf.xml',
@ -180,9 +179,7 @@ if __name__ == '__main__':
os.remove(path) os.remove(path)
class translations(Command): class translations(Command):
''' description='''Compile the translations'''
Compile the translations
'''
PATH = os.path.join('src', APPNAME, 'translations') PATH = os.path.join('src', APPNAME, 'translations')
DEST = os.path.join(PATH, 'compiled.py') DEST = os.path.join(PATH, 'compiled.py')
@ -215,9 +212,7 @@ if __name__ == '__main__':
class gui(Command): class gui(Command):
''' description='''Compile all GUI forms and images'''
Compile all GUI forms and image related resources.
'''
PATH = os.path.join('src', APPNAME, 'gui2') PATH = os.path.join('src', APPNAME, 'gui2')
IMAGES_DEST = os.path.join(PATH, 'images_rc.py') IMAGES_DEST = os.path.join(PATH, 'images_rc.py')
@ -299,7 +294,7 @@ if __name__ == '__main__':
os.remove(images) os.remove(images)
class clean(Command): 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): def run(self):
print 'Cleaning...' print 'Cleaning...'
@ -424,3 +419,6 @@ if __name__ == '__main__':
if 'develop' in ' '.join(sys.argv) and islinux: if 'develop' in ' '.join(sys.argv) and islinux:
subprocess.check_call('calibre_postinstall --do-not-reload-udev-hal', shell=True) 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)

View File

@ -2,7 +2,6 @@
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2008, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __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 import sys, os, re, logging, time, subprocess, mechanize, atexit
from htmlentitydefs import name2codepoint from htmlentitydefs import name2codepoint
from math import floor from math import floor

View File

@ -410,6 +410,7 @@ class HTMLConverter(object, LoggingInterface):
for key in sel[0].split(','): for key in sel[0].split(','):
val = self.parse_style_properties(sel[1]) val = self.parse_style_properties(sel[1])
key = key.strip().lower() key = key.strip().lower()
if '+' in key: continue
if ':' in key: if ':' in key:
key, sep, pseudo = key.partition(':') key, sep, pseudo = key.partition(':')
if key in pdict: if key in pdict:

View File

@ -14,9 +14,6 @@ from calibre.startup import get_lang
from calibre.utils.config import Config, ConfigProxy, dynamic from calibre.utils.config import Config, ConfigProxy, dynamic
import calibre.resources as resources 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 NONE = QVariant() #: Null value to return from the data function of item models
def _config(): def _config():

View File

@ -1,6 +1,5 @@
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from lxml import html # Needed otherwise the GUI segfaults on OS X
import os, sys, textwrap, collections, traceback, time, re import os, sys, textwrap, collections, traceback, time, re
from xml.parsers.expat import ExpatError from xml.parsers.expat import ExpatError
from functools import partial from functools import partial

View File

@ -45,7 +45,7 @@ class Distribution(object):
AS_ROOT = (True, False, True) AS_ROOT = (True, False, True)
TITLEMAP = {'gentoo':'Gentoo', 'ubuntu':'Ubuntu Gutsy Gibbon', 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 = { MANUAL_MAP = {
'fedora' : '''<li>You have to upgrade Qt to at least 4.4.0 and PyQt to at least 4.4.2</li>''', 'fedora' : '''<li>You have to upgrade Qt to at least 4.4.0 and PyQt to at least 4.4.2</li>''',
@ -70,7 +70,7 @@ class Distribution(object):
for dep in self.DEPENDENCIES: for dep in self.DEPENDENCIES:
if len(cmd) > 70+offset: if len(cmd) > 70+offset:
offset += 70 offset += 70
cmd += pre cmd += pre
cmd += ' ' cmd += ' '
if dep[index]: cmd += dep[index] if dep[index]: cmd += dep[index]
self.command = cmd.strip() self.command = cmd.strip()
@ -125,7 +125,7 @@ class Download(Component):
elif os == 'linux': elif os == 'linux':
return self.linux(req) return self.linux(req)
elif 'binary' in os: elif 'binary' in os:
return self.linux_binary(req) return self.linux_binary(req)
else: else:
return self.linux_distro(req, os) return self.linux_distro(req, os)
@ -232,7 +232,7 @@ If not, head over to <a href="http://calibre.kovidgoyal.net/wiki/Development#Tra
OS({'name' : 'ubuntu', 'title': 'Ubuntu'}), OS({'name' : 'ubuntu', 'title': 'Ubuntu'}),
OS({'name' : 'fedora', 'title': 'Fedora'}), OS({'name' : 'fedora', 'title': 'Fedora'}),
OS({'name' : 'debian', 'title': 'Debian'}), OS({'name' : 'debian', 'title': 'Debian'}),
OS({'name' : 'generic','title': 'Generic', 'img':'linux'}), OS({'name' : 'generic','title': 'Install from source', 'img':'linux'}),
] ]
data = dict(title='Choose linux distribution', width=100, data = dict(title='Choose linux distribution', width=100,
operating_systems=operating_systems, font_size='x-large') operating_systems=operating_systems, font_size='x-large')

View File

@ -14,8 +14,8 @@
<div id="content" class="download"> <div id="content" class="download">
<h1><img src="${href.chrome('/dl/images/%s_logo.png'%(distro.img,))}" valign="middle" width="60" height="80"/> $title</h1> <h1><img src="${href.chrome('/dl/images/%s_logo.png'%(distro.img,))}" valign="middle" width="60" height="80"/> $title</h1>
See the <a href="/wiki/Changelog">Changelog</a> for the changes in the latest version. <b>Note:</b> As of 0.4.80 this install See the <a href="/wiki/Changelog">Changelog</a> for the changes in the latest version. <span py:if="not distro.is_generic"><b>Note:</b> As of 0.4.80 this install
will not work on 64-bit CPUs. Try the precompiled binary available <a href="/download_binary">here</a> instead. will not work on 64-bit CPUs. Try the precompiled binary available <a href="/download_binary">here</a> instead.</span>
<div py:if="not distro.is_generic"> <div py:if="not distro.is_generic">
First verify that you have a sufficiently new installation of python First verify that you have a sufficiently new installation of python
<pre class="wiki">python --version</pre> should return at least 2.5.1<br /> <pre class="wiki">python --version</pre> should return at least 2.5.1<br />
@ -35,8 +35,13 @@
<div py:if="distro.is_generic"> <div py:if="distro.is_generic">
<ol> <ol>
<li>Make sure that your system has <code>python &gt;= 2.5</code></li> <li>Make sure that your system has <code>python &gt;= 2.5</code></li>
<li>Install the various dependencies listed below: Make sure that any python packages are installed into python2.5 (e.g. setuptools, python-imaging, PyQt4, etc)</li> <li>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.</li>
<li>As root run the command <pre class="wiki">easy_install-2.5 -U TTFQuery calibre &amp;&amp; calibre_postinstall</pre></li> <li>Run the following commands in a terminal (replacing the version number with the latest calibre version):
<pre class="wiki">
wget -O- http://calibre.kovidgoyal.net/downloads/calibre-0.4.83.tar.bz2 | tar xvj
cd calibre*
python setup.py build &amp;&amp; sudo python setup.py install
</pre>
</ol> </ol>
<h2>Dependencies</h2> <h2>Dependencies</h2>
<table border="1" cellpadding="10"> <table border="1" cellpadding="10">