mirror of
https://staging.allspice.dev/AllSpice-Demos/Actions-demo.git
synced 2025-04-23 17:03:42 +00:00
Replace comma separation with newlines
This commit is contained in:
parent
a99d9a9a02
commit
a569138180
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user