Skip to content

Commit

Permalink
stop replacing the absolute Path
Browse files Browse the repository at this point in the history
  • Loading branch information
TongkunZhang committed Mar 30, 2022
1 parent bf11e2b commit b78c3f2
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions makei/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ def make(self):

def _post_make(self):
pass
event_files = list(Path(".evfevent").rglob("*.evfevent"))

def replace_abs_path(line: str) -> str:
if str(Path.cwd()) in line:
line = line.replace(f'{Path.cwd()}/', '')
new_len = len(line.split()[5])
# Replace length
line = line[:24] + f"{new_len:03d}" + line[27:]
return line
else:
return line

for filepath in event_files:
replace_file_content(filepath, replace_abs_path)
# event_files = list(Path(".evfevent").rglob("*.evfevent"))

This comment has been minimized.

Copy link
@edmundreinhardt

edmundreinhardt Mar 30, 2022

Member

why are we not replacing the absolute path?


# def replace_abs_path(line: str) -> str:
# if str(Path.cwd()) in line:
# line = line.replace(f'{Path.cwd()}/', '')
# new_len = len(line.split()[5])
# # Replace length
# line = line[:24] + f"{new_len:03d}" + line[27:]
# return line
# else:
# return line

# for filepath in event_files:
# replace_file_content(filepath, replace_abs_path)

0 comments on commit b78c3f2

Please sign in to comment.