mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Diagnostic catalog to display NCX under construction
This commit is contained in:
commit
f57cc0a695
@ -519,159 +519,223 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
self.__verbose = opts.verbose
|
self.__verbose = opts.verbose
|
||||||
|
|
||||||
# Accessors
|
# Accessors
|
||||||
def getauthors(self):
|
'''
|
||||||
return self.__authors
|
@dynamic_property
|
||||||
def setauthors(self, value):
|
def xxxx(self):
|
||||||
self.__authors = value
|
def fget(self):
|
||||||
authors = property(getauthors, setauthors)
|
return self.__
|
||||||
|
def fset(self, val):
|
||||||
|
self.__ = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
'''
|
||||||
|
|
||||||
def getbasename(self):
|
@dynamic_property
|
||||||
return self.__basename
|
def authors(self):
|
||||||
def setbasename(self, value):
|
def fget(self):
|
||||||
self.__authors = value
|
return self.__authors
|
||||||
basename = property(getbasename, setbasename)
|
def fset(self, val):
|
||||||
|
self.__authors = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getbooksByAuthor(self):
|
@dynamic_property
|
||||||
return self.__booksByAuthor
|
def basename(self):
|
||||||
def setbooksByAuthor(self, value):
|
def fget(self):
|
||||||
self.__booksByAuthor = value
|
return self.__basename
|
||||||
booksByAuthor = property(getbooksByAuthor, setbooksByAuthor)
|
def fset(self, val):
|
||||||
|
self.__basename = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getbooksByTitle(self):
|
@dynamic_property
|
||||||
return self.__booksByTitle
|
def booksByAuthor(self):
|
||||||
def setbooksByTitle(self, value):
|
def fget(self):
|
||||||
self.__booksByTitle = value
|
return self.__booksByAuthor
|
||||||
booksByTitle = property(getbooksByTitle, setbooksByTitle)
|
def fset(self, val):
|
||||||
|
self.__booksByAuthor = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getcatalogPath(self):
|
@dynamic_property
|
||||||
return self.__catalogPath
|
def booksByTitle(self):
|
||||||
def setcatalogPath(self, value):
|
def fget(self):
|
||||||
self.__catalogPath = value
|
return self.__booksByTitle
|
||||||
catalogPath = property(getcatalogPath, setcatalogPath)
|
def fset(self, val):
|
||||||
|
self.__booksByTitle = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getcontentDir(self):
|
@dynamic_property
|
||||||
return self.__contentDir
|
def catalogPath(self):
|
||||||
def setcontentDir(self, value):
|
def fget(self):
|
||||||
self.__contentDir = value
|
return self.__catalogPath
|
||||||
contentDir = property(getcontentDir, setcontentDir)
|
def fset(self, val):
|
||||||
|
self.__catalogPath = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getcreator(self):
|
@dynamic_property
|
||||||
return self.__creator
|
def contentDir(self):
|
||||||
def setcreator(self, value):
|
def fget(self):
|
||||||
self.__creator = value
|
return self.__contentDir
|
||||||
creator = property(getcreator, setcreator)
|
def fset(self, val):
|
||||||
|
self.__contentDir = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getdatabaseSnapshot(self):
|
@dynamic_property
|
||||||
return self.__databaseSnapshot
|
def creator(self):
|
||||||
def setdatabaseSnapshot(self, value):
|
def fget(self):
|
||||||
self.__databaseSnapshot = value
|
return self.__creator
|
||||||
databaseSnapshot = property(getdatabaseSnapshot, setdatabaseSnapshot)
|
def fset(self, val):
|
||||||
|
self.__creator = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getdb(self):
|
@dynamic_property
|
||||||
return self.__db
|
def databaseSnapshot(self):
|
||||||
db = property(getdb)
|
def fget(self):
|
||||||
|
return self.__databaseSnapshot
|
||||||
|
def fset(self, val):
|
||||||
|
self.__databaseSnapshot = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getdescriptionClip(self):
|
@dynamic_property
|
||||||
return self.__descriptionClip
|
def db(self):
|
||||||
def setdescriptionClip(self, value):
|
def fget(self):
|
||||||
self.__descriptionClip = value
|
return self.__db
|
||||||
descriptionClip = property(getdescriptionClip, setdescriptionClip)
|
return property(fget=fget)
|
||||||
|
|
||||||
def geterror(self):
|
@dynamic_property
|
||||||
return self.__error
|
def descriptionClip(self):
|
||||||
error = property(geterror)
|
def fget(self):
|
||||||
|
return self.__descriptionClip
|
||||||
|
def fset(self, val):
|
||||||
|
self.__descriptionClip = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getgenerateForMobigen(self):
|
@dynamic_property
|
||||||
return self.__generateForMobigen
|
def error(self):
|
||||||
def setgenerateForMobigen(self, value):
|
def fget(self):
|
||||||
self.__generateForMobigen = value
|
return self.__error
|
||||||
generateForMobigen = property(getgenerateForMobigen, setgenerateForMobigen)
|
return property(fget=fget)
|
||||||
|
|
||||||
def getgenres(self):
|
@dynamic_property
|
||||||
return self.__genres
|
def generateForMobigen(self):
|
||||||
def setgenres(self, value):
|
def fget(self):
|
||||||
self.__genres = value
|
return self.__generateForMobigen
|
||||||
genres = property(getgenres, setgenres)
|
def fset(self, val):
|
||||||
|
self.__generateForMobigen = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def gethtmlFileList(self):
|
@dynamic_property
|
||||||
return self.__htmlFileList
|
def genres(self):
|
||||||
def sethtmlFileList(self, value):
|
def fget(self):
|
||||||
self.__htmlFileList = value
|
return self.__genres
|
||||||
htmlFileList = property(gethtmlFileList, sethtmlFileList)
|
def fset(self, val):
|
||||||
|
self.__genres = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getlibraryPath(self):
|
@dynamic_property
|
||||||
return self.__libraryPath
|
def htmlFileList(self):
|
||||||
def setlibraryPath(self, value):
|
def fget(self):
|
||||||
self.__libraryPath = value
|
return self.__htmlFileList
|
||||||
libraryPath = property(getlibraryPath, setlibraryPath)
|
def fset(self, val):
|
||||||
|
self.__htmlFileList = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getncxSoup(self):
|
@dynamic_property
|
||||||
return self.__ncxSoup
|
def libraryPath(self):
|
||||||
def setncxSoup(self, value):
|
def fget(self):
|
||||||
self.__ncxSoup = value
|
return self.__libraryPath
|
||||||
ncxSoup = property(getncxSoup, setncxSoup)
|
def fset(self, val):
|
||||||
|
self.__libraryPath = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getopts(self):
|
@dynamic_property
|
||||||
return self.__opts
|
def ncxSoup(self):
|
||||||
opts = property(getopts)
|
def fget(self):
|
||||||
|
return self.__ncxSoup
|
||||||
|
def fset(self, val):
|
||||||
|
self.__ncxSoup = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getplayOrder(self):
|
@dynamic_property
|
||||||
return self.__playOrder
|
def opts(self):
|
||||||
def setplayOrder(self, value):
|
def fget(self):
|
||||||
self.__playOrder = value
|
return self.__opts
|
||||||
playOrder = property(getplayOrder, setplayOrder)
|
return property(fget=fget)
|
||||||
|
|
||||||
def getplugin(self):
|
@dynamic_property
|
||||||
return self.__plugin
|
def playOrder(self):
|
||||||
plugin = property(getplugin)
|
def fget(self):
|
||||||
|
return self.__playOrder
|
||||||
|
def fset(self,val):
|
||||||
|
self.__playOrder = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getpluginPath(self):
|
@dynamic_property
|
||||||
return self.__plugin_path
|
def plugin(self):
|
||||||
def setpluginPath(self, value):
|
def fget(self):
|
||||||
self.__plugin_path = value
|
return self.__plugin
|
||||||
pluginPath = property(getpluginPath, setpluginPath)
|
return property(fget=fget)
|
||||||
|
|
||||||
def getprogressInt(self):
|
@dynamic_property
|
||||||
return self.__progressInt
|
def pluginPath(self):
|
||||||
def setprogressInt(self, value):
|
def fget(self):
|
||||||
self.__progressInt = value
|
return self.__pluginPath
|
||||||
progressInt = property(getprogressInt, setprogressInt)
|
def fset(self, val):
|
||||||
|
self.__pluginPath = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getprogressString(self):
|
@dynamic_property
|
||||||
return self.__progressString
|
def progressInt(self):
|
||||||
def setprogressString(self, value):
|
def fget(self):
|
||||||
self.__progressString = value
|
return self.__progressInt
|
||||||
progressString = property(getprogressString, setprogressString)
|
def fset(self, val):
|
||||||
|
self.__progressInt = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getreporter(self):
|
@dynamic_property
|
||||||
return self.__reporter
|
def progressString(self):
|
||||||
def setreporter(self, value):
|
def fget(self):
|
||||||
self.__reporter = value
|
return self.__progressString
|
||||||
reporter = property(getreporter, setreporter)
|
def fset(self, val):
|
||||||
|
self.__progressString = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getstylesheet(self):
|
@dynamic_property
|
||||||
return self.__stylesheet
|
def reporter(self):
|
||||||
def setstylesheet(self, value):
|
def fget(self):
|
||||||
self.__stylesheet = value
|
return self.__reporter
|
||||||
stylesheet = property(getstylesheet, setstylesheet)
|
def fset(self, val):
|
||||||
|
self.__reporter = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getthumbs(self):
|
@dynamic_property
|
||||||
return self.__thumbs
|
def stylesheet(self):
|
||||||
def setthumbs(self, value):
|
def fget(self):
|
||||||
self.__thumbs = value
|
return self.__stylesheet
|
||||||
thumbs = property(getthumbs, setthumbs)
|
def fset(self, val):
|
||||||
|
self.__stylesheet = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def gettitle(self):
|
@dynamic_property
|
||||||
return self.__title
|
def thumbs(self):
|
||||||
def settitle(self, value):
|
def fget(self):
|
||||||
self.__title = value
|
return self.__thumbs
|
||||||
title = property(gettitle, settitle)
|
def fset(self, val):
|
||||||
|
self.__thumbs = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
def getverbose(self):
|
@dynamic_property
|
||||||
return self.__verbose
|
def title(self):
|
||||||
def setverbose(self, value):
|
def fget(self):
|
||||||
self.__verbose = value
|
return self.__title
|
||||||
verbose = property(getverbose, setverbose)
|
def fset(self, val):
|
||||||
|
self.__title = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
|
@dynamic_property
|
||||||
|
def verbose(self):
|
||||||
|
def fget(self):
|
||||||
|
return self.__verbose
|
||||||
|
def fset(self, val):
|
||||||
|
self.__verbose = val
|
||||||
|
return property(fget=fget, fset=fset)
|
||||||
|
|
||||||
# Methods
|
# Methods
|
||||||
def buildSources(self):
|
def buildSources(self):
|
||||||
@ -1620,6 +1684,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointTag['class'] = "periodical"
|
navPointTag['class'] = "periodical"
|
||||||
navPointTag['id'] = "title"
|
navPointTag['id'] = "title"
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXHeader(periodical): self.playOrder: %d" % self.playOrder
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(soup, 'navLabel')
|
navLabelTag = Tag(soup, 'navLabel')
|
||||||
textTag = Tag(soup, 'text')
|
textTag = Tag(soup, 'text')
|
||||||
@ -1654,6 +1719,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointTag['class'] = "section"
|
navPointTag['class'] = "section"
|
||||||
navPointTag['id'] = "bytitle-ID"
|
navPointTag['id'] = "bytitle-ID"
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXDescriptions(section '%s'): self.playOrder: %d" % (tocTitle, self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(ncx_soup, 'navLabel')
|
navLabelTag = Tag(ncx_soup, 'navLabel')
|
||||||
textTag = Tag(ncx_soup, 'text')
|
textTag = Tag(ncx_soup, 'text')
|
||||||
@ -1673,6 +1739,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointVolumeTag['class'] = "article"
|
navPointVolumeTag['class'] = "article"
|
||||||
navPointVolumeTag['id'] = "book%dID" % int(book['id'])
|
navPointVolumeTag['id'] = "book%dID" % int(book['id'])
|
||||||
navPointVolumeTag['playOrder'] = self.playOrder
|
navPointVolumeTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXDescriptions(article): self.playOrder: %d" % self.playOrder
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(ncx_soup, "navLabel")
|
navLabelTag = Tag(ncx_soup, "navLabel")
|
||||||
textTag = Tag(ncx_soup, "text")
|
textTag = Tag(ncx_soup, "text")
|
||||||
@ -1722,6 +1789,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointTag['class'] = "section"
|
navPointTag['class'] = "section"
|
||||||
navPointTag['id'] = "byalphatitle-ID"
|
navPointTag['id'] = "byalphatitle-ID"
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByTitle(section '%s'): self.playOrder: %d" % (tocTitle, self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(soup, 'navLabel')
|
navLabelTag = Tag(soup, 'navLabel')
|
||||||
textTag = Tag(soup, 'text')
|
textTag = Tag(soup, 'text')
|
||||||
@ -1787,6 +1855,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
if not single_article_per_section:
|
if not single_article_per_section:
|
||||||
navPointByLetterTag['id'] = "%sTitles-ID" % (title_letters[i].upper())
|
navPointByLetterTag['id'] = "%sTitles-ID" % (title_letters[i].upper())
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByTitle(article '%s'): self.playOrder: %d" % (title_letters[i].upper(), self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(soup, 'navLabel')
|
navLabelTag = Tag(soup, 'navLabel')
|
||||||
textTag = Tag(soup, 'text')
|
textTag = Tag(soup, 'text')
|
||||||
@ -1838,6 +1907,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByAuthor(section '%s'): self.playOrder: %d" % (tocTitle, self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(soup, 'navLabel')
|
navLabelTag = Tag(soup, 'navLabel')
|
||||||
textTag = Tag(soup, 'text')
|
textTag = Tag(soup, 'text')
|
||||||
@ -1904,6 +1974,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointByLetterTag['class'] = "article"
|
navPointByLetterTag['class'] = "article"
|
||||||
navPointByLetterTag['id'] = "%sauthors-ID" % (authors[1].upper())
|
navPointByLetterTag['id'] = "%sauthors-ID" % (authors[1].upper())
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByAuthor(article '%s'): self.playOrder: %d" % (authors[1].upper(), self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(soup, 'navLabel')
|
navLabelTag = Tag(soup, 'navLabel')
|
||||||
textTag = Tag(soup, 'text')
|
textTag = Tag(soup, 'text')
|
||||||
@ -1953,6 +2024,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
navPointTag['playOrder'] = self.playOrder
|
navPointTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByTags(section '%s'): self.playOrder: %d" % (tocTitle, self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(ncx_soup, 'navLabel')
|
navLabelTag = Tag(ncx_soup, 'navLabel')
|
||||||
textTag = Tag(ncx_soup, 'text')
|
textTag = Tag(ncx_soup, 'text')
|
||||||
@ -1974,6 +2046,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
navPointVolumeTag['class'] = "article"
|
navPointVolumeTag['class'] = "article"
|
||||||
navPointVolumeTag['id'] = "genre-%s-ID" % genre['tag']
|
navPointVolumeTag['id'] = "genre-%s-ID" % genre['tag']
|
||||||
navPointVolumeTag['playOrder'] = self.playOrder
|
navPointVolumeTag['playOrder'] = self.playOrder
|
||||||
|
print "generateNCXByTags(article '%s'): self.playOrder: %d" % (genre['tag'], self.playOrder)
|
||||||
self.playOrder += 1
|
self.playOrder += 1
|
||||||
navLabelTag = Tag(ncx_soup, "navLabel")
|
navLabelTag = Tag(ncx_soup, "navLabel")
|
||||||
textTag = Tag(ncx_soup, "text")
|
textTag = Tag(ncx_soup, "text")
|
||||||
@ -2563,6 +2636,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
opts.descriptionClip = 250
|
opts.descriptionClip = 250
|
||||||
opts.basename = "Catalog"
|
opts.basename = "Catalog"
|
||||||
opts.plugin_path = self.plugin_path
|
opts.plugin_path = self.plugin_path
|
||||||
|
print " - - - - - begin clip here - - - - - "
|
||||||
|
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
opts_dict = vars(opts)
|
opts_dict = vars(opts)
|
||||||
@ -2588,9 +2662,15 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
catalog.createDirectoryStructure()
|
catalog.createDirectoryStructure()
|
||||||
catalog.copyResources()
|
catalog.copyResources()
|
||||||
catalog.buildSources()
|
catalog.buildSources()
|
||||||
|
print " - - - - - end clip here - - - - - "
|
||||||
|
|
||||||
recommendations = []
|
recommendations = []
|
||||||
|
|
||||||
|
dp = getattr(opts, 'debug_pipeline', None)
|
||||||
|
if dp is not None:
|
||||||
|
recommendations.append(('debug_pipeline', dp,
|
||||||
|
OptionRecommendation.HIGH))
|
||||||
|
|
||||||
if opts.fmt == 'mobi' and opts.output_profile and opts.output_profile.startswith("kindle"):
|
if opts.fmt == 'mobi' and opts.output_profile and opts.output_profile.startswith("kindle"):
|
||||||
recommendations.append(('output_profile', opts.output_profile,
|
recommendations.append(('output_profile', opts.output_profile,
|
||||||
OptionRecommendation.HIGH))
|
OptionRecommendation.HIGH))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user