Example #1
0
    def running(self):
        sock = Socket(self.address)
        try:
            sock.connect()
        except socket.error:
            return False

        return True
Example #2
0
    def __init__(self, address=None, adb_path="adb"):
        """
        Initialize an Adb object

        :param tuple address: The address of the Adb server in the form (host, port).
                              Defaults to ("localhost", 5037)
        """
        if address == None:
            # Default address
            address = ("localhost", 5037)

        self.address = address
        self.socket = Socket(address)
        self.process = AdbProcess(adb_path, address)
Example #3
0
def socket():
    sock = Socket(())
    sock.socket = MockSocket()
    return sock