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

bugfix for merge-other #45

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Changes from 2 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
6 changes: 4 additions & 2 deletions adstex.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ def update(key):
return

if key_exists_in_others and args.merge_other:
bib.entries_dict[key] = bib_other.entries_dict[key]
bib.entries = list(bib.entries_dict.values())
bib._entries_dict[key] = bib_other.entries_dict[key]
bib.entries = list(bib._entries_dict.values())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bib._entries_dict[key] = bib_other.entries_dict[key]
bib.entries = list(bib._entries_dict.values())
bib.entries.append(bib_other.entries_dict[key])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to me.
It works in my examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just realized that I could have simply accepted your suggested edit
first time met this function :)

print("{}: FOUND IN OTHER BIB SOURCE, MERGED".format(key))
return

Expand Down Expand Up @@ -519,6 +519,8 @@ def update(key):
copyfile(args.output, args.output + ".bak")
with open(args.output, "wb") as fp:
fp.write(bib_dump_str)
else:
print('Nothing to write/update.')

print(_headerize("Done!"))

Expand Down