~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to scripts/diffservice

  • Committer: mattgiuca
  • Date: 2008-07-15 09:18:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:877
pulldown_subj/__init__.py: Added "enrol_user" function which pulls down a user
    and also enrols them in the database.
Added script enrolallusers.py which scriptulously performs automatic
enrolments of all users in the system, similar to remakeallusers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
# run from the trampoline by the Diff application.
26
26
 
27
27
from common import cgirequest
28
 
import common.svn
29
28
import cgi
30
29
import os.path
31
30
import pysvn
52
51
 
53
52
    return output
54
53
 
 
54
def get_revision(r_str):
 
55
    """ Returns a Revison object for pysvn from a r query string """
 
56
    if r_str == "HEAD":
 
57
        return pysvn.Revision( pysvn.opt_revision_kind.head )
 
58
    elif r_str == "WORKING":
 
59
        return pysvn.Revision( pysvn.opt_revision_kind.working )
 
60
    elif r_str == "BASE":
 
61
        return pysvn.Revision( pysvn.opt_revision_kind.base )
 
62
    else:
 
63
        try:
 
64
            r = int(r_str)
 
65
            return pysvn.Revision( pysvn.opt_revision_kind.number, r)
 
66
        except:
 
67
            return None
 
68
        
55
69
# Use a CGIRequest object to make the CGI environment look like the normal
56
70
# IVLE handler environment.
57
71
 
70
84
fields = req.get_fieldstorage()
71
85
field_r = fields.getlist("r")
72
86
for ri in range(len(field_r)):
73
 
    r = common.svn.revision_from_string(field_r[ri])
 
87
    r = get_revision(field_r[ri])
74
88
    if r is not None:
75
89
        revs[ri] = r
76
90