ANN: python client

Justin Azoff JAzoff at uamail.albany.edu
Fri May 6 10:51:57 PDT 2005


On Fri, 2005-05-06 at 10:30 -0700, Brad Fitzpatrick wrote:
> Wow, what a surprise.  The other day PHP and today Python.  This is great.
> 
> Do you want me to link this from the MogileFS website?  You going to make
> a page for it?
> 
> - Brad
> 

I don't know about making a page, but you can link to it :-)

the header of the file has some docs, and this is the usage.bml page in
python:

(%:~)- python
Python 2.3.5 (#2, Feb  9 2005, 00:38:15) 
[GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mogilefs
>>> c=mogilefs.Client(domain='test',trackers=['peter:7001'])
>>> f=c.new_file('file_key','normal')
>>> f.write("file contents")
13
>>> f.close()
True
>>> print c.get_file_data('file_key')
file contents
>>> c.get_paths('file_key')
['http://1.2.3.4:7500/dev1/0/000/000/0000000597.fid',
'http://1.2.3.5:7500/dev3/0/000/000/0000000597.fid']
>>> 

It should work exactly the same :-)

I've already updated it a few times.. some minor changes with exception
handling.

Aside from the Admin stuff not being done, it seems to work nicely.  Any
bugs would be attributed to only working on it for ~24 hours :-)



-- 
-- Justin Azoff
-- Network Performance Analyst



More information about the mogilefs mailing list