BuiltInFunctions.py 文件源码

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

项目:Zeuz_Python_Node 作者: AutomationSolutionz 项目源码 文件源码
def set_device_password(data_set):
    ''' Saves the device password to shared variables for use in unlocking the phone '''
    # Caveat: Only allows one password stored at a time

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

    # Parse data set
    try:
        password = data_set[0][2].strip() # Read password from Value field
        if password != '':
            Shared_Resources.Set_Shared_Variables('device_password', password)
            CommonUtil.ExecLog(sModuleInfo, "Device password saved as: %s" % password, 1)
            return 'passed'
        else:
            CommonUtil.ExecLog(sModuleInfo, "Password cannot be blank. Expected Value field of action row to be a PIN or PASSWORD", 3)
            return 'failed'

    except Exception:
        return CommonUtil.Exception_Handler(sys.exc_info(), None, "Error when trying to read Field and Value for action")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号