当前位置: 首页>>代码示例>>Python>>正文


Python action.Action方法代码示例

本文整理汇总了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)) 
开发者ID:schubev,项目名称:here-script,代码行数:7,代码来源:rulebook.py

示例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 
开发者ID:LoveOrange,项目名称:paradise,代码行数:9,代码来源:case_runner.py

示例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) ) 
开发者ID:bpannier,项目名称:TahomaProtocol,代码行数:10,代码来源:actionGroup.py

示例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) ) 
开发者ID:bpannier,项目名称:TahomaProtocol,代码行数:12,代码来源:execution.py

示例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) 
开发者ID:mortezaipo,项目名称:MTodo,代码行数:7,代码来源:interface.py

示例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 
开发者ID:deadc0de6,项目名称:dotdrop,代码行数:60,代码来源:config.py


注:本文中的action.Action方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。