180
180
logging.info("Populating student repositories")
182
svnclient = ivle.svn.create_auth_svn_client_autopass("studenta")
183
workspace = temp_checkout(svnclient, "studenta")
184
dirname = os.path.join(workspace, "stuff")
185
filename = os.path.join(dirname, "hello.py")
186
if not os.path.isdir(dirname):
188
svnclient.add(dirname, force=True)
189
# XXX Copy files from a sample directory
190
f = open(filename, "w")
192
# Hello IVLE, by Alice Student
193
# CGI program -- Prints CGI headers, then HTML output
195
print "Content-Type: text/html"
197
print "<html><body><p>Hello, world!</p></body></html>"
200
svnclient.add(filename, force=True)
201
svnclient.checkin(workspace, "Added some files")
202
shutil.rmtree(workspace)
181
def svnload(dumpfile, repo):
182
"""Run svnadmin load.
183
@param dumpfile: Dump file to load from, relative to examples/userrepos.
184
@param repo: Repo to write to, relative to /var/lib/ivle/svn/repositories.
186
f = open(os.path.join("examples/userrepos", dumpfile), "rb")
187
repo = os.path.join(config['paths']['svn']['repo_path'], repo)
188
errmsg = runprog_stderr(["sudo", "-u", "www-data", "svnadmin", "load",
190
if errmsg is not None:
191
logging.error(errmsg)
194
# Load the known SVN dump files
195
svnload("studenta.dump", "users/studenta")
196
svnload("group1.dump", "groups/ivle-102_2009_2_group1")