latex dir for debugging
authorJan Szejko <janek37@gmail.com>
Tue, 21 Mar 2017 11:15:48 +0000 (12:15 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 21 Mar 2017 11:21:53 +0000 (12:21 +0100)
librarian/parser.py
librarian/pdf.py

index 502192f..e4f1340 100644 (file)
@@ -210,6 +210,12 @@ class WLDocument(object):
             cover_class = DefaultEbookCover
         return cover_class(self.book_info, *args, **kwargs).output_file()
 
             cover_class = DefaultEbookCover
         return cover_class(self.book_info, *args, **kwargs).output_file()
 
+    # for debugging only
+    def latex_dir(self, *args, **kwargs):
+        kwargs['latex_dir'] = True
+        from librarian import pdf
+        return pdf.transform(self, *args, **kwargs)
+
     def save_output_file(self, output_file, output_path=None, output_dir_path=None, make_author_dir=False, ext=None):
         if output_dir_path:
             save_path = output_dir_path
     def save_output_file(self, output_file, output_path=None, output_dir_path=None, make_author_dir=False, ext=None):
         if output_dir_path:
             save_path = output_dir_path
index 927b50d..8e84dce 100644 (file)
@@ -200,7 +200,7 @@ def package_available(package, args='', verbose=False):
 
 
 def transform(wldoc, verbose=False, save_tex=None, morefloats=None,
 
 
 def transform(wldoc, verbose=False, save_tex=None, morefloats=None,
-              cover=None, flags=None, customizations=None, ilustr_path=''):
+              cover=None, flags=None, customizations=None, ilustr_path='', latex_dir=False):
     """ produces a PDF file with XeLaTeX
 
     wldoc: a WLDocument
     """ produces a PDF file with XeLaTeX
 
     wldoc: a WLDocument
@@ -305,6 +305,9 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None,
         shutil.copy(get_resource('pdf/wl.cls'), temp)
         shutil.copy(get_resource('res/wl-logo.png'), temp)
 
         shutil.copy(get_resource('pdf/wl.cls'), temp)
         shutil.copy(get_resource('res/wl-logo.png'), temp)
 
+        if latex_dir:
+            return temp
+
         try:
             cwd = os.getcwd()
         except OSError:
         try:
             cwd = os.getcwd()
         except OSError: