mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
Fix cron/build_chrom_db.py
Fix the following errors:
```
$ python cron/build_chrom_db.py tool-data/shared/ucsc/chrom/ tool-data/shared/ucsc/builds.txt
Retrieving hg38
Failed to retrieve hg38: Problem parsing line ''
Retrieving hg19
Failed to retrieve hg19: Problem parsing line ''
...
```
Broken in commit 9b8e76f9d9 .
This commit is contained in:
@@ -37,7 +37,7 @@ def getchrominfo(url, db):
|
||||
"position": "",
|
||||
"hgta_doTopSubmit": "get info"})
|
||||
page = requests.get(URL).text
|
||||
for line in page.split('\n'):
|
||||
for i, line in enumerate(page.splitlines()):
|
||||
line = line.rstrip("\r\n")
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
@@ -45,7 +45,7 @@ def getchrominfo(url, db):
|
||||
if len(fields) > 1 and len(fields[0]) > 0 and int(fields[1]) > 0:
|
||||
yield [fields[0], fields[1]]
|
||||
else:
|
||||
raise Exception("Problem parsing line '%s'" % line)
|
||||
raise Exception("Problem parsing line %d '%s' in page '%s'" % (i, line, page))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user