[Tahoe-dev] tahoe-cat.py

Zooko O'Whielacronx zooko at zooko.com
Mon Jul 9 17:52:52 PDT 2007


Dear People of tahoe-dev:

Now that Brian has nailed ticket #48 (API), we're working on ticket  
#53 (CLI).  (By the way, Amber and I flew to San Francisco yesterday  
and we're working at Allmydata HQ.)

The API is defined in docs/webapi.txt [1].

Here is the first command-line tool for tahoe, "tahoe-cat.py".  When  
you run you pass a file name as its only argument, and it reads that  
file from a tahoe grid and writes the file contents to stdout.   
(Which grid it uses is currently hardcoded.)

------- begin included file "tahoe-cat.py"
#!/usr/bin/env python

import sys, urllib

def GET(url):
     f = urllib.urlopen(url)
     sys.stdout.write(f.read())

vfname = sys.argv[1]

base = "http://tahoebs1.allmydata.com:8011/"
base += "vdrive/global/"
url = base + vfname

GET(url)
------- end included file "tahoe-cat.py"

Regards,

Zooko

[1] http://allmydata.org/trac/tahoe/browser/docs/webapi.txt

tickets mentioned in this letter:

http://allmydata.org/trac/tahoe/ticket/48
http://allmydata.org/trac/tahoe/ticket/53


More information about the Tahoe-dev mailing list