Replace comma separation with newlines

This commit is contained in:
Daniel Lindmark 2024-05-20 18:20:47 -05:00
parent a99d9a9a02
commit a569138180

View File

@ -2,7 +2,7 @@
# Uses py-allspice + AllSpice API to save all design review comments to a markdown file
from allspice import AllSpice, DesignReview, Repository
import argparse
import sys
import sys, os
print("Starting Test")
@ -57,15 +57,14 @@ def get_attributes(obj):
# Write string to file
def write_to_file(file_name, string):
with open(file_name, 'a') as f:
f.write(string)
f.write("\n")
f.write(string + os.linesep)
f.close()
# Get the repository object
repository = Repository.request(allspice, "AllSpice-Demos", "Actions-demo")
# Get the attributes of the repository object
attributes_string = ", ".join(f"Repository.{attribute}" for attribute in get_attributes(repository))
# Build a string of attributes, separated by newlines
attributes_string = os.linesep.join(f"Repository.{attribute}" for attribute in get_attributes(repository))
# Write the attributes to the file
write_to_file(file_name, attributes_string)