Add the ability to customize conf

This commit is contained in:
VirtuBox
2019-08-19 18:21:51 +02:00
parent 3462dd49f3
commit 08cfab918d

View File

@@ -9,6 +9,7 @@ Render Templates
class WOTemplate(): class WOTemplate():
def tmpl_render(self, fileconf, template, data, overwrite=True): def tmpl_render(self, fileconf, template, data, overwrite=True):
if (not overwrite): if (not overwrite):
if not os.path.isfile('{0}'.format(fileconf)):
data = dict(data) data = dict(data)
Log.debug(self, 'Writting the configuration to ' Log.debug(self, 'Writting the configuration to '
'file {0}'.format(fileconf)) 'file {0}'.format(fileconf))
@@ -18,7 +19,9 @@ class WOTemplate():
out=wo_template) out=wo_template)
wo_template.close() wo_template.close()
else: else:
if not os.path.isfile('{0}'.format(fileconf)): if (not os.path.isfile('{0}.custom'
.format(fileconf))):
data = dict(data)
Log.debug(self, 'Writting the configuration to ' Log.debug(self, 'Writting the configuration to '
'file {0}'.format(fileconf)) 'file {0}'.format(fileconf))
wo_template = open('{0}'.format(fileconf), wo_template = open('{0}'.format(fileconf),