本文整理汇总了Python中action.Action方法的典型用法代码示例。如果您正苦于以下问题:Python action.Action方法的具体用法?Python action.Action怎么用?Python action.Action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类action
的用法示例。
在下文中一共展示了action.Action方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def __init__(self, yaml_object):
self.yaml_rules = yaml_object['rules']
self.yaml_actions = yaml_object['actions']
self.rules_test = test_from_rules(self.yaml_rules)
self.actions = list(map(lambda y: Action(y), self.yaml_actions))
示例2: get_actions
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def get_actions(case):
_actions = []
if "actions" not in case:
return _actions
for action in case["actions"]:
_actions.append(Action(action, case["url"]))
return _actions
示例3: __init__
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def __init__(self, data):
self.__lastUpdate = data['lastUpdateTime']
self.__name = data['label']
self.__actions = []
for cmd in data['actions']:
self.__actions.append( Action(cmd) )
示例4: __init__
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def __init__(self, data):
self.__id = data['id']
self.__startTime = data['startTime']
self.__state = EventState(data['state'])
self.__name = data['actionGroup']['label']
self.__actions = []
for cmd in data['actionGroup']['actions']:
self.__actions.append( Action(cmd) )
示例5: __init__
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def __init__(self):
"""Initialize UserInterface class."""
self.__config = Config()
self.__action = Action()
self.__database = Database(self.__config.database_path)
示例6: _parse
# 需要导入模块: import action [as 别名]
# 或者: from action import Action [as 别名]
def _parse(self):
""" parse config file """
# parse all actions
if self.key_actions in self.content:
if self.content[self.key_actions] is not None:
for k, v in self.content[self.key_actions].items():
self.actions[k] = Action(k, v)
# parse the profiles
self.profiles = self.content[self.key_profiles]
if self.profiles is None:
self.content[self.key_profiles] = {}
self.profiles = self.content[self.key_profiles]
for k, v in self.profiles.items():
if v[self.key_profiles_dots] is None:
v[self.key_profiles_dots] = []
# parse the configs
self.configs = self.content[self.key_config]
# parse the dotfiles
if not self.content[self.key_dotfiles]:
self.content[self.key_dotfiles] = {}
for k, v in self.content[self.key_dotfiles].items():
src = v[self.key_dotfiles_src]
dst = v[self.key_dotfiles_dst]
link = v[self.key_dotfiles_link] if self.key_dotfiles_link \
in v else False
entries = v[self.key_dotfiles_actions] if \
self.key_dotfiles_actions in v else []
actions = self._parse_actions(self.actions, entries)
self.dotfiles[k] = Dotfile(k, dst, src,
link=link, actions=actions)
# assign dotfiles to each profile
for k, v in self.profiles.items():
self.prodots[k] = []
if self.key_profiles_dots not in v:
v[self.key_profiles_dots] = []
if not v[self.key_profiles_dots]:
continue
dots = v[self.key_profiles_dots]
if self.key_all in dots:
self.prodots[k] = list(self.dotfiles.values())
else:
self.prodots[k].extend([self.dotfiles[d] for d in dots])
# handle "include" for each profile
for k in self.profiles.keys():
dots = self._get_included_dotfiles(k)
self.prodots[k].extend(dots)
# no duplicates
self.prodots[k] = list(set(self.prodots[k]))
# make sure we have an absolute dotpath
self.curdotpath = self.configs[self.key_dotpath]
self.configs[self.key_dotpath] = self._get_abs_dotpath(self.curdotpath)
return True