only try to remove files once

This commit is contained in:
Martin A. Brown 2016-03-10 08:49:03 -08:00
parent 2180755a97
commit f0cb2c3dfe
1 changed files with 5 additions and 3 deletions

View File

@ -66,14 +66,12 @@ class BaseDoctype(object):
self.source = kwargs.get('source', None)
self.output = kwargs.get('output', None)
self.config = kwargs.get('config', None)
self.removals = list()
self.removals = set()
assert self.source is not None
assert self.output is not None
assert self.config is not None
def cleanup(self):
if self.config.script:
return
stem = self.source.stem
removals = getattr(self, 'removals', None)
if removals:
@ -290,6 +288,10 @@ class BaseDoctype(object):
#
result = self.buildall(**kwargs)
# -- always clean the kitchen
#
self.cleanup()
# -- report on result and/or cleanup
#
if result: