mirror of https://github.com/tLDP/python-tldp
only try to remove files once
This commit is contained in:
parent
2180755a97
commit
f0cb2c3dfe
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue