mirror of https://github.com/tLDP/python-tldp
create BaseDoctype with features needed by all
each document processor will need to know about its sources, outputs and the platform details the generate() method is a temporary model for operation
This commit is contained in:
parent
169d6872f6
commit
f1c40c1e8c
|
@ -2,6 +2,7 @@
|
|||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import os
|
||||
from ..utils import logger
|
||||
|
||||
|
||||
|
@ -22,5 +23,27 @@ class SignatureChecker(object):
|
|||
sig, f.name, cls.__name__)
|
||||
return None
|
||||
|
||||
|
||||
class BaseDoctype(object):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.source = kwargs.get('source')
|
||||
self.output = kwargs.get('output')
|
||||
self.platform = kwargs.get('platform')
|
||||
self.logdir = os.path.join(self.output.dirname, 'logs')
|
||||
if os.path.exists(self.logdir):
|
||||
logger.warning("Found existing logs directory: %s", self.logdir)
|
||||
else:
|
||||
os.mkdir(self.logdir)
|
||||
|
||||
def generate(self):
|
||||
os.chdir(self.output.dirname)
|
||||
self.output.clear()
|
||||
self.platform_check()
|
||||
self.create_htmls()
|
||||
self.create_pdf()
|
||||
self.create_txt()
|
||||
self.create_html()
|
||||
|
||||
#
|
||||
# -- end of file
|
||||
|
|
Loading…
Reference in New Issue