views:

56

answers:

1

Possible Duplicate:
Looping through a directory on the web and displaying its contents (files and other directories) via Python

hi, Guys,

If I have code files under

http://AAA/BBB/tags/revision/

how can I download these files in python?

and If they have 600M in total, is there some efficient way to do it?

A: 

Are you using svn as your repository? It would look like this:

from subprocess import  Popen, PIPE

def svn_co(url):
    return run_program('svn', 'co', url)

def run_program(*args):
    popen_obj = Popen(args, stderr=PIPE)
    _, errors = popen_obj.communicate()
    if popen_obj.returncode:
        print errors

# This will get all the files in myproject's tagged version
# named tagname into the current directory
svn_co('http://svn.myserver.net/myproject/tags/tagname')
hughdbrown