Skip to content

Commit

Permalink
Paginate hex files every 80 characters (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quexington authored Feb 16, 2024
1 parent 25b17b9 commit ecea68b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clvm_tools/clvmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def compile_clvm(input_path, output_path, search_paths=[]):
hex = result.as_bin().hex()

with open(output_path, "w") as f:
f.write(hex)
f.write(insert_newlines(hex))
f.write("\n")
else:
log.info("skipping %s, compiled recently" % input_path)
Expand All @@ -53,3 +53,9 @@ def find_files(path=""):
compile_clvm(full_path, target)
r.append(target)
return r

def insert_newlines(string, every=80):
lines = []
for i in range(0, len(string), every):
lines.append(string[i:i+every])
return '\n'.join(lines)

0 comments on commit ecea68b

Please sign in to comment.