Lines Matching full:statement
88 it was created by the same statement that created an unpicklable global,
89 it's not stored directly. Instead, the statement is stored in the
91 statement, the unpicklable statements are evaluated to recreate the
96 executing a statement, we skip the ones in unpicklable_names.
143 def add_unpicklable(self, statement, names):
144 """Adds a statement and list of names to the unpicklables.
149 statement: string, the statement that created new unpicklable global(s).
150 names: list of strings; the names of the globals created by the statement.
152 self.unpicklables.append(db.Text(statement))
199 """Evaluates a python statement in a given session and returns the result.
205 # extract the statement to be run
206 statement = self.request.get('statement')
207 if not statement:
211 statement = statement.replace('\r\n', '\n')
213 # add a couple newlines at the end of the statement. this makes
215 statement += '\n\n'
217 # log and compile the statement up front
219 logging.info('Compiling and evaluating:\n%s' % statement)
220 compiled = compile(statement, '<string>', 'single')
225 # create a dedicated module to be used as this statement's __main__
237 # globals, run the statement, and re-pickle the session globals, all
274 # extract the new globals that this statement added
282 # this statement added an unpicklable global. store the statement and
284 session.add_unpicklable(statement, new_globals.keys())
285 logging.debug('Storing this statement as an unpicklable.')
288 # this statement didn't add any unpicklables. pickle and store the