~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-17 11:32:50 UTC
  • Revision ID: coles.david@gmail.com-20100717113250-vi18n50bcjmfmzrt
Show warning for CGI header field-names which contain restricted characters.

Forbidden characters are the separators defined by RFC3875. This is mainly to 
fix an issue where printing a dictionary (with no CGI headers) could be 
assumed to be a CGI header with no warnings.

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