Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #17

Closed
wants to merge 4 commits into from
Closed

test #17

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions categories/15000.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parentID=15000
probSet
numObjects=2
5266 0.500000
4715 0.500000
33 changes: 20 additions & 13 deletions readableAssets.py
Original file line number Diff line number Diff line change
@@ -135,6 +135,8 @@ def read_category_as_object_list(content):

for changed_file in changes_all:

print(" ==================== HERE ")

# whether the change is an added file, or a deleted one, or a modified one
# note that renamed files are configured to show as deleted of old and added of new
sign = "."
@@ -169,23 +171,28 @@ def read_category_as_object_list(content):
if inAction:

if 'categories/' in changed_file:
category_before_output = run_command(f"git show {COMMIT_A}:{changed_file}")
category_after_output = run_command(f"git show {COMMIT_B}:{changed_file}")

if category_before_output != "" and category_after_output != "":
category_before, category_after = [], []

if changed_file not in changes_added:
print(" ==================== NOT ADDED ")
category_before_output = run_command(f"git show {COMMIT_A}:{changed_file}")
category_before = read_category_as_object_list(category_before_output)
if changed_file not in changes_deleted:
print(" ==================== NOT DELETED ")
category_after_output = run_command(f"git show {COMMIT_B}:{changed_file}")
category_after = read_category_as_object_list(category_after_output)

added = list(set(category_after) - set(category_before))
removed = list(set(category_before) - set(category_after))
category_details = ""
if len(added) > 0:
category_details += "\n".join( [ f"+ {e} {get_object_name_by_id(e)}" for e in added] )
if len(removed) > 0:
category_details += "\n".join( [ f"- {e} {get_object_name_by_id(e)}" for e in removed] )
line = f"""
added = list(set(category_after) - set(category_before))
removed = list(set(category_before) - set(category_after))

category_details = ""
if len(added) > 0:
category_details += "\n".join( [ f"+ {e} {get_object_name_by_id(e)}" for e in added] )
if len(removed) > 0:
category_details += "\n".join( [ f"- {e} {get_object_name_by_id(e)}" for e in removed] )

line = f"""
{sign} [{object_id}](https://github.com/{REPO}/pull/{PR_NUM}/files#diff-{file_hash}) {object_name}
<details>
<summary>Details</summary>