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
ironclaw_class.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录