def send_command():
def verbose(msg):<EOL><INDENT>"""<STR_LIT>"""<EOL>if options.verbose:<EOL><INDENT>print(msg)<EOL><DEDENT><DEDENT>options = command_parser()<EOL>msg = json.dumps(vars(options)).encode("<STR_LIT:utf-8>")<EOL>if len(msg) > MAX_SIZE:<EOL><INDENT>verbose("<STR_LIT>" % MAX_SIZE)<EOL><DEDENT>uds_list = glob.glob("<STR_LIT>".format(SERVER_ADDRESS))<EOL>verbose('<STR_LIT>' % msg)<EOL>for uds in uds_list:<EOL><INDENT>sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)<EOL>verbose("<STR_LIT>" % uds)<EOL>try:<EOL><INDENT>sock.connect(uds)<EOL><DEDENT>except socket.error:<EOL><INDENT>verbose("<STR_LIT>")<EOL>try:<EOL><INDENT>os.unlink(uds)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>continue<EOL><DEDENT>try:<EOL><INDENT>verbose("<STR_LIT>")<EOL>sock.sendall(msg)<EOL><DEDENT>finally:<EOL><INDENT>verbose("<STR_LIT>")<EOL>sock.close()<EOL><DEDENT><DEDENT>
Run a remote command. This is called via py3-cmd utility.

We look for any uds sockets with the correct name prefix and send our
command to all that we find.  This allows us to communicate with multiple
py3status instances.