當前位置: 首頁>>代碼示例>>Python>>正文


Python actions.Action類代碼示例

本文整理匯總了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;未經允許,請勿轉載。