Merge upstream changes

This commit is contained in:
Marshall T. Vandegrift 2008-07-15 17:30:21 -04:00
commit acac7bb0d1
4 changed files with 17 additions and 21 deletions

View File

@ -32,7 +32,7 @@ class BitReader(object):
class HuffReader(object):
def __init__(self, huffs, extra_flags):
def __init__(self, huffs):
self.huffs = huffs
if huffs[0][0:4] != 'HUFF' or huffs[0][4:8] != '\x00\x00\x00\x18':

View File

@ -167,14 +167,8 @@ class MobiReader(object):
self.replace_page_breaks()
self.cleanup_html()
self.processed_html = \
re.compile('<head>', re.IGNORECASE).sub(
'<head>\n'
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n'
'<style type="text/css">\n'
'blockquote { margin: 0em 0em 0em 1em; text-align: justify; }\n'
'p { margin: 0em; text-align: justify; }\n'
'</style>\n',
self.processed_html = re.compile('<head>', re.IGNORECASE).sub(
'<head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n',
self.processed_html)
soup = BeautifulSoup(self.processed_html.replace('> <', '>\n<'))
@ -220,11 +214,6 @@ class MobiReader(object):
del tag['width']
except KeyError:
pass
try:
styles.append('text-align: %s' % tag['align'])
del tag['align']
except KeyError:
pass
if styles:
tag['style'] = '; '.join(styles)

View File

@ -1259,12 +1259,12 @@ path_to_ebook to the database.
if __name__ == '__main__':
try:
sys.exit(main())
except:
except Exception, err:
if not iswindows: raise
tb = traceback.format_exc()
from PyQt4.QtGui import QErrorMessage
logfile = os.path.join(os.path.expanduser('~'), 'calibre.log')
if os.path.exists(logfile):
log = open(logfile).read()
if log.strip():
d = QErrorMessage()
d.showMessage(log)
log = open(logfile).read().decode('utf-8', 'ignore')
d = QErrorMessage('<b>Error:</b>%s<br><b>Traceback:</b><br>%s<b>Log:</b><br>'%(unicode(err), unicode(tb), log))
d.exec_()

View File

@ -131,7 +131,14 @@ Why does |app| show only some of my fonts on OS X?
The graphical user interface of |app| is not starting on Windows?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you've never used the graphical user interface before, try deleting the file library1.db (it will be somewhere under :file:`C:\\Documents and Settings` on Windows XP and :file:`C:\\Users` on Windows Vista. If that doesn't fix the problem, locate the file calibre.log (in the same places as library1.db) and post its contents in a help message on the `Forums <http://calibre.kovidgoyal.net/discussion>`_.
If you've never used the graphical user interface before, try deleting the file library1.db (it will be somewhere under :file:`C:\\Documents and Settings` on Windows XP and :file:`C:\\Users` on Windows Vista. If that doesn't fix the problem, locate the file calibre.log (in the same places as library1.db) and post its contents in a help message on the `Forums <http://calibre.kovidgoyal.net/discussion>`_. If you can't find either file, try using the windows find feature to search for them. If the files dont exist on your system, try the following:
Start a command prompt (press the windows key and R and type cmd.exe in the run dialog). At the command prompt type the command `calibre-debug` and press enter. You will se a new, green prompt. At theis prompt, type the following two lines::
from calibre.gui2.main import main
main()
Post any output you see when asking for help.
I want some feature added to |app|. What can I do?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~