Commit 4b65d489c2b3ede31e79f7c25a1f2673ed8464c5
1 parent
1c18151d
Exists in
dev
Correction des "/" avec des os.sep pour assurer la compatibilité Windows/Linux.
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/agent/Agent.py
... | ... | @@ -288,14 +288,14 @@ class Agent: |
288 | 288 | self.set_status(self.STATUS_LAUNCH) |
289 | 289 | self.set_mode(self.MODE_IDLE) |
290 | 290 | if not config_filename: |
291 | - #config_filename = '/PROJECTS/GFT/SOFT/PYROS_SOFT/CURRENT/config/config_unit_simulunit1.xml' | |
292 | 291 | config_filename = self.DEFAULT_CONFIG_FILE_NAME |
293 | - #config_file_path, _ = os.path.split(config_filename) | |
292 | + | |
293 | + print(f"config_filename={config_filename}") | |
294 | 294 | # If config file name is RELATIVE (i.e. without path, just the file name) |
295 | 295 | # => give it an absolute path (and remove "src/agent/" from it) |
296 | 296 | if config_filename == os.path.basename(config_filename): |
297 | - #config_filename = os.path.abspath(self.CONFIG_DIR + os.sep + config_filename).replace("src/agent/","") | |
298 | - config_filename = os.path.abspath(self.CONFIG_DIR + os.sep + config_filename).replace("/src/","/").replace("/agent/","/") | |
297 | + tmp = os.path.abspath(self.CONFIG_DIR + os.sep + config_filename) | |
298 | + config_filename = os.path.abspath(self.CONFIG_DIR + os.sep + config_filename).replace(os.sep+"src"+os.sep,os.sep).replace(os.sep+"agent"+os.sep,os.sep) | |
299 | 299 | print("Config file used is", config_filename) |
300 | 300 | #print("current path", os.getcwd()) |
301 | 301 | #print("this file path :", __file__) | ... | ... |