Skip to content

Commit

Permalink
Merge pull request #15 from yymao/u/yymao/bug-fix
Browse files Browse the repository at this point in the history
 Fix a bug introduced in efce158 (#14)
  • Loading branch information
yymao authored Nov 24, 2019
2 parents 5723da4 + 6cd2b56 commit 51173d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Python package

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -13,6 +13,13 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Cache Python packages
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down
17 changes: 11 additions & 6 deletions adstex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
except ImportError:
from urllib import unquote

__version__ = "0.3.3"
__version__ = "0.3.4"

_this_year = date.today().year % 100
_this_cent = date.today().year // 100
Expand Down Expand Up @@ -391,11 +391,16 @@ def main():
key_exists = key in bib.entries_dict
key_exists_in_others = key in bib_other.entries_dict

if (key_exists and args.update) or (
key_exists_in_others and args.merge_other and args.update
):
bibcode = extract_bibcode(bib.entries_dict[key])
bibcode_new = entry2bibcode(bib.entries_dict[key])
if args.update:
if key_exists:
bibcode = extract_bibcode(bib.entries_dict[key])
bibcode_new = entry2bibcode(bib.entries_dict[key])
elif key_exists_in_others and args.merge_other:
bibcode = extract_bibcode(bib_other.entries_dict[key])
bibcode_new = entry2bibcode(bib_other.entries_dict[key])
else:
bibcode_new = None

if bibcode_new:
all_entries[bibcode_new].append(key)
if bibcode_new != bibcode or args.force_regenerate:
Expand Down

0 comments on commit 51173d1

Please sign in to comment.