Example #1
0
 def render(self, context):
     if self.use_pdb:
         pdb_with_context(context)
     else:
         setup_readline_history()
         run_shell(context)
     return ''
 def execute(self, use_pdb):
     if use_pdb:
         import ipdb
         ipdb.set_trace()
     else:
         setup_readline_history()
         run_shell(locals())
     return ''
 def handle(self, url, context, use_pdb, *args, **kwargs):
     if context:
         context_dict = eval(context)
     else:
         context_dict = {}
     context = Context(context_dict)
     if url is not None:
         setup_test_environment()
         client = Client()
         response = client.get(url)
         if not response.context:
             print 'Response for given URL contains no context (code %s).' % response.status_code
         else:
             if isinstance(response.context, Context):
                 context = response.context
             elif isinstance(response.context, ContextList):
                 # TODO: probably should try to merge all contexts
                 context = response.context[0]
     if use_pdb:
         pdb_with_context(context)
     else:
         setup_readline_history()
         run_shell(context)
 def handle(self, *args, **kwargs):
     setup_readline_history()
     run_shell()
Example #5
0
 def render(self, context):
     setup_readline_history()
     run_shell(context)
     return ''