Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
BindingEditor.__init__(self, app)
self._recursing = False
self.actions = [ NoAction() ] * 6
from scc.special_actions import MenuAction
from scc.modifiers import NameModifier
from scc.uinput import Keys
from scc.gui.ae import AEComponent, describe_action
from scc.gui.ae.menu_action import MenuActionCofC
from scc.gui.binding_editor import BindingEditor
from scc.gui.action_editor import ActionEditor
import os, logging
log = logging.getLogger("AE.Tilt")
__all__ = [ 'TiltComponent' ]
class TiltComponent(AEComponent, BindingEditor):
GLADE = "ae/tilt.glade"
NAME = "tilt"
CTXS = Action.AC_GYRO
PRIORITY = 2
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
BindingEditor.__init__(self, app)
self._recursing = False
self.actions = [ NoAction() ] * 6
def set_action(self, mode, action):
if isinstance(action, TiltAction):
self.actions = list(action.actions)
while len(self.actions) < 6:
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
MenuActionCofC.__init__(self)
BindingEditor.__init__(self, app)
self._recursing = False
self._userdata_load_started = False
self.actions = [ NoAction() ] * 8
def load(self):
if self.loaded : return
AEComponent.load(self)
try:
txCustomAction = self.builder.get_object("txCustomAction")
txCustomAction.set_monospace(True)
except: pass
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
self.half = None
self.full = None
from scc.gui.ae import AEComponent, describe_action
from scc.gui.area_to_action import action_to_area
from scc.gui.simple_chooser import SimpleChooser
from scc.gui.action_editor import ActionEditor
from scc.gui.parser import GuiActionParser
from scc.actions import Action, NoAction, XYAction
from scc.special_actions import GesturesAction
from scc.modifiers import NameModifier
import os, logging
log = logging.getLogger("AE.PerAxis")
__all__ = [ 'GestureComponent' ]
class GestureComponent(AEComponent):
GLADE = "ae/gesture.glade"
NAME = "gesture"
CTXS = Action.AC_STICK | Action.AC_PAD
PRIORITY = 1
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
self.x = self.y = NoAction()
def set_action(self, mode, action):
lstGestures = self.builder.get_object("lstGestures")
lstGestures.clear()
if isinstance(action, GesturesAction):
for gstr in action.gestures:
o = GObject.GObject()
from scc.actions import TriggerAction, ButtonAction, AxisAction, MouseAction
from scc.actions import Action, NoAction, MultiAction
from scc.actions import FeedbackModifier
from scc.gui.ae import AEComponent, describe_action
from scc.gui.area_to_action import action_to_area
from scc.gui.simple_chooser import SimpleChooser
from scc.gui.binding_editor import BindingEditor
from scc.gui.parser import InvalidAction
import os, logging
log = logging.getLogger("AE.TriggerAB")
__all__ = [ 'TriggerComponent' ]
class TriggerComponent(AEComponent, BindingEditor):
GLADE = "ae/trigger.glade"
NAME = "trigger"
CTXS = Action.AC_TRIGGER
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
BindingEditor.__init__(self, app)
self._recursing = False
self.half = NoAction()
self.full = NoAction()
self.analog = NoAction()
def handles(self, mode, action):
if isinstance(action, NoAction):
return True
def load(self):
if self.loaded : return
AEComponent.load(self)
cbConfirmWith = self.builder.get_object("cbConfirmWith")
cbCancelWith = self.builder.get_object("cbCancelWith")
cbConfirmWith.set_row_separator_func( lambda model, iter : model.get_value(iter, 0) == "-" )
cbCancelWith.set_row_separator_func( lambda model, iter : model.get_value(iter, 0) == "-" )
def load_components(self):
""" Loads list of editor components """
# Import and load components
for c in self.COMPONENTS:
mod = importlib.import_module("scc.gui.ae.%s" % (c,))
for x in dir(mod):
cls = getattr(mod, x)
if isinstance(cls, (type, types.ClassType)) and issubclass(cls, AEComponent):
if cls is not AEComponent:
self.components.append(cls(self.app, self))
self._selected_component = None
def __init__(self, app, editor):
AEComponent.__init__(self, app, editor)
BindingEditor.__init__(self, app)
self._recursing = False
self.actions = [ NoAction() ] * 6