common_functions.py 文件源码

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

项目:Zeuz_Python_Node 作者: AutomationSolutionz 项目源码 文件源码
def sequential_actions_settings(data_set):
    ''' Test Step front end for modifying certain variables used by Sequential Actions '''

    sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
    CommonUtil.ExecLog(sModuleInfo,"Function Start", 0)

    try:
        # Parse data set
        tmp = data_set[0][2].replace(' ', '').strip() # Get key and value from Value field and clean them
        shared_var = tmp.split('=')[0].strip().lower() # Retrieve variable name
        value = tmp.replace(shared_var + '=', '').strip() # Retrieve value for variable

        # Verify this is a real variable (should be set somewhere else)
        if not sr.Test_Shared_Variables(shared_var):
            CommonUtil.ExecLog(sModuleInfo,"The variable name specified (%s) is not a valid Sequential Action variable" % str(shared_var), 3)
            return 'failed'

        # Save variable - all functions that use this variable will now use the new value
        CommonUtil.ExecLog(sModuleInfo,"Changing Sequential Action setting of %s from %s to %s" % (str(shared_var), str(sr.Get_Shared_Variables(shared_var)), str(value)), 1)
        return sr.Set_Shared_Variables(shared_var, value)
    except Exception:
        return CommonUtil.Exception_Handler(sys.exc_info())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号