@@ -1157,7 +1157,7 @@ def _create_section(itm, items, uid):
1157
1157
_parent = itm
1158
1158
_content = _parent .find ('content' )
1159
1159
1160
- if _content != None :
1160
+ if _content is not None :
1161
1161
if _content .get ('src' ) == '' :
1162
1162
_content .set ('src' , item .href )
1163
1163
@@ -1171,7 +1171,7 @@ def _create_section(itm, items, uid):
1171
1171
_parent = itm
1172
1172
_content = _parent .find ('content' )
1173
1173
1174
- if _content != None :
1174
+ if _content is not None :
1175
1175
if _content .get ('src' ) == '' :
1176
1176
_content .set ('src' , item .file_name )
1177
1177
@@ -1349,7 +1349,7 @@ def _load_manifest(self):
1349
1349
elif 'cover' in properties :
1350
1350
ei = EpubCoverHtml ()
1351
1351
1352
- ei .content = self .read_file (os_path .join (self .opf_dir , unquote (r .get ('href' ))))
1352
+ ei .content = self .read_file (zip_path .join (self .opf_dir , unquote (r .get ('href' ))))
1353
1353
else :
1354
1354
ei = EpubHtml ()
1355
1355
@@ -1393,7 +1393,6 @@ def _parse_ncx(self, data):
1393
1393
def _get_children (elems , n , nid ):
1394
1394
label , content = '' , ''
1395
1395
children = []
1396
- _id = ''
1397
1396
1398
1397
for a in elems .getchildren ():
1399
1398
if a .tag == '{%s}navLabel' % NAMESPACES ['DAISY' ]:
@@ -1458,7 +1457,7 @@ def _load_spine(self):
1458
1457
try :
1459
1458
ncxFile = self .read_file (zip_path .join (self .opf_dir , self .book .get_item_with_id (toc ).get_name ()))
1460
1459
except KeyError :
1461
- raise EpubError (- 1 , 'Can not find ncx file.' )
1460
+ raise EpubException (- 1 , 'Can not find ncx file.' )
1462
1461
1463
1462
self ._parse_ncx (ncxFile )
1464
1463
@@ -1471,7 +1470,7 @@ def _load_opf_file(self):
1471
1470
try :
1472
1471
s = self .read_file (self .opf_file )
1473
1472
except KeyError :
1474
- raise EpubError (- 1 , 'Can not find container file' )
1473
+ raise EpubException (- 1 , 'Can not find container file' )
1475
1474
1476
1475
self .container = parse_string (s )
1477
1476
0 commit comments