From 9d986ab0f7bcf9b948f4541919671d7f70d6c56a Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Thu, 12 Jan 2017 11:18:58 +0100 Subject: [PATCH 1/2] added fix for running merger script for other libraries than annex60 --- buildingspy/development/merger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildingspy/development/merger.py b/buildingspy/development/merger.py index c023d6d2..654ec199 100755 --- a/buildingspy/development/merger.py +++ b/buildingspy/development/merger.py @@ -47,7 +47,7 @@ def isValidLibrary(lib_home): # -------------------------- # Class variables - self._src_library_name = "Annex60" + self._src_library_name = os.path.basename(annex60_dir) self._annex60_home=annex60_dir self._target_home=dest_dir # Library name, such as Buildings From 5ce8abb4280d406c8fb7cd195f4ca6780632e246 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Thu, 12 Jan 2017 12:31:30 +0100 Subject: [PATCH 2/2] changed such that existing reference results are overwritten this fixes a bug: #113 --- buildingspy/development/merger.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/buildingspy/development/merger.py b/buildingspy/development/merger.py index 654ec199..f4d9c3ec 100755 --- a/buildingspy/development/merger.py +++ b/buildingspy/development/merger.py @@ -207,10 +207,8 @@ def merge(self): if desFil.endswith(".mo") or desFil.endswith(".mos"): copiedFiles.append(desFil) self._copy_mo_and_mos(srcFil, desFil) - # Only copy reference results if no such file exists. - # If a reference file already exists, then don't change it. - # This requires to replace - # the name of the library in names of the result file + # Only copy reference results if it corresponds + # to a package that is not excluded elif desFil.startswith(ref_res): dir_name = os.path.dirname(desFil) base_name = os.path.basename(desFil) @@ -224,9 +222,8 @@ def merge(self): new_file = os.path.join(dir_name, base_name.replace(self._src_library_name, self._new_library_name)) - if not os.path.isfile(new_file): - copiedFiles.append(new_file) - shutil.copy2(srcFil, new_file) + copiedFiles.append(new_file) + shutil.copy2(srcFil, new_file) # Copy all other files. This may be images, C-source, libraries etc. else: