~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Demo/pdist/sumtree.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import time
 
2
import FSProxy
 
3
 
 
4
def 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
 
 
14
def 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
 
 
24
main()