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


Python ArchiLib.logTypeCounts方法代码示例

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


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

示例1: createArchimateConcepts

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def createArchimateConcepts(fileArchimate, fileConceptsArch):

    logger.info(u"Using : %s" % fileArchimate)

    concepts = Concepts(fileArchimateModel, u"Archimate")

    al = ArchiLib(fileArchimate)

    al.logTypeCounts()

    #
    # Create Concepts from Archimate
    #
    al.folderConcepts(concepts)
    Concepts.saveConcepts(concepts, fileConceptsArch)
    logger.info(u"Saved concepts to : %s" % fileConceptsArch)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:18,代码来源:al_CreateArchimateConcepts.py

示例2: test_ArchiCounts

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def test_ArchiCounts(cleandir, fileArchimate):
    assert (os.path.isfile(fileArchimate) is True)

    al = ArchiLib(fileArchimateTest)

    lc = al.logTypeCounts()

    assert (len(lc) > 0)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:10,代码来源:test_all_phases.py

示例3: ImportCSVIntoArchi

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def ImportCSVIntoArchi(fileArchimate, folder, subfolder, fileMetaEntity):

    start_time = ArchiLib.startTimer()

    logger.info(u"Using : %s" % fileArchimate)
    al = ArchiLib(fileArchimate)

    _ = al.logTypeCounts(ListOnly=True)

    al.insertNColumns(folder, subfolder, fileMetaEntity, CaseFix=False)

    al.outputXMLtoFile()

    relations = len(al.dictRel)
    nodes = len(al.dictND)

    logger.info(u"----------------------------------------------------------------------------------------")
    logger.info(u"Encountered %d errors and added %d Nodes and %d relations" % (len(al.listErrors), nodes, relations))

    ArchiLib.stopTimer(start_time)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:22,代码来源:al_ImportCSVIntoArchi.py

示例4: organizeFolders

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def organizeFolders(fileArchimate):

    logger.info(u"Using : %s" % fileArchimate)

    al = ArchiLib(fileArchimate)

    for folder in entityFolders:
        pass

    sl = al.logTypeCounts()

    nl = [(x[10:], y) for x, y in sl]

    n = 0
    for k, v in al.dictNodes.items():
        logger.debug(u"%s" % v)

        n += 1

        try:
            af = v[ARCHI_TYPE][10:]

        except KeyError, msg:
            continue

        if af in entityFolders:
            logger.debug(u"%d - %s - %s : %s" % (n, v[NAME], af, entityFolders[af]))
            Add(af)
        else:
            logger.info(u"%d Missing - %s" % (n, af))

        if False:
            # Create Subfolder
            folder = u"Implementation & Migration"
            subfolder = u"Dependancy Analysis - %s" % time.strftime(u"%Y%d%m_%H%M%S")

            attrib = dict()
            attrib[u"id"] = al.getID()
            attrib[u"name"] = subfolder
            al.insertNode(u"folder", folder, attrib)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:42,代码来源:al_OrganizeFolders.py

示例5: test_CreateArchimateConcepts

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def test_CreateArchimateConcepts(cleandir, fileArchimate):

    assert (os.path.isfile(fileArchimate) is True)

    logger.info(u"Using : %s" % fileArchimate)

    concepts = Concepts(fileArchimate, u"Archimate")

    al = ArchiLib(fileArchimate)

    lc = al.logTypeCounts()

    assert (len(lc) > 0)

    #
    # Create Concepts from Archimate
    #
    al.folderConcepts(concepts)
    Concepts.saveConcepts(concepts, fileConceptsArch)
    logger.info(u"Saved concepts to : %s" % fileConceptsArch)

    assert (os.path.isfile(fileConceptsArch) is True)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:24,代码来源:test_all_phases.py

