Exemple #1
0
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)
Exemple #2
0
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
Exemple #3
0
 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)
Exemple #4
0
 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)
Exemple #5
0
 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)
Exemple #6
0
 def _log_(self, text, *args):
     logger.info(self.__class__.__qualname__ + ': ' + text, *args)
Exemple #7
0
 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)
Exemple #8
0
def sysClose():
    logger.info("Qt: close()")
    if not __debug__:
        qApp.quit()