当前位置: 首页>>代码示例>>Python>>正文


Python pydevd_vars.findFrame函数代码示例

本文整理汇总了Python中pydevd_vars.findFrame函数的典型用法代码示例。如果您正苦于以下问题:Python findFrame函数的具体用法?Python findFrame怎么用?Python findFrame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了findFrame函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doIt

    def doIt( self, dbg ):
        """ Converts request into completions """
        try:
            remove_path = None
            try:

                frame = pydevd_vars.findFrame( self.thread_id, self.frame_id )
                if frame is not None:

                    msg = _pydev_completer.GenerateCompletionsAsXML( frame, self.act_tok )

                    cmd = dbg.cmdFactory.makeGetCompletionsMessage( self.sequence, msg )
                    dbg.writer.addCommand( cmd )
                else:
                    cmd = dbg.cmdFactory.makeErrorMessage( self.sequence, "InternalGetCompletions: Frame not found: %s from thread: %s" % ( self.frame_id, self.thread_id ) )
                    dbg.writer.addCommand( cmd )


            finally:
                if remove_path is not None:
                    sys.path.remove( remove_path )

        except:
            exc = GetExceptionTracebackStr()
            sys.stderr.write( '%s\n' % ( exc, ) )
            cmd = dbg.cmdFactory.makeErrorMessage( self.sequence, "Error evaluating expression " + exc )
            dbg.writer.addCommand( cmd )
开发者ID:Entropy-Soldier,项目名称:ges-python,代码行数:27,代码来源:pydevd_comm.py

示例2: doIt

    def doIt(self, dbg):
        """ Converts request into completions """
        try:
            remove_path = None
            try:
                import _completer
            except:
                path = os.environ['PYDEV_COMPLETER_PYTHONPATH']
                sys.path.append(path)
                remove_path = path
                import _completer
            
            try:
                
                frame = pydevd_vars.findFrame(self.thread_id, self.frame_id)
                if frame is not None:
                
                    #Not using frame.f_globals because of https://sourceforge.net/tracker2/?func=detail&aid=2541355&group_id=85796&atid=577329
                    #(Names not resolved in generator expression in method)
                    #See message: http://mail.python.org/pipermail/python-list/2009-January/526522.html
                    updated_globals = {}
                    updated_globals.update(frame.f_globals)
                    updated_globals.update(frame.f_locals) #locals later because it has precedence over the actual globals
                
                    completer = _completer.Completer(updated_globals, None)
                    #list(tuple(name, descr, parameters, type))
                    completions = completer.complete(self.act_tok)
                    
                    
                    def makeValid(s):
                        return pydevd_vars.makeValidXmlValue(pydevd_vars.quote(s, '/>_= \t'))
                    
                    msg = "<xml>"
                    
                    for comp in completions:
                        msg += '<comp p0="%s" p1="%s" p2="%s" p3="%s"/>' % (makeValid(comp[0]), makeValid(comp[1]), makeValid(comp[2]), makeValid(comp[3]),)
                    msg += "</xml>"
                    
                    cmd = dbg.cmdFactory.makeGetCompletionsMessage(self.sequence, msg)
                    dbg.writer.addCommand(cmd)
                else:
                    cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "InternalGetCompletions: Frame not found: %s from thread: %s" % (self.frame_id, self.thread_id))
                    dbg.writer.addCommand(cmd)

                
            finally:
                if remove_path is not None:
                    sys.path.remove(remove_path)
                    
        except:
            exc = GetExceptionTracebackStr()
            sys.stderr.write('%s\n' % (exc,))
            cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error evaluating expression " + exc)
            dbg.writer.addCommand(cmd)
开发者ID:jonhairston,项目名称:yats,代码行数:54,代码来源:pydevd_comm.py

示例3: doIt

 def doIt(self, dbg):
     """ Converts request into python variable """
     try:
         try:
             xml = "<xml>"            
             frame = pydevd_vars.findFrame(self.thread_id, self.frame_id)
             xml += pydevd_vars.frameVarsToXML(frame)
             del frame
             xml += "</xml>"
             cmd = dbg.cmdFactory.makeGetFrameMessage(self.sequence, xml)
             dbg.writer.addCommand(cmd)
         except pydevd_vars.FrameNotFoundError:
             #pydevd_vars.dumpFrames(self.thread_id)
             #don't print this error: frame not found: means that the client is not synchronized (but that's ok)
             cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Frame not found: %s from thread: %s" % (self.frame_id, self.thread_id))
             dbg.writer.addCommand(cmd)
     except:
         cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error resolving frame: %s from thread: %s" % (self.frame_id, self.thread_id))
         dbg.writer.addCommand(cmd)
开发者ID:DexterW,项目名称:django-webservice-tools,代码行数:19,代码来源:pydevd_comm.py

示例4: consoleExec

def consoleExec(thread_id, frame_id, expression):
    """returns 'False' in case expression is partialy correct
    """
    frame = pydevd_vars.findFrame(thread_id, frame_id)

    expression = str(expression.replace('@[email protected]', '\n'))

    #Not using frame.f_globals because of https://sourceforge.net/tracker2/?func=detail&aid=2541355&group_id=85796&atid=577329
    #(Names not resolved in generator expression in method)
    #See message: http://mail.python.org/pipermail/python-list/2009-January/526522.html
    updated_globals = {}
    updated_globals.update(frame.f_globals)
    updated_globals.update(frame.f_locals) #locals later because it has precedence over the actual globals

    if IPYTHON:
        return exec_expression(expression, updated_globals, frame.f_locals)

    interpreter = ConsoleWriter()

    try:
        code = compile_command(expression)
    except (OverflowError, SyntaxError, ValueError):
        # Case 1
        interpreter.showsyntaxerror()
        return False

    if code is None:
        # Case 2
        return True

    #Case 3

    try:
        Exec(code, updated_globals, frame.f_locals)

    except SystemExit:
        raise
    except:
        interpreter.showtraceback()

    return False
开发者ID:akiokio,项目名称:centralfitestoque,代码行数:41,代码来源:pydevconsole.py


注:本文中的pydevd_vars.findFrame函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。