Add dir statement to see comment object

This commit is contained in:
Daniel Lindmark 2024-05-15 12:18:39 -05:00
parent 067aa3734a
commit af17986891

View File

@ -71,15 +71,35 @@ print("AllSpice Version: " + allspice.get_version())
# Test private API call
print("API-Token belongs to user: " + allspice.get_user().username)
design_review = DesignReview.request(allspice, args.repo_owner, args.repo_name, args.dr)
# Open file for writing
file_name = "design_review_comments.md"
# Filter out special methods and attributes
design_review_attributes = [attr for attr in dir(design_review) if not attr.startswith('__')]
# Print the public design_review attributes
print(f"design_review_attributes: {design_review_attributes}")
# Write Design review details to file
# with open(file_name, 'w') as f:
# f.write(f"## Design Review: {design_review.title}\n")
# f.write(f"State: {design_review.state}\n")
# f.write(f"Assignees: {design_review.assignees}\n")
# f.write(f"Description: {design_review.description}\n")
# f.write(f"Created at: {design_review.created_at}\n")
# f.write(f"Updated at: {design_review.updated_at}\n")
# f.write(f"### Body:\n{design_review.body}")
# f.write("end-of-description\n")
comments = design_review.get_comments()
with open(file_name, 'a') as f:
f.write(f"{comments}")
# Filter out special methods and attributes
comments_attributes = [attr for attr in dir(comments) if not attr.startswith('__')]
# Print the public comments attributes
print(f"comments_attributes: {comments_attributes}")
for comment in comments:
# write to file