mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Remove some debugging prints. Fix import order. Consolidate exception logging in ToolShed database migrations.
29 lines
513 B
Python
29 lines
513 B
Python
#!/usr/bin/env python
|
|
"""
|
|
Script that just echos the command line.
|
|
"""
|
|
from __future__ import print_function
|
|
|
|
import sys
|
|
|
|
from six.moves.urllib.request import urlopen
|
|
|
|
assert sys.version_info[:2] >= (2, 6)
|
|
|
|
BUFFER = 1048576
|
|
|
|
url = sys.argv[1]
|
|
out_name = sys.argv[2]
|
|
|
|
out = open(out_name, 'wt')
|
|
try:
|
|
page = urlopen(url)
|
|
while 1:
|
|
data = page.read(BUFFER)
|
|
if not data:
|
|
break
|
|
out.write(data)
|
|
except Exception as e:
|
|
print('Error getting the data -> %s' % e)
|
|
out.close()
|