Skip to content

Commit b47df8f

Browse files
committed
update standalone algorithm by considering the devsimpy directory structure
1 parent e93b1c6 commit b47df8f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

devsimpy/StandaloneNoGUI.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(self, yaml:str="", outfn:str="devsimpy-nogui-pkg.zip", format:str="
127127

128128
### if simulation kernel need to by zipped
129129
if self.add_sim_kernel:
130-
StandaloneNoGUI.DIRNAMES.append('DEVSKernel/')
130+
StandaloneNoGUI.DIRNAMES.append('DEVSKernel/')
131131

132132
def GetDockerSpec(self):
133133
"""
@@ -187,7 +187,7 @@ def BuildZipPackage(self) -> None:
187187
if self.add_sim_kernel:
188188
### add all dependencies python files needed to execute devsimpy-nogui
189189
for fn in StandaloneNoGUI.FILENAMES:
190-
archive.write(fn)
190+
archive.write(os.path.join('devsimpy',fn), arcname=fn)
191191

192192
###################################################################
193193
###
@@ -245,6 +245,8 @@ def BuildZipPackage(self) -> None:
245245
### add all dependancies (directories) needed to execute devsimpy-nogui
246246
for dirname in self.dirnames_abs:
247247

248+
dirname = os.path.join('devsimpy', dirname)
249+
248250
# Call the function to retrieve all files and folders of the assigned directory
249251
filePaths = retrieve_file_paths(dirname)
250252

@@ -258,7 +260,7 @@ def BuildZipPackage(self) -> None:
258260

259261
for file in filePaths:
260262
if '__pycache__' not in file:
261-
archive.write(file)
263+
archive.write(file, arcname=file.split('devsimpy')[1])
262264

263265
###################################################################
264266
###

0 commit comments

Comments
 (0)