Ejemplo n.º 1
0
                  help="Adjust the timeout for the command (in seconds)")
parser.add_option("-f", "--forget", dest="forget", default=False,
                  action="store_true",
                  help="Ignore the result, return immediately")
options, args = parser.parse_args()

# Check arguments
if info.in_type == PyTango.ArgType.DevVoid:
    if not len(args) == 0:
        sys.exit("No arguments expected!")
    argument = None
else:
    if PyTango.is_scalar_type(info.in_type) and not len(args) == 1:
        sys.exit("Exactly one argument expected!")
    argument = PyTango.utils.seqStr_2_obj(args, info.in_type)


# run command
proxy.set_timeout_millis(int(options.timeout * 1000))
if options.forget:
    result = proxy.command_inout_asynch("{command}", argument, options.forget)
else:
    result = proxy.command_inout("{command}", argument)

# output
if result is not None and not options.forget:
    if PyTango.is_array_type(info.out_type):
        print "\n".join(result)
    else:
        print result