本文整理汇总了Python中pydevd_vars.varToXML函数的典型用法代码示例。如果您正苦于以下问题:Python varToXML函数的具体用法?Python varToXML怎么用?Python varToXML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了varToXML函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doIt
def doIt(self, dbg):
""" Converts request into python variable """
pydev_start_new_thread = None
try:
try:
pydev_start_new_thread = thread.start_new_thread
thread.start_new_thread = thread._original_start_new_thread #don't trace new threads created by console command
thread.start_new = thread._original_start_new_thread
result = pydevconsole.consoleExec(self.thread_id, self.frame_id, self.expression)
xml = "<xml>"
xml += pydevd_vars.varToXML(result, "")
xml += "</xml>"
cmd = dbg.cmdFactory.makeEvaluateExpressionMessage(self.sequence, xml)
dbg.writer.addCommand(cmd)
except:
exc = GetExceptionTracebackStr()
sys.stderr.write('%s\n' % (exc,))
cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error evaluating console expression " + exc)
dbg.writer.addCommand(cmd)
finally:
thread.start_new_thread = pydev_start_new_thread
thread.start_new = pydev_start_new_thread
sys.stderr.flush()
sys.stdout.flush()
示例2: evaluate
def evaluate(self, expression):
xml = "<xml>"
result = pydevd_vars.evalInContext(expression, self.getNamespace(), self.getNamespace())
xml += pydevd_vars.varToXML(result, expression)
xml += "</xml>"
return xml
示例3: doIt
def doIt(self, dbg):
""" Converts request into python variable """
try:
result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
xml = "<xml>"
xml += pydevd_vars.varToXML(result, "")
xml += "</xml>"
cmd = dbg.cmdFactory.makeEvaluateExpressionMessage(self.sequence, xml)
dbg.writer.addCommand(cmd)
except:
exc = GetExceptionTracebackStr()
print >> sys.stderr, exc
cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error evaluating expression " + exc)
dbg.writer.addCommand(cmd)