Created
August 13, 2009 00:42
-
-
Save mlbright/166883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# read an svn parent page and export everything | |
import re | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
from subprocess import call | |
import os | |
subversion = 'http://subversion.tigris.org/' | |
parentdir = 'http://svn/repos' | |
doc = urllib2.urlopen(parentdir + os.sep).read() | |
soup = BeautifulSoup(doc) | |
tail = re.compile(r"^[p-z]") | |
for a in soup('a'): | |
if a['href'] == subversion: | |
continue | |
if not tail.match(a['href']): | |
continue | |
repo = os.sep.join([parentdir, a['href']]) | |
exportcmd = "svn export %s" % (repo) | |
call(exportcmd, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment