diff options
Diffstat (limited to 'reconcile.py')
| -rw-r--r-- | reconcile.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/reconcile.py b/reconcile.py index 8228528..88e1209 100644 --- a/reconcile.py +++ b/reconcile.py @@ -171,7 +171,24 @@ class MasterBibTeX(BibTeX.BibTeX): for g, m in matches: print "%%%% goodness", g print m - + + +def noteToURL(note): + " returns tp, url " + note = note.replace("\n", " ") + m = re.match(r'\s*(?:\\newline\s*)*\s*\\url{(.*)}\s*(?:\\newline\s*)*', + note) + if not m: + return None + url = m.group(1) + for suffix, tp in ((".html", "html"), + (".ps", "ps"), + (".ps.gz", "ps_gz"), + (".pdf", "pdf"), + (".txt", "txt")): + if url.endswith(suffix): + return tp,url + return "???", url all_ok = 1 def emit(f,ent): |
