Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue113 ref res #114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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