Skip to content

Commit

Permalink
Add fix_unicode parameter to run_entry function
Browse files Browse the repository at this point in the history
  • Loading branch information
wiso committed Nov 15, 2023
1 parent 660bc48 commit 1a3f689
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check_biblio.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def check_latex_entry(key: str, tex: str, use_bibtex: bool = False) -> Optional[
return error


def run_entry(entry, cur, substitutions):
def run_entry(entry, cur, fix_unicode, substitutions):
raw_original = entry.raw.strip()
raw_proposed = raw_original

Expand All @@ -201,7 +201,7 @@ def run_entry(entry, cur, substitutions):
substitutions.append((raw_original, raw_proposed))
return

if args.fix_unicode:
if fix_unicode:
raw_proposed = replace_unicode(raw_original)
if raw_proposed != raw_original:
print(f"unicode found in {entry.key}, fixing")
Expand Down Expand Up @@ -259,7 +259,7 @@ def run_entry(entry, cur, substitutions):
nentries = len(biblio_parsed.entries)
for ientry, entry in enumerate(biblio_parsed.entries, 1):
print("checking key %s %d/%d" % (entry.key, ientry, nentries))
run_entry(entry, cur, substitutions)
run_entry(entry, cur, args.fix_unicode, substitutions)

finally:
print("committing to database")
Expand Down

0 comments on commit 1a3f689

Please sign in to comment.