ironclaw_class.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:warriorframework 作者: warriorframework 项目源码 文件源码
def get_action_dirlist(driverpath):
    """ Get the list of action directories """
    actions_package_list = []
    try:
        if os.path.isfile(driverpath):
            lines = []
            with open(driverpath, 'r') as fobj:
                lines = fobj.readlines()
            lines_as_string = ''.join(lines)
            search_string = re.compile(r'package_list.*=.*\]', re.DOTALL|re.MULTILINE)
            match = re.search(search_string, lines_as_string)

            if match:
                match_string = match.group()
                actions_package_list = match_string.split('[')[1].split(']')[0].split(',')

            return actions_package_list
        else:
            print("file {0} does not exist".format(driverpath))
            return actions_package_list
    except Exception as exception:
        print_exception(exception)
    return actions_package_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号