本文整理汇总了Python中scc.actions.Action.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Action.__init__方法的具体用法?Python Action.__init__怎么用?Python Action.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scc.actions.Action
的用法示例。
在下文中一共展示了Action.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, menu_id, confirm_with=None, cancel_with=None, show_with_release=None):
Action.__init__(self, menu_id, *strip_none(confirm_with, cancel_with, show_with_release))
self.menu_id = menu_id
self.confirm_with = confirm_with or self.DEFAULT_CONFIRM
self.cancel_with = cancel_with or self.DEFAULT_CANCEL
self.show_with_release = show_with_release not in (None, False)
self._stick_distance = 0
示例2: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, *params):
Action.__init__(self, *params)
params = list(params)
for p in params:
if isinstance(p, Action):
self.action = p
params.remove(p)
break
else:
self.action = NoAction()
self._mod_init(*params)
示例3: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, *parameters):
Action.__init__(self, *parameters)
self.action = None
self.timeout = self.DEFAULT_TIMEOUT
if len(parameters) > 1:
# timeout parameter included
self.timeout = parameters[0]
if isinstance(parameters[-1], Action):
self.action = parameters[-1]
self.text = self.action.describe(Action.AC_OSD)
else:
self.text = unicode(parameters[-1])
示例4: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, *parameters):
Action.__init__(self, *parameters)
self.actions = []
self.repeat = False
self._active = False
self._current = None
self._release = None
for p in parameters:
if type(p) == float and len(self.actions):
self.actions[-1].delay_after = p
elif isinstance(p, Macro):
self.actions += p.actions
elif isinstance(p, Action):
self.actions.append(p)
else:
self.actions.append(ButtonAction(p))
示例5: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, action=None):
Action.__init__(self, action)
self.action = action or NoAction()
示例6: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self):
Action.__init__(self)
示例7: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, side):
Action.__init__(self, side)
if hasattr(side, "name"): side = side.name
self.speed = (1.0, 1.0)
self.side = side
示例8: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, button):
Action.__init__(self, button)
self.button = button
示例9: __init__
# 需要导入模块: from scc.actions import Action [as 别名]
# 或者: from scc.actions.Action import __init__ [as 别名]
def __init__(self, action):
Action.__init__(self, action)
self.action = action