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:
Nicola Soranzo
2018-08-22 12:42:23 +01:00
parent fc167c068c
commit c852de734d
+2 -2
View File
@@ -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__":