Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions buildingspy/development/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down