def mode(self, mode): self._add_mode(mode) self._mode = mode self._keys = dict((k % self.defs, v) for k, v in self.modes[mode]['keys'].items() + self.modes[mode]['import'].items()); if hasattr(self, 'defs'): client.write('/keys', '\n'.join(self._keys.keys()) + '\n')
def _set_mode(self, mode, execute=True): self._add_mode(mode) self._mode = mode self._keys = dict((k % self.defs, v) for k, v in self.modes[mode]['keys'].items() + self.modes[mode]['import'].items()) if execute: client.write('/keys', '\n'.join(self._keys.keys()) + '\n')
def mode(self, mode): self._add_mode(mode) self._mode = mode self._keys = dict((k % self.defs, v) for k, v in self.modes[mode]['keys'].items() + self.modes[mode]['import'].items()) if hasattr(self, 'defs'): client.write('/keys', '\n'.join(self._keys.keys()) + '\n')
def _set_mode(self, mode, execute=True): self._add_mode(mode) self._mode = mode self._keys = dict((k % self.defs, v) for k, v in self.modes[mode]['keys'].items() + self.modes[mode]['import'].items()); if execute: client.write('/keys', '\n'.join(self._keys.keys()) + '\n')
def send(*action): from pygmi import client action = ' '.join(action) client.write('/event', 'Action %s' % (action or ''))