mirror of https://github.com/tLDP/python-tldp
make a bit less noise in routine operation
This commit is contained in:
parent
120d44ffa5
commit
c6ebbf8a64
|
@ -32,6 +32,10 @@ class OutputNamingConvention(object):
|
||||||
def name_txt(self):
|
def name_txt(self):
|
||||||
return os.path.join(self.dirname, self.stem + '.txt')
|
return os.path.join(self.dirname, self.stem + '.txt')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name_fo(self):
|
||||||
|
return os.path.join(self.dirname, self.stem + '.fo')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_pdf(self):
|
def name_pdf(self):
|
||||||
return os.path.join(self.dirname, self.stem + '.pdf')
|
return os.path.join(self.dirname, self.stem + '.pdf')
|
||||||
|
@ -115,7 +119,7 @@ class OutputDirectory(OutputNamingConvention):
|
||||||
This is done as a matter of course when the output documents must be
|
This is done as a matter of course when the output documents must be
|
||||||
regenerated. Better to start fresh.
|
regenerated. Better to start fresh.
|
||||||
'''
|
'''
|
||||||
logger.info("%s cleaning dir %s.", self.stem, self.dirname)
|
logger.debug("%s removing dir %s.", self.stem, self.dirname)
|
||||||
if os.path.isdir(self.dirname):
|
if os.path.isdir(self.dirname):
|
||||||
shutil.rmtree(self.dirname)
|
shutil.rmtree(self.dirname)
|
||||||
|
|
||||||
|
@ -123,18 +127,18 @@ class OutputDirectory(OutputNamingConvention):
|
||||||
self.clean()
|
self.clean()
|
||||||
for d in (self.dirname, self.logdir):
|
for d in (self.dirname, self.logdir):
|
||||||
if not os.path.isdir(d):
|
if not os.path.isdir(d):
|
||||||
logger.info("%s creating dir %s.", self.stem, d)
|
logger.debug("%s creating dir %s.", self.stem, d)
|
||||||
os.mkdir(d)
|
os.mkdir(d)
|
||||||
#self.copy_ancillaries(self.dirname)
|
#self.copy_ancillaries(self.dirname)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def hook_build_fail(self):
|
def hook_build_failure(self):
|
||||||
logger.error("%s FAILURE, see logs in %s", self.stem, self.logdir)
|
logger.error("%s FAILURE, see logs in %s", self.stem, self.logdir)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def hook_build_success(self):
|
def hook_build_success(self):
|
||||||
logger.info("%s build success %s.", self.stem, self.dirname)
|
logger.info("%s build success %s.", self.stem, self.dirname)
|
||||||
logger.info("%s removing logs %s)", self.stem, self.logdir)
|
logger.debug("%s removing logs %s)", self.stem, self.logdir)
|
||||||
if os.path.isdir(self.logdir):
|
if os.path.isdir(self.logdir):
|
||||||
shutil.rmtree(logdir)
|
shutil.rmtree(logdir)
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue