Fox for new tags in Topaz format ebooks.

This commit is contained in:
Apprentice Harper
2016-04-13 18:39:13 +01:00
parent 054ddc894b
commit e2170b4260
10 changed files with 33 additions and 21 deletions

View File

@@ -9,8 +9,6 @@ __docformat__ = 'restructuredtext en'
# Released under the terms of the GNU General Public Licence, version 3
# <http://www.gnu.org/licenses/>
#
# Requires Calibre version 0.7.55 or higher.
#
# All credit given to i♥cabbages and The Dark Reverser for the original standalone scripts.
# We had the much easier job of converting them to a calibre plugin.
#
@@ -49,6 +47,7 @@ __docformat__ = 'restructuredtext en'
# 6.3.5 - Fixes for Linux, and Kobo 3.19 and more logging
# 6.3.6 - Fixes for ADE ePub and PDF introduced in 6.3.5
# 6.4.0 - Updated for new Kindle for PC encryption
# 6.4.1 - Fix for some new tags in Topaz ebooks.
"""
@@ -56,7 +55,7 @@ Decrypt DRMed ebooks.
"""
PLUGIN_NAME = u"DeDRM"
PLUGIN_VERSION_TUPLE = (6, 4, 0)
PLUGIN_VERSION_TUPLE = (6, 4, 1)
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
# Include an html helpfile in the plugin's zipfile with the following name.
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'

View File

@@ -164,6 +164,7 @@ class PageParser(object):
self.id = os.path.basename(filename).replace('.dat','')
self.dict = dict
self.debug = debug
self.first_unknown = True
self.flat_xml = flat_xml
self.tagpath = []
self.doc = []
@@ -262,6 +263,9 @@ class PageParser(object):
'img.w' : (1, 'scalar_number', 0, 0),
'img.src' : (1, 'scalar_number', 0, 0),
'img.color_src' : (1, 'scalar_number', 0, 0),
'img.gridSize' : (1, 'scalar_number', 0, 0),
'img.gridBottomCenter' : (1, 'scalar_number', 0, 0),
'img.gridTopCenter' : (1, 'scalar_number', 0, 0),
'img.gridBeginCenter' : (1, 'scalar_number', 0, 0),
'img.gridEndCenter' : (1, 'scalar_number', 0, 0),
'img.image_type' : (1, 'scalar_number', 0, 0),
@@ -506,8 +510,9 @@ class PageParser(object):
# or an out of sync condition
else:
result = []
if (self.debug):
if (self.debug or self.first_unknown):
print 'Unknown Token:', token
self.first_unknown = False
self.tag_pop()
return result