• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python actions.Action类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中scc.actions.Action的典型用法代码示例。如果您正苦于以下问题:Python Action类的具体用法?Python Action怎么用?Python Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Action类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

	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
开发者ID:chagara,项目名称:sc-controller,代码行数:7,代码来源:special_actions.py


示例2: __init__

	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)
开发者ID:kozec,项目名称:sc-controller,代码行数:11,代码来源:modifiers.py


示例3: __init__

	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])
开发者ID:TotalCaesar659,项目名称:sc-controller,代码行数:12,代码来源:special_actions.py


示例4: __init__

	def __init__(self, app):
		UserDataManager.__init__(self)
		self.app = app
		self.setup_widgets()
		self._timer = None
		self._recursing = False
		self.app.config.reload()
		Action.register_all(sys.modules['scc.osd.osk_actions'], prefix="OSK")
		self.load_settings()
		self.load_profile_list()
		self._recursing = False
		self._eh_ids = (
			self.app.dm.connect('reconfigured', self.on_daemon_reconfigured),
		)
开发者ID:mulark,项目名称:sc-controller,代码行数:14,代码来源:global_settings.py


示例5: __init__

	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))
开发者ID:TotalCaesar659,项目名称:sc-controller,代码行数:16,代码来源:macros.py


示例6: encode

	def encode(self):
		if self.action:
			rv = self.action.encode()
			if self.timeout == self.DEFAULT_TIMEOUT:
				rv['osd'] = True
			else:
				rv['osd'] = self.timeout
			return rv
		else:
			return Action.encode(self)
开发者ID:wendeldr,项目名称:sc-controller,代码行数:10,代码来源:special_actions.py


示例7: __init__

	def __init__(self, config=None):
		self.kbimage = os.path.join(get_config_path(), 'keyboard.svg')
		if not os.path.exists(self.kbimage):
			# Prefer image in ~/.config/scc, but load default one as fallback
			self.kbimage = os.path.join(get_share_path(), "images", 'keyboard.svg')
		
		TimerManager.__init__(self)
		OSDWindow.__init__(self, "osd-keyboard")
		self.daemon = None
		self.mapper = None
		self.keymap = Gdk.Keymap.get_default()
		self.keymap.connect('state-changed', self.on_keymap_state_changed)
		Action.register_all(sys.modules['scc.osd.osk_actions'], prefix="OSK")
		self.profile = Profile(TalkingActionParser())
		self.config = config or Config()
		self.dpy = X.Display(hash(GdkX11.x11_get_default_xdisplay()))
		self.group = None
		self.limits = {}
		self.background = None
		
		cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
		self.cursors = {}
		self.cursors[LEFT] = Gtk.Image.new_from_file(cursor)
		self.cursors[LEFT].set_name("osd-keyboard-cursor")
		self.cursors[RIGHT] = Gtk.Image.new_from_file(cursor)
		self.cursors[RIGHT].set_name("osd-keyboard-cursor")
		self.cursors[CPAD] = Gtk.Image.new_from_file(cursor)
		self.cursors[CPAD].set_name("osd-keyboard-cursor")
		
		self._eh_ids = []
		self._controller = None
		self._stick = 0, 0
		self._hovers = { self.cursors[LEFT]: None, self.cursors[RIGHT]: None }
		self._pressed = { self.cursors[LEFT]: None, self.cursors[RIGHT]: None }
		self._pressed_areas = {}
		
		self.c = Gtk.Box()
		self.c.set_name("osd-keyboard-container")
		
		self.f = Gtk.Fixed()
开发者ID:kozec,项目名称:sc-controller,代码行数:40,代码来源:keyboard.py


示例8: __init__

	def __init__(self, command):
		Action.__init__(self, command)
		self.command = command
开发者ID:wendeldr,项目名称:sc-controller,代码行数:3,代码来源:special_actions.py


示例9: __init__

	def __init__(self, action):
		Action.__init__(self, action)
		self.action = action
开发者ID:kozec,项目名称:sc-controller,代码行数:3,代码来源:macros.py


示例10: __init__

	def __init__(self, *parameters):
		Action.__init__(self, *parameters)
		self.actions = parameters
		self._current = 0
开发者ID:Micr0Bit,项目名称:sc-controller,代码行数:4,代码来源:macros.py


示例11: on_Dialog_destroy

	def on_Dialog_destroy(self, *a):
		for x in self._eh_ids:
			self.app.dm.disconnect(x)
		self._eh_ids = ()
		Action.unregister_prefix('OSK')
开发者ID:mulark,项目名称:sc-controller,代码行数:5,代码来源:global_settings.py


示例12: __init__

	def __init__(self, side):
		Action.__init__(self, side)
		if hasattr(side, "name"): side = side.name
		self.speed = (1.0, 1.0)
		self.side = side
开发者ID:mulark,项目名称:sc-controller,代码行数:5,代码来源:osk_actions.py


示例13: to_string

	def to_string(self, multiline=False, pad=0):
		return self._mod_to_string(Action.strip_defaults(self), multiline, pad)
开发者ID:mulark,项目名称:sc-controller,代码行数:2,代码来源:modifiers.py


示例14: __init__

	def __init__(self, action=None):
		Action.__init__(self, action)
		self.action = action or NoAction()
开发者ID:alwaysLearnin,项目名称:sc-controller,代码行数:3,代码来源:modifiers.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ae.AEComponent类代码示例发布时间:2022-05-27
下一篇:
Python meta.Session类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap