Skip to content
Snippets Groups Projects
Commit 7985a87f authored by Michael Langguth's avatar Michael Langguth
Browse files

Manually solved merge conflict.

parents d3fd2bf2 f674a466
No related branches found
No related tags found
No related merge requests found
...@@ -138,13 +138,15 @@ class MetaData: ...@@ -138,13 +138,15 @@ class MetaData:
with open(batch_script,'r') as file: with open(batch_script,'r') as file:
data = file.readlines() data = file.readlines()
nlines = len(data)
matched_lines = [iline for iline in range(nlines) if any(str_id in data[iline] for str_id in paths_to_mod)] # list of line-number indices to be modified matched_lines = [iline for iline in range(nlines) if any(str_id in data[iline] for str_id in paths_to_mod)] # list of line-number indices to be modified
for i in matched_lines: for i in matched_lines:
data[i] = add_str_to_path(data[i],self.exp_dir) data[i] = add_str_to_path(data[i],self.exp_dir)
with open(batch_script,'w') as file: with open(batch_script,'w') as file:
file.writeslines(data) file.writelines(data)
def write_metadata_to_file(self,dest_dir = None): def write_metadata_to_file(self,dest_dir = None):
...@@ -243,6 +245,7 @@ class MetaData: ...@@ -243,6 +245,7 @@ class MetaData:
pass pass
# ----------------------------------- end of class MetaData ----------------------------------- # ----------------------------------- end of class MetaData -----------------------------------
# some auxilary functions which are not bound to MetaData-class # some auxilary functions which are not bound to MetaData-class
...@@ -254,8 +257,8 @@ def add_str_to_path(path_in,add_str): ...@@ -254,8 +257,8 @@ def add_str_to_path(path_in,add_str):
Function is also capable to handle carriage returns for handling input-strings obtained by reading a file. Function is also capable to handle carriage returns for handling input-strings obtained by reading a file.
""" """
l_linebreak = line_str.endswith("\n") # flag for carriage return at the end of input string l_linebreak = path_in.endswith("\n") # flag for carriage return at the end of input string
line_str = line_str.rstrip("\n") line_str = path_in.rstrip("\n")
if (not line_str.endswith(add_str)) or \ if (not line_str.endswith(add_str)) or \
(not line_str.endswith(add_str.rstrip("/"))): (not line_str.endswith(add_str.rstrip("/"))):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment