Remove print statement and unused import

pull/730/head
Tim Head 2019-07-03 06:53:59 +02:00
rodzic 4b0e838136
commit dd8ba8ec18
2 zmienionych plików z 2 dodań i 4 usunięć

Wyświetl plik

@ -4,7 +4,7 @@ import shutil
from os import makedirs
from os import path
from urllib.request import build_opener, urlopen, Request
from urllib.request import urlopen, Request
from urllib.error import HTTPError
from zipfile import ZipFile, is_zipfile

Wyświetl plik

@ -422,14 +422,12 @@ doi_regexp = re.compile(
def is_doi(val):
"""Returns None if val doesn't match pattern of a DOI.
http://en.wikipedia.org/wiki/Digital_object_identifier."""
print(type(val))
print(val)
return doi_regexp.match(val)
def normalize_doi(val):
"""Return just the DOI (e.g. 10.1234/jshd123)
from a val that could include a url or doi
from a val that could include a url or doi
(e.g. https://doi.org/10.1234/jshd123)"""
m = doi_regexp.match(val)
return m.group(2)