美文网首页
工具5-统计xmind的用例数结合exe改版(二)

工具5-统计xmind的用例数结合exe改版(二)

作者: 软件开发技术修炼 | 来源:发表于2022-12-28 17:16 被阅读0次

    一、前沿

    统计用例条数工具,为了方便使用,同其他小工具,将其改为了exe桌面版;
    本篇主要是按exe工具需显示的字段,对统计用例的函数代码进行修改;

    统计xmind的用例数(二) 需结合 统计xmind的用例数(三)一起使用;
    如无需关注代码,下载 统计xmind的用例数(三)中的exe工具即可。

    二、讲解方案

    1、相对于上个版本,此处删除掉获取桌面的xmind文件的方法,xmindfile作为单独的对象;
    2、因xmindfile直接传参,便简化了获取story的方法

    # -*- coding: utf-8 -*-
    '''
    @Time    : 2022/11/30 11:54
    @Author  : Celeste
    @File    : count_xmind.py
    
    '''
    
    # 读取xmind文件
    from xmindparser import xmind_to_dict
    import os
    
    # pyinstaller -F -w F:\AtoTool_file\xmExc\xmExc_tool.py -i F:\AtoTool_file\xmExc\xmie.ico
    
    class func():
    
        def __init__(self, xmindfile):
            self.count1 = 0
            self.xmindfile = xmindfile
    
        # 单独对story进行返回
        def get_story(self):
            out = xmind_to_dict(self.xmindfile)
            story = out[0]['topic']['topics']
            return story
    

    3、第二段读取xmind文件的用例条数,同上个版本,保持不变

    本篇需结合(一)与(三)一起查看理解

    相关文章

      网友评论

          本文标题:工具5-统计xmind的用例数结合exe改版(二)

          本文链接:https://www.haomeiwen.com/subject/mcrzqdtx.html