Skip to content

Commit 863564c

Browse files
authored
Merge pull request #4545 from lbl-srg/maint_12.x_issue4543_ePlusInstall
Update EnergyPlus installation to allow installing in Buildings containing version number (maint_12.x)
2 parents 8712ec7 + 45f1760 commit 863564c

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

Buildings/Resources/src/ThermalZones/EnergyPlus_24_2_0/install.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def log(msg):
3535
def get_bin_directory():
3636
file_path = os.path.dirname(os.path.realpath(__file__))
3737
return os.path.abspath(
38-
os.path.join(file_path, "..", "..", "..", "..", "Resources", "bin")
38+
os.path.join(file_path, os.pardir, os.pardir, os.pardir, os.pardir, "Resources", "bin")
3939
)
4040

4141

@@ -138,10 +138,10 @@ def replace_table_in_mo(html, varType, moFile, spawn_dir):
138138

139139
mo_name = os.path.join(
140140
os.path.dirname(os.path.realpath(__file__)),
141-
"..",
142-
"..",
143-
"..",
144-
"..",
141+
os.pardir,
142+
os.pardir,
143+
os.pardir,
144+
os.pardir,
145145
"ThermalZones",
146146
"EnergyPlus_{}".format(energyPlus_version_dash),
147147
moFile,
@@ -176,8 +176,8 @@ def _getEnergyPlusVersion(spawn_dir):
176176
spawn_name = "spawn-{}-{}".format(version, commit[0:10])
177177
idd = os.path.abspath( \
178178
os.path.join(__file__, \
179-
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
180-
"Buildings", "Resources", "bin", spawn_dir, "linux64", "etc", "Energy+.idd"))
179+
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
180+
"Resources", "bin", spawn_dir, "linux64", "etc", "Energy+.idd"))
181181

182182
prefix="!IDD_Version "
183183
with open(idd, 'r') as f:
@@ -197,15 +197,15 @@ def update_version_in_modelica_files(spawn_dir, spawn_exe, build_type):
197197
ep_package = "EnergyPlus_{}".format(energyPlus_version).replace('.', '_')
198198

199199
for rel_file in [\
200-
os.path.join("Buildings", "ThermalZones", ep_package, "Building.mo"),
201-
os.path.join("Buildings", "ThermalZones", ep_package, "package.mo"),
202-
os.path.join("Buildings", "ThermalZones", ep_package, "UsersGuide.mo"),
203-
os.path.join("Buildings", "Resources", "Scripts", "travis", "pyfmi", "runSpawnFromOtherDirectory.py")
200+
os.path.join("ThermalZones", ep_package, "Building.mo"),
201+
os.path.join("ThermalZones", ep_package, "package.mo"),
202+
os.path.join("ThermalZones", ep_package, "UsersGuide.mo"),
203+
os.path.join("Resources", "Scripts", "travis", "pyfmi", "runSpawnFromOtherDirectory.py")
204204
]:
205205
# Path to Building.mo
206206
abs_file = os.path.abspath( \
207207
os.path.join(__file__, \
208-
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
208+
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
209209
rel_file))
210210

211211
with open (abs_file, 'r' ) as f:
@@ -254,7 +254,7 @@ def update_actuator_output_tables(spawn_dir, spawn_exe):
254254
# os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, ".git"))
255255
# repo = Repo(git_folder)
256256
#
257-
# # Get the old Spawn executuables
257+
# # Get the old Spawn executables
258258
# for file in glob.glob(os.path.join("Buildings", "Resources", "bin", "**/spawn-?.?.?-*"), recursive=True):
259259
# if spawn_exe in file:
260260
# # Add to git

Buildings/Resources/src/ThermalZones/EnergyPlus_9_6_0/install.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def log(msg):
3535
def get_bin_directory():
3636
file_path = os.path.dirname(os.path.realpath(__file__))
3737
return os.path.abspath(
38-
os.path.join(file_path, "..", "..", "..", "..", "Resources", "bin")
38+
os.path.join(file_path, os.pardir, os.pardir, os.pardir, os.pardir, "Resources", "bin")
3939
)
4040

4141

@@ -138,10 +138,10 @@ def replace_table_in_mo(html, varType, moFile, spawn_dir):
138138

139139
mo_name = os.path.join(
140140
os.path.dirname(os.path.realpath(__file__)),
141-
"..",
142-
"..",
143-
"..",
144-
"..",
141+
os.pardir,
142+
os.pardir,
143+
os.pardir,
144+
os.pardir,
145145
"Obsolete",
146146
"ThermalZones",
147147
"EnergyPlus_{}".format(energyPlus_version_dash),
@@ -177,8 +177,8 @@ def _getEnergyPlusVersion(spawn_dir):
177177
spawn_name = "spawn-{}-{}".format(version, commit[0:10])
178178
idd = os.path.abspath( \
179179
os.path.join(__file__, \
180-
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
181-
"Buildings", "Resources", "bin", spawn_dir, "linux64", "etc", "Energy+.idd"))
180+
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
181+
"Resources", "bin", spawn_dir, "linux64", "etc", "Energy+.idd"))
182182

183183
prefix="!IDD_Version "
184184
with open(idd, 'r') as f:
@@ -198,15 +198,15 @@ def update_version_in_modelica_files(spawn_dir, spawn_exe, build_type):
198198
ep_package = "EnergyPlus_{}".format(energyPlus_version).replace('.', '_')
199199

200200
for rel_file in [\
201-
os.path.join("Buildings", "Obsolete", "ThermalZones", ep_package, "Building.mo"),
202-
os.path.join("Buildings", "Obsolete", "ThermalZones", ep_package, "package.mo"),
203-
os.path.join("Buildings", "Obsolete", "ThermalZones", ep_package, "UsersGuide.mo"),
204-
os.path.join("Buildings", "Resources", "Scripts", "travis", "pyfmi", "runSpawnFromOtherDirectory.py")
201+
os.path.join("Obsolete", "ThermalZones", ep_package, "Building.mo"),
202+
os.path.join("Obsolete", "ThermalZones", ep_package, "package.mo"),
203+
os.path.join("Obsolete", "ThermalZones", ep_package, "UsersGuide.mo"),
204+
os.path.join("Resources", "Scripts", "travis", "pyfmi", "runSpawnFromOtherDirectory.py")
205205
]:
206206
# Path to Building.mo
207207
abs_file = os.path.abspath( \
208208
os.path.join(__file__, \
209-
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
209+
os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, \
210210
rel_file))
211211

212212
with open (abs_file, 'r' ) as f:

0 commit comments

Comments
 (0)