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

« back to all changes in this revision

Viewing changes to scripts/python-console

  • Committer: mattgiuca
  • Date: 2008-03-05 05:32:22 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:649
lib/common/cgirequest.py: Added "message" arg to req.throw_error.
    Now just raises an exception instead of printing. This should
    be handled in the same way as errors in the main IVLE
    (bug added).

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        ln = self.lineQ.get()
49
49
        if 'chat' in ln:
50
50
            return ln['chat']
 
51
        if 'interrupt' in ln:
 
52
            raise Interrupt()
51
53
 
52
54
class StdoutToWeb(object):
53
55
    def __init__(self, cmdQ, lineQ):
90
92
    def __init__(self, cmdQ, lineQ):
91
93
        self.cmdQ = cmdQ
92
94
        self.lineQ = lineQ
93
 
        self.stdout = None
 
95
        self.stdout = StdoutToWeb(self.cmdQ, self.lineQ)
94
96
        Thread.__init__(self)
95
97
 
96
98
    def execCmd(self, cmd):
97
99
        try:
98
100
            sys.stdin = StdinFromWeb(self.cmdQ, self.lineQ)
99
 
            self.stdout = StdoutToWeb(self.cmdQ, self.lineQ)
100
101
            sys.stdout = self.stdout
101
102
            sys.stderr = self.stdout
102
103
            res = eval(cmd, self.globs, self.locls)