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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: David Coles
  • Date: 2010-07-20 00:30:45 UTC
  • Revision ID: coles.david@gmail.com-20100720003045-j239u3w3m5wfribb
Put "__name__" = "__main__" into globals for console.

Fixes issue where __name__ did not work when run in the python console. exec() 
with an empty globals dictionary will result in "__name__" = "__builtin__".

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
        offering = group.project_set.offering
144
144
        reponame = "_".join([offering.subject.short_name,
145
145
                             offering.semester.year,
146
 
                             offering.semester.url_name,
 
146
                             offering.semester.semester,
147
147
                             group.name])
148
148
 
149
149
        f.write("[%s:/]\n" % reponame.encode('utf-8'))
161
161
    # a single query, and we cache the list of viewers for each offering.
162
162
    offering_viewers_cache = {}
163
163
    for (ssn, year, sem, name, psid, pspath, gid, offeringid) in store.find(
164
 
        (Subject.short_name, Semester.year, Semester.url_name,
 
164
        (Subject.short_name, Semester.year, Semester.semester,
165
165
         ProjectGroup.name, ProjectSubmission.id, ProjectSubmission.path,
166
166
         ProjectGroup.id, Offering.id),
167
167
            Assessed.id == ProjectSubmission.assessed_id,