本文整理汇总了Python中logilab.astng.MANAGER.astng_from_file方法的典型用法代码示例。如果您正苦于以下问题:Python MANAGER.astng_from_file方法的具体用法?Python MANAGER.astng_from_file怎么用?Python MANAGER.astng_from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logilab.astng.MANAGER
的用法示例。
在下文中一共展示了MANAGER.astng_from_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_astng
# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import astng_from_file [as 别名]
def get_astng(self, filepath, modname):
"""return a astng representation for a module"""
try:
return MANAGER.astng_from_file(filepath, modname, source=True)
except SyntaxError as ex:
self.add_message('E0001', line=ex.lineno, args=ex.msg)
except ASTNGBuildingException as ex:
self.add_message('F0010', args=ex)
except Exception as ex:
import traceback
traceback.print_exc()
self.add_message('F0002', args=(ex.__class__, ex))
示例2: get_astng
# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import astng_from_file [as 别名]
def get_astng(self, filepath, modname):
"""return a astng representation for a module"""
try:
return MANAGER.astng_from_file(filepath, modname)
except SyntaxError, ex:
self.add_message('E0001', line=ex.lineno, args=ex.msg)