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

« back to all changes in this revision

Viewing changes to services/python-console

  • Committer: David Coles
  • Date: 2010-07-27 04:52:14 UTC
  • Revision ID: coles.david@gmail.com-20100727045214-p32h1kc0gcv48dpr
Worksheets: Strip off whitespace from the end of exercise attempts.

This solves an issue where accidental whitespace in an attempt will cause 
"IndentationError" syntax error (which don't occur when run in console).

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
 
171
171
    def run(self):
172
172
        # Set up global space and partial command buffer
173
 
        self.globs = {}
 
173
        self.globs = {'__name__': '__main__'}
174
174
        self.curr_cmd = ''
175
175
 
176
176
        # Set up I/O to use web interface
262
262
    def handle_globals(self, params):
263
263
        # Unpickle the new space (if provided)
264
264
        if isinstance(params, dict):
265
 
            self.globs = {}
 
265
            self.globs = {'__name__': '__main__'}
266
266
            for g in params:
267
267
                try:
268
268
                    self.globs[g] = cPickle.loads(params[g])