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['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',
}
},
},

View File

@ -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)

View File

@ -2,7 +2,6 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid@kovidgoyal.net>'
__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

View File

@ -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:

View File

@ -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():

View File

@ -1,6 +1,5 @@
__license__ = 'GPL v3'
__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
from xml.parsers.expat import ExpatError
from functools import partial

View File

@ -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' : '''<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:
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 <a href="http://calibre.kovidgoyal.net/wiki/Development#Tra
OS({'name' : 'ubuntu', 'title': 'Ubuntu'}),
OS({'name' : 'fedora', 'title': 'Fedora'}),
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,
operating_systems=operating_systems, font_size='x-large')

View File

@ -14,8 +14,8 @@
<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>
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
will not work on 64-bit CPUs. Try the precompiled binary available <a href="/download_binary">here</a> instead.
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.</span>
<div py:if="not distro.is_generic">
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 />
@ -35,8 +35,13 @@
<div py:if="distro.is_generic">
<ol>
<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>As root run the command <pre class="wiki">easy_install-2.5 -U TTFQuery calibre &amp;&amp; calibre_postinstall</pre></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>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>
<h2>Dependencies</h2>
<table border="1" cellpadding="10">