1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Syntax error fix

This commit is contained in:
Alen Mujezinovic 2012-02-28 10:48:29 +00:00
parent 899513858a
commit f73aaa844f

View File

@ -34,10 +34,11 @@ class KeyValueType(object):
self.separators = separators
def __call__(self, string):
found = dict([
(string.find(sep), sep) for sep in self.separators
if string.find(sep) != -1
])
found = {string.find(sep): sep
for sep in self.separators
if string.find(sep) != -1}
if not found:
raise argparse.ArgumentTypeError(
'"%s" is not a valid value' % string)
@ -148,8 +149,8 @@ def main():
verify=True if args.verify == 'yes' else args.verify,
timeout=args.timeout,
auth=(args.auth.key, args.auth.value) if args.auth else None,
proxies={proxy.key: proxy.value for proxy in args.proxy},
files={os.path.basename(f.name): f for f in args.file}
proxies=dict([(p.key, p.value) for p in args.proxy]),
files=dict([(os.path.basename(f.name), f) for f in args.file]),
)
except (KeyboardInterrupt, SystemExit) as e:
sys.stderr.write('\n')