def sendKey(key): logger.info("Keys: " + key) if not __debug__: cmd = ['xdotool', 'key'] if piony.G_ACTIVE_WINDOW: cmd.extend(['--window', piony.G_ACTIVE_WINDOW]) call(cmd + ['--clearmodifiers', key], shell=False)
def search_dst_window(): try: out = check_output(['xdotool', 'getactivewindow']) except CalledProcessError: idwnd = None else: idwnd = out[:-1].decode('ascii') piony.G_ACTIVE_WINDOW = idwnd logger.info("Window -- %s", str(idwnd)) return idwnd
def receiveData(self): logger.info("waits for data") ins = QDataStream(self.conn) ins.setVersion(QDataStream.Qt_5_0) if ins.atEnd(): return argv = ins.readQVariant() logger.info("reads '%s'", str(argv)) # Must be setted up on 'show' action. Move from beginning to appropriate. action.search_dst_window() self.dataReceived.emit(argv)
def notify(self): logger.info("1 new conn") # WARNING: when multiple connections, each will overwrite previous! self.conn = self.server.nextPendingConnection() self.conn.readyRead.connect(self.receiveData) self.conn.disconnected.connect(self.conn.deleteLater)
def _log_(self, text, *args): logger.info(self.__class__.__qualname__ + ': ' + text, *args)
def sysClose(): logger.info("Qt: close()") if not __debug__: qApp.quit()