Mercurial > repos > bgruening > chemical_data_sources
comparison get_online_data/get_online_data.py @ 5:c2055dd1927b draft default tip
Uploaded
author | bgruening |
---|---|
date | Thu, 24 Apr 2014 13:19:33 -0400 |
parents | f653fd06f055 |
children |
comparison
equal
deleted
inserted
replaced
4:7c1f9962ac07 | 5:c2055dd1927b |
---|---|
35 out = open(sys.argv[2], 'wb') | 35 out = open(sys.argv[2], 'wb') |
36 | 36 |
37 if len(sys.argv) > 3: | 37 if len(sys.argv) > 3: |
38 allowed_extensions = [ ext.strip() for ext in unescape(sys.argv[3]).split('\n') ] | 38 allowed_extensions = [ ext.strip() for ext in unescape(sys.argv[3]).split('\n') ] |
39 else: | 39 else: |
40 allowed_extensions = ['.sdf', '.smi', '.inchi'] | 40 allowed_extensions = ['.sdf', '.smi', '.inchi', '.mol'] |
41 | 41 |
42 for url in urls.split('\n'): | 42 for url in urls.split('\n'): |
43 url = url.strip() | 43 url = url.strip() |
44 request = urllib2.Request( url ) | 44 request = urllib2.Request( url ) |
45 request.add_header('Accept-encoding', 'gzip') | 45 request.add_header('Accept-encoding', 'gzip') |