def st_tempurl(parser, args, thread_manager):
    parser.add_argument(
        '--absolute', action='store_true',
        dest='absolute_expiry', default=False,
        help=("If present, seconds argument will be interpreted as a Unix "
              "timestamp representing when the tempURL should expire, rather "
              "than an offset from the current time")
    )
    (options, args) = parse_args(parser, args)
    args = args[1:]
    if len(args) < 4:
        thread_manager.error('Usage: %s tempurl %s\n%s', BASENAME,
                             st_tempurl_options, st_tempurl_help)
        return
    method, seconds, path, key = args[:4]
    try:
        seconds = int(seconds)
    except ValueError:
        thread_manager.error('Seconds must be an integer')
        return
    if method.upper() not in ['GET', 'PUT', 'HEAD', 'POST', 'DELETE']:
        thread_manager.print_msg('WARNING: Non default HTTP method %s for '
                                 'tempurl specified, possibly an error' %
                                 method.upper())
    url = generate_temp_url(path, seconds, key, method,
                            absolute=options.absolute_expiry)
    thread_manager.print_msg(url)
dataset/ETHPy150Open openstack/python-swiftclient/swiftclient/shell.py/st_tempurl/original