示例6: cleanArchimateRelationships

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
def cleanArchimateRelationships(fileArchimate):

    al = ArchiLib(fileArchimate)

    al.logTypeCounts()

    n = 0
    countInvalid = 0

    for x in al.tree.getroot().iter():
        n += 1

        try:

            if ARCHI_TYPE in x.attrib and x.attrib[ARCHI_TYPE] in relations.values():
                sid = x.get(u"source")
                srcElm = al.findElementByID(sid)[0]

                tid = x.get(u"target")
                tgtElm = al.findElementByID(tid)[0]

                if srcElm is None or tgtElm is None:
                    logger.warn(u"Invalid Relationship : %s[%s]" % (x.get(u"id"), x.get(ARCHI_TYPE)))
                else:
                    logger.debug(u"Valid Relationship   : %s[%s]" % (x.get(u"id"), x.get(ARCHI_TYPE)))

            # <child xsi:type="archimate:DiagramObject" id="2be1001e" textAlignment="2" archimateElement="eedbdc28">
                # <bounds x="692" y="624" width="120" height="55"/>
                # <sourceConnection xsi:type="archimate:Connection" id="c90d2077" source="2be1001e" target="aff3d6b3" relationship="56057f65"/>
                # <sourceConnection xsi:type="archimate:Connection" id="d5cac998" source="2be1001e" target="dfa5c47b" relationship="99bc54ab"/>
                # <sourceConnection xsi:type="archimate:Connection" id="3174a55b" source="2be1001e" target="0308d4c3" relationship="67e21821"/>
            # </child>
            elif ARCHI_TYPE in x.attrib and x.get(ARCHI_TYPE) == DIAGRAM_OBJECT:
                ae = x.get(u"archimateElement")
                aeDO = al.findDiagramObject(ae)[0].attrib
                aeid = aeDO[u"archimateElement"]
                aeElm = al.findElementByID(aeid)[0]

                logger.debug(u"%s[%s] " % (aeElm.get(u"name"), aeElm.get(ARCHI_TYPE)))

            elif ARCHI_TYPE in x.attrib and x.tag == u"sourceConnection":

                src = x.get(u"source")
                srcDO = al.findDiagramObject(src)[0].attrib
                sid = srcDO[u"archimateElement"]
                srcElm = al.findElementByID(sid)[0]

                trc = x.get(u"target")
                tgtDO = al.findDiagramObject(trc)[0].attrib
                tid = tgtDO[u"archimateElement"]
                tgtElm = al.findElementByID(tid)[0]

                rrc = x.get(u"relationship")
                relElm = al.findElementByID(rrc)[0]
                rid = relElm.get(ARCHI_TYPE)[10:]

                logger.debug(u"  S - %s -> [%s] -> %s" % ((srcElm.get(u"name"), rid, tgtElm.get(u"name"))))

            else:
                if u"name" in x.attrib and x.attrib.has_key(ARCHI_TYPE):
                    logger.info(u"Skipping - %s[%s] - %s" % (x.get(ARCHI_TYPE)[10:], x.get(u"id"), x.get(u"name")[:20]))
                else:
                    logger.debug(u"Skipping - %s[%s]" % (x.tag, x.get(u"id")))
        except:
            countInvalid += 1
            logger.error(u"Error - %s[%s]" % (x.tag, x.get(u"id")))

    logger.info(u"Validated %d Elements" % n)

    al.logTypeCounts()
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:72,代码来源:al_CleanArchimateRelationships.py

示例7: setupLogging

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import logTypeCounts [as 别名]
#!/usr/bin/python
#
# Archimate Counts
#
__author__ = u'morrj140'
__VERSION__ = u'0.3'
import os

from Logger import *
logger = setupLogging(__name__)
logger.setLevel(INFO)

from al_lib.ArchiLib import ArchiLib


if __name__ == u"__main__":

    pathModel = u"/Users/morrj140/Documents/SolutionEngineering/Archimate Models"

    fileArchimateXML = u"DVC v3.17.archimate"

    fileArchimate = pathModel + os.sep + fileArchimateXML

    al = ArchiLib(fileArchimate)

    al.logTypeCounts()
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:28,代码来源:al_ArchiCounts.py


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