~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-28 10:45:53 UTC
  • mfrom: (1829 trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: coles.david@gmail.com-20100728104553-5z3nxt0l6kyfqfh5
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# usage:
4
4
#   python-console <port> <magic> [<working-dir>]
5
5
 
6
 
import cjson
7
6
import codeop
8
7
import cPickle
9
8
import cStringIO
170
169
 
171
170
    def run(self):
172
171
        # Set up global space and partial command buffer
173
 
        self.globs = {}
 
172
        self.globs = {'__name__': '__main__'}
174
173
        self.curr_cmd = ''
175
174
 
176
175
        # Set up I/O to use web interface
262
261
    def handle_globals(self, params):
263
262
        # Unpickle the new space (if provided)
264
263
        if isinstance(params, dict):
265
 
            self.globs = {}
 
264
            self.globs = {'__name__': '__main__'}
266
265
            for g in params:
267
266
                try:
268
267
                    self.globs[g] = cPickle.loads(params[g])