mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
tahoe-get.py: accept vdrive and server options (using optparse)
This commit is contained in:
parent
8769f2eeba
commit
9641a6df22
@ -1,15 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys, urllib
|
||||
import optparse, sys, urllib
|
||||
|
||||
def GET(url):
|
||||
f = urllib.urlopen(url)
|
||||
sys.stdout.write(f.read())
|
||||
|
||||
vfname = sys.argv[1]
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("-d", "--vdrive", dest="vdrive", default="global")
|
||||
parser.add_option("-s", "--server", dest="server", default="http://tahoebs1.allmydata.com:8011")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
vfname = args[0]
|
||||
|
||||
base = "http://tahoebs1.allmydata.com:8011/"
|
||||
base += "vdrive/global/"
|
||||
base += "vdrive/"
|
||||
base += options.vdrive
|
||||
base += "/"
|
||||
|
||||
url = base + vfname
|
||||
|
||||
GET(url)
|
||||
|
Loading…
Reference in New Issue
Block a user