Do not assume that only one script is delivered.
Replace by a loop

Change-Id: I389d202e61f47761dff88f12e6a63ef4687b513f
This commit is contained in:
Bruno Cornec 2017-03-07 17:43:59 +01:00 committed by Uggla
parent 7331f6e267
commit ea995f722a

View File

@ -70,11 +70,19 @@ class DataFilesHelper(object):
self.update_setupstruc(src, dst) self.update_setupstruc(src, dst)
try: try:
# Create an entry for scripts if available # Create an entry for scripts if available
self.data['script'] = {'src': [],
'fdst': [],
'dst': 'bin'}
src = config.get('files', 'scripts').split('\n') src = config.get('files', 'scripts').split('\n')
src = [self.refinesrc(file)[0] for file in src if file] # print("List handled: {}\n".format(src))
self.data['script'] = {'src': src, listsrc = []
'dst': 'bin', for s in src:
'fdst': self.calculatedst(src, 'bin')} if not s:
continue
# print("Source handled: {}".format(s))
listsrc.append(s)
self.data['script']['src'] = listsrc
self.data['script']['fdst'] = self.calculatedst(listsrc, "bin")
except configparser.NoOptionError: except configparser.NoOptionError:
pass pass
pp = pprint.PrettyPrinter(indent=4) pp = pprint.PrettyPrinter(indent=4)
@ -117,7 +125,7 @@ class DataFilesHelper(object):
return(file) return(file)
def calculatedst(self, src, dst): def calculatedst(self, src, dst):
'''Calculate the full destination path accordind to source and '''Calculate the full destination path according to source and
destination destination
:param src: source files :param src: source files