Skip to content

Commit

Permalink
Correct imports for odo CL tool
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Mar 6, 2015
1 parent 927c25b commit 18fcfda
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bin/odo
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python

from sys import argv
from into import into
from odo import odo
from toolz import partition

literals = [True, False, None]


def parse(s):
""" Parse strings to booleans, integers, or strings
Expand All @@ -24,11 +25,14 @@ def parse(s):
return int(s)
return s


def get_args_kwargs(argv):
source, target = argv[1], argv[2]
kwargs = dict((k.lstrip('-').replace('-','_'), parse(v))
for k, v in partition(2, argv[3:]))
return (target, source), kwargs
kwargs = dict((k.lstrip('-').replace('-', '_'), parse(v))
for k, v in partition(2, argv[3:]))
return (source, target), kwargs


args, kwargs = get_args_kwargs(argv)
into(*args, **kwargs)
if __name__ == '__main__':
args, kwargs = get_args_kwargs(argv)
odo(*args, **kwargs)

0 comments on commit 18fcfda

Please sign in to comment.