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


Python MANAGER.project_from_files方法代码示例

本文整理汇总了Python中logilab.astng.MANAGER.project_from_files方法的典型用法代码示例。如果您正苦于以下问题:Python MANAGER.project_from_files方法的具体用法?Python MANAGER.project_from_files怎么用?Python MANAGER.project_from_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在logilab.astng.MANAGER的用法示例。


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

示例1: test_functional_relation_extraction

# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import project_from_files [as 别名]
 def test_functional_relation_extraction(self):
     """functional test of relations extraction;
     different classes possibly in different modules"""
     # XXX should be catching pyreverse environnement problem but doesn't
     # pyreverse doesn't extracts the relations but this test ok
     project = MANAGER.project_from_files(["data"], astng_wrapper)
     handler = DiadefsHandler(Config())
     diadefs = handler.get_diadefs(project, Linker(project, tag=True))
     cd = diadefs[1]
     relations = _process_relations(cd.relationships)
     self.assertEquals(relations, self._should_rels)
开发者ID:Zucus,项目名称:kitsune,代码行数:13,代码来源:unittest_pyreverse_diadefs.py

示例2: test_known_values2

# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import project_from_files [as 别名]
 def test_known_values2(self):
     project = MANAGER.project_from_files(['data.clientmodule_test'], astng_wrapper)
     dd = DefaultDiadefGenerator(Linker(project), HANDLER).visit(project)
     self.assertEqual(len(dd), 1)
     keys = [d.TYPE for d in dd]
     self.assertEqual(keys, ['class'])
     cd = dd[0]
     self.assertEqual(cd.title, 'classes No Name')
     classes = _process_classes(cd.objects)
     self.assertEqual(classes, [(True, 'Ancestor'),
                                (True, 'DoNothing'),
                                (True, 'Specialization')]
                       )
开发者ID:Chaos99,项目名称:cachetools,代码行数:15,代码来源:unittest_pyreverse_diadefs.py

示例3: test_known_values2

# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import project_from_files [as 别名]
 def test_known_values2(self):
     project = MANAGER.project_from_files(["data.clientmodule_test"], astng_wrapper)
     dd = DefaultDiadefGenerator(Linker(project), HANDLER).visit(project)
     self.assertEquals(len(dd), 1)
     keys = [d.TYPE for d in dd]
     self.assertEquals(keys, ["class"])
     cd = dd[0]
     self.assertEquals(cd.title, "classes No Name")
     classes = _process_classes(cd.objects)
     self.assertEquals(
         classes,
         [
             {"node": True, "name": "Ancestor"},
             {"node": True, "name": "DoNothing"},
             {"node": True, "name": "Specialization"},
         ],
     )
开发者ID:Zucus,项目名称:kitsune,代码行数:19,代码来源:unittest_pyreverse_diadefs.py

示例4: astng_wrapper

# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import project_from_files [as 别名]
import sys

from logilab import astng
from logilab.astng import MANAGER
from logilab.astng.inspector import Linker

from pylint.pyreverse.diadefslib import *

from utils import Config


def astng_wrapper(func, modname):
    return func(modname)


PROJECT = MANAGER.project_from_files(["data"], astng_wrapper)

CONFIG = Config()
HANDLER = DiadefsHandler(CONFIG)


def _process_classes(classes):
    """extract class names of a list"""
    result = []
    for classe in classes:
        result.append({"node": isinstance(classe.node, astng.Class), "name": classe.title})
    result.sort()
    return result


def _process_modules(modules):
开发者ID:Zucus,项目名称:kitsune,代码行数:33,代码来源:unittest_pyreverse_diadefs.py

示例5: setUp

# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import project_from_files [as 别名]
 def setUp(self):
     self.project = MANAGER.project_from_files(['data2'], astng_wrapper) 
     self.linker = inspector.Linker(self.project)
     self.linker.visit(self.project)
开发者ID:steverecio,项目名称:.emacs.d,代码行数:6,代码来源:unittest_inspector.py


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