import urllib, urllib2, os, argparse

parser = argparse.ArgumentParser()
parser.add_argument('--pack', help='name of the pack, one word', required=True)
args = parser.parse_args()

runtime_dir = os.path.dirname(os.path.abspath(unicode(__file__, 'utf8')))
base_url = u'http://rianon.info/minecraft/' + args.pack + u'/'
update_script = u'update_pack.py'

print 'downloading <<', update_script
response = urllib2.urlopen(base_url + urllib.pathname2url(update_script))

with open(os.path.join(runtime_dir, update_script), 'wb') as f:
    f.write(response.read())
    f.close()
