File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -106,11 +106,11 @@ class DataverseProvider(ProviderApi):
106
106
def supports (uri ):
107
107
"""Whether or not this provider supports a given uri."""
108
108
is_doi_ = is_doi (uri )
109
- if (is_doi_ is None and check_dataverse_uri (uri )) or \
110
- check_dataverse_doi (is_doi_ .group (0 )):
111
- return True
112
109
113
- return False
110
+ is_dataverse_uri = is_doi_ is None and check_dataverse_uri (uri )
111
+ is_dataverse_doi = is_doi_ and check_dataverse_doi (is_doi_ .group (0 ))
112
+
113
+ return is_dataverse_uri or is_dataverse_doi
114
114
115
115
@staticmethod
116
116
def record_id (uri ):
Original file line number Diff line number Diff line change @@ -624,8 +624,8 @@ def _init(lock, id_queue):
624
624
625
625
try :
626
626
for p in processing :
627
- p .wait ()
628
- p . get ()
627
+ p .get () # Will internally do the wait() as well.
628
+
629
629
except HTTPError as e :
630
630
raise BadParameter ((
631
631
'Could not process {0}.\n '
@@ -661,7 +661,7 @@ def extract_dataset(data_folder_, filename):
661
661
662
662
def stream_to_file (request ):
663
663
"""Stream bytes to file."""
664
- with open (download_to , 'wb' ) as f_ :
664
+ with open (str ( download_to ) , 'wb' ) as f_ :
665
665
scaling_factor = 1e-6
666
666
unit = 'MB'
667
667
Original file line number Diff line number Diff line change @@ -34,7 +34,5 @@ def extract_doi(uri):
34
34
"""Return the DOI in a string if there is one."""
35
35
match = doi_regexp .match (uri )
36
36
37
- if match is None :
38
- return None
39
-
40
- return match .group (2 )
37
+ if match :
38
+ return match .group (2 )
You can’t perform that action at this time.
0 commit comments