def query(self, command): """To send a command that generates a reply, e.g. "InstrumentID.Value". Returns the reply""" from tcp_client import query reply = query(self.ip_address_and_port, command).strip("\n") debug("%s, reply %s" % (torepr(command), torepr(reply))) return reply
def query(self,command,terminator="\n",count=None): """Evaluate a command in the camera server and return the result. """ from tcp_client import query reply = query(self.ip_address,command,terminator,count) return reply
def send(ip_address_and_port, command): """Send a command that does not generate a reply. ip_address_and_port: e.g. '164.54.161.34:2001' command: string, will by '\n' terminated""" query(ip_address_and_port, command, count=0)
def query(self, command): """Send a command that generates a reply. Return the reply""" self.log("query %r" % command) from tcp_client import query return query(self.ip_address, command)