mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1770 (Calibre does not start)
This commit is contained in:
commit
219b1e7b64
@ -97,7 +97,7 @@ OPF_MIME = types_map['.opf']
|
|||||||
PAGE_MAP_MIME = 'application/oebps-page-map+xml'
|
PAGE_MAP_MIME = 'application/oebps-page-map+xml'
|
||||||
OEB_DOC_MIME = 'text/x-oeb1-document'
|
OEB_DOC_MIME = 'text/x-oeb1-document'
|
||||||
OEB_CSS_MIME = 'text/x-oeb1-css'
|
OEB_CSS_MIME = 'text/x-oeb1-css'
|
||||||
OPENTYPE_MIME = 'font/opentype' # Shouldn't this be 'application/x-font-opentype' as opentype/font doesn't actually exist in the IETF?
|
OPENTYPE_MIME = 'application/x-font-opentype'
|
||||||
GIF_MIME = types_map['.gif']
|
GIF_MIME = types_map['.gif']
|
||||||
JPEG_MIME = types_map['.jpeg']
|
JPEG_MIME = types_map['.jpeg']
|
||||||
PNG_MIME = types_map['.png']
|
PNG_MIME = types_map['.png']
|
||||||
@ -177,7 +177,7 @@ URL_SAFE = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|||||||
'0123456789' '_.-/~')
|
'0123456789' '_.-/~')
|
||||||
URL_UNSAFE = [ASCII_CHARS - URL_SAFE, UNIBYTE_CHARS - URL_SAFE]
|
URL_UNSAFE = [ASCII_CHARS - URL_SAFE, UNIBYTE_CHARS - URL_SAFE]
|
||||||
|
|
||||||
def urlquote(href): # Why do you have a private implementation of urlquote?
|
def urlquote(href):
|
||||||
result = []
|
result = []
|
||||||
unsafe = 0 if isinstance(href, unicode) else 1
|
unsafe = 0 if isinstance(href, unicode) else 1
|
||||||
unsafe = URL_UNSAFE[unsafe]
|
unsafe = URL_UNSAFE[unsafe]
|
||||||
@ -282,7 +282,9 @@ class Metadata(object):
|
|||||||
class Attribute(object):
|
class Attribute(object):
|
||||||
|
|
||||||
def __init__(self, attr, allowed=None):
|
def __init__(self, attr, allowed=None):
|
||||||
self.attr = attr if callable(attr) else lambda x: attr
|
if not callable(attr):
|
||||||
|
attr_, attr = attr, lambda term: attr_
|
||||||
|
self.attr = attr
|
||||||
self.allowed = allowed
|
self.allowed = allowed
|
||||||
|
|
||||||
def term_attr(self, obj):
|
def term_attr(self, obj):
|
||||||
|
@ -294,7 +294,7 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
self.stack.setCurrentIndex(0)
|
self.stack.setCurrentIndex(0)
|
||||||
try:
|
try:
|
||||||
db = LibraryDatabase2(self.library_path)
|
db = LibraryDatabase2(self.library_path)
|
||||||
except OSError, err:
|
except Exception, err:
|
||||||
error_dialog(self, _('Bad database location'), unicode(err)).exec_()
|
error_dialog(self, _('Bad database location'), unicode(err)).exec_()
|
||||||
dir = unicode(QFileDialog.getExistingDirectory(self,
|
dir = unicode(QFileDialog.getExistingDirectory(self,
|
||||||
_('Choose a location for your ebook library.'), os.path.expanduser('~')))
|
_('Choose a location for your ebook library.'), os.path.expanduser('~')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user