PageRenderTime 33ms CodeModel.GetById 28ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Demo/pdist/sumtree.py

http://unladen-swallow.googlecode.com/
Python | 24 lines | 20 code | 3 blank | 1 comment | 2 complexity | f2ae6a1e5388e62f067cf3fefef852d9 MD5 | raw file
 1import time
 2import FSProxy
 3
 4def main():
 5    t1 = time.time()
 6    #proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127))
 7    proxy = FSProxy.FSProxyLocal()
 8    sumtree(proxy)
 9    proxy._close()
10    t2 = time.time()
11    print t2-t1, "seconds"
12    raw_input("[Return to exit] ")
13
14def sumtree(proxy):
15    print "PWD =", proxy.pwd()
16    files = proxy.listfiles()
17    proxy.infolist(files)
18    subdirs = proxy.listsubdirs()
19    for name in subdirs:
20        proxy.cd(name)
21        sumtree(proxy)
22        proxy.back()
23
24main()