Commits

Brian Mearns committed d672658

Added a file to get the list of generated files from writeEpub.

Comments (0)

Files changed (2)

 Rel 9 - ???????? - ??????????
+    [n] Added outputFileList method to writeEpub.
 
 Rel 8 - v1.3.0.0 - 2013-04-30
     [n] Added META-* and UUID-* symbols to templ stack for writeEpub.

src/tome/writeEpub.py

         return srcDirs, srcFiles
         
 
+    def outputFileList(self):
+        ofiles = ["mimetype"]
+
+        ### First, get all of the original source files, add the verbatim ones, and the
+        # output of the direct templ ones.
+        srcDirs, srcFiles = EpubWriter.findSrcFiles(self.__templateDir, self.__tdFilter)
+        templFiles = []
+        for f in srcFiles:
+            if os.path.join(self.__templateDir, f) == self.__chapterTemplatePath:
+                continue
+            if os.path.join(self.__templateDir, f) == self.__bookTitleTemplatePath:
+                continue
+            if os.path.join(self.__templateDir, f) == self.__partTitleTemplatePath:
+                continue
+            elif self.__tmplFilter(f):
+                #Strip of the templ extension.
+                ofiles.append(os.path.splitext(f)[0])
+            else:
+                ofiles.append(f)
+
+        ### Now add the files to be generated.
+        prtNum = bkNum = chNum = 0
+        for prtIdx in xrange(len(self.__tome)):
+            prtNum += 1
+            part = self.__tome[prtIdx]
+            if part.title() is not None:
+                prtFile = self.partFileName(prtNum)
+                ofiles.append(prtFile)
+            for bkIdx in xrange(len(part)):
+                bkNum += 1
+                book = part[bkIdx]
+                if book.title() is not None:
+                    bkFile = self.bookFileName(bkNum)
+                    ofiles.append(bkFile)
+                for chIdx in xrange(len(book)):
+                    chNum += 1
+                    chFile = self.chapterFileName(chNum)
+                    ofiles.append(chFile)
+
+        return ofiles
+        
+
+
     def writeEpub(self):
         """
         Actually generates and outputs all of the EPUB content and the final EPUB document.