Skip to content

Commit 3b393f1

Browse files
authored
Merge pull request #54 from braffes/master
Issue when only http.group.file.name is set
2 parents b23668c + 3de17b8 commit 3b393f1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

biomaj_download/download/curl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ def _http_parse_result(self, result):
568568
files = re.findall(self.http_parse.file_line, result)
569569
if files is not None and len(files) > 0:
570570
for foundfile in files:
571+
if not isinstance(foundfile, tuple):
572+
foundfile = tuple([foundfile])
571573
rfile = {}
572574
rfile['permissions'] = ''
573575
rfile['group'] = ''
@@ -601,9 +603,11 @@ def _http_parse_result(self, result):
601603
rfile['month'] = today.month
602604
rfile['day'] = today.day
603605
rfile['year'] = today.year
606+
604607
rfile['name'] = foundfile[self.http_parse.file_name - 1]
605608
filehash = (rfile['name'] + str(date) + str(rfile['size'])).encode('utf-8')
606609
rfile['hash'] = hashlib.md5(filehash).hexdigest()
610+
607611
rfiles.append(rfile)
608612
return (rfiles, rdirs)
609613

0 commit comments

Comments
 (0)