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

« back to all changes in this revision

Viewing changes to lib/common/util.py

  • Committer: dcoles
  • Date: 2008-08-19 06:44:05 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1029
Tutorial Service: Ported the tutorial service to the console so that all 
student code should now be run inside the jail. This means that the code will 
also be contrained by trampoline's ulimits and will no longer need to run as 
the webserver (with all the badness that entails).

* TestFramework has been modifed to make eqvivalent calls to the console.
* Tutorial service now starts up a console for each attempt.
* Modifications to python-console script and console module to allow new calls 
needed.
* Added a FakeObject class to util to use to represent things that can not be 
pickled. (Ideally should be in the console module, but the console module can't 
be imported into the jail at the moment - relies on a full lib/conf/conf.py).  
Might be possible to make these fake objects able to call the console too?

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self.message = message
63
63
        self.info = info
64
64
 
 
65
class FakeObject(object):
 
66
    """ A representation of an object that can't be Pickled """
 
67
    def __init__(self, type, name, attrib={}):
 
68
        self.type = type
 
69
        self.name = name
 
70
        self.attrib = attrib
 
71
 
 
72
    def __repr__(self):
 
73
        return "<Fake %s %s>"%(self.type, self.name)
 
74
 
 
75
 
65
76
def make_path(path):
66
77
    """Given a path relative to the IVLE root, makes the path relative to the
67
78
    site root using conf.root_dir. This path can be used in URLs sent to the