From 17350fa524a5b9a60fb2f87c0f891ba5c804c5ff Mon Sep 17 00:00:00 2001 From: June Tate-Gans Date: Tue, 4 May 2021 01:42:38 -0500 Subject: [PATCH] bindingprofile: Remove a bunch of (now) worthless methods We no longer need to serialize to g13d command strings. --- g13gui/g13gui/model/bindingprofile.py | 29 --------------------------- 1 file changed, 29 deletions(-) diff --git a/g13gui/g13gui/model/bindingprofile.py b/g13gui/g13gui/model/bindingprofile.py index b371742..02377c0 100644 --- a/g13gui/g13gui/model/bindingprofile.py +++ b/g13gui/g13gui/model/bindingprofile.py @@ -72,35 +72,6 @@ class BindingProfile(Subject): self._bindKey(gkey, keybinding) self.notifyChanged() - def _lcdColorToCommandString(self): - return 'rgb %d %d %d' % tuple([int(x * 255) for x in self._lcdColor]) - - def _keyBindingToCommandString(self, gkey): - kbdkey = self._keyBindings[gkey] - if len(kbdkey) > 0: - keys = '+'.join(['KEY_' + key for key in kbdkey]) - return "bind %s %s" % (gkey, keys) - else: - return "unbind %s" % (gkey) - - def toCommandString(self): - commands = [] - - commands.append(self._lcdColorToCommandString()) - - for gkey in self._keyBindings.keys(): - commands.append(self._keyBindingToCommandString(gkey)) - - if self._stickMode == bindings.StickMode.KEYS: - for region, bounds in self._stickRegions.items(): - commands.append("stickzone add %s" % (region)) - commands.append("stickzone bounds %s %0.1f %0.1f %0.1f %0.1f" % - (region, *bounds)) - keys = ' '.join(['KEY_' + key for key in self._stickRegionBindings[region]]) - commands.append("stickzone action %s %s" % (region, keys)) - - return '\n'.join(commands) - def loadFromDict(self, dict): self._lcdColor = dict['lcdcolor'] self._stickMode = dict['stickMode']