summaryrefslogtreecommitdiff
path: root/panfry/main.py
diff options
context:
space:
mode:
authorScott Bahling <sbahling@suse.de>2013-09-23 15:37:14 +0200
committerScott Bahling <sbahling@suse.de>2013-09-23 15:37:14 +0200
commit047df954a7ad23c54ffba0f191a05419ffd1bcf5 (patch)
treed1a5539ddeea32ca4989e5cb260910a39edefe16 /panfry/main.py
parentef2744a43f22563d50af678777ae1e3d8120c9a7 (diff)
downloadpanfry-047df954a7ad23c54ffba0f191a05419ffd1bcf5.tar.gz
panfry-047df954a7ad23c54ffba0f191a05419ffd1bcf5.tar.xz
panfry-047df954a7ad23c54ffba0f191a05419ffd1bcf5.zip
A bit of refactoring
- Add NOPDF and NOEPUB features
Diffstat (limited to 'panfry/main.py')
-rwxr-xr-xpanfry/main.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/panfry/main.py b/panfry/main.py
index 917ebc0..5d05d20 100755
--- a/panfry/main.py
+++ b/panfry/main.py
@@ -70,15 +70,16 @@ def get_env():
def gen(env):
for item in env.index:
item = item.strip()
+ print("Processing: %s..." % item)
docpubpath = os.path.join(env.pub_path, item)
document = Document(env.doc_path, item)
- document.set_templater(Templater(env.templates_path))
- document.set_pandoc_options(env.pandoc_options)
+ document.templater = Templater(env.templates_path)
+ document.pandoc_options = env.pandoc_options
if env.simple_toc:
- document.set_simple_toc
+ document.toc_type = 'simple'
if env.json_toc:
- document.set_json_toc
+ document.toc_type = 'json'
if env.clean and os.path.exists(env.pub_path):
print("Cleanup, removing %s..." % env.pub_path)
@@ -100,11 +101,13 @@ def gen(env):
###### Create PDF
pdffile = document.publish_pdf(docpubpath)
- print("Wrote PDF: %s" % pdffile)
+ if pdffile:
+ print("Wrote PDF: %s" % pdffile)
###### Create epub
epubfile = document.publish_epub(docpubpath)
- print("Wrote epub: %s" % epubfile)
+ if epubfile:
+ print("Wrote epub: %s" % epubfile)
###### Create HTML
document.publish_html(docpubpath)