Skip to content

Commit

Permalink
Merge pull request #31 from bernardogalindo/bugfix/configuration_not_…
Browse files Browse the repository at this point in the history
…found

start to read args from 2 position and deleted extra validation
  • Loading branch information
gka committed Mar 30, 2012
2 parents 0ec80be + 7775e49 commit 9c70036
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kartograph/cli.py
Expand Up @@ -23,18 +23,13 @@ def main():
cfg = {} cfg = {}
output = None output = None
opt_src = None opt_src = None
opts, args = getopt.getopt(sys.argv[3:], 'c:o:', ['config=', 'output=']) opts, args = getopt.getopt(sys.argv[2:], 'c:o:', ['config=', 'output='])
for o, a in opts: for o, a in opts:
if o in ('-c', '--config'): if o in ('-c', '--config'):
opt_src = a opt_src = a
elif o in ('-o', '--output'): elif o in ('-o', '--output'):
output = a output = a


if opt_src is None and len(sys.argv) > 2:
opt_src = sys.argv[2]
else:
raise KartographError('you need to pass a map configuration (json/yaml)')

# check and load map configuration # check and load map configuration
if os.path.exists(opt_src): if os.path.exists(opt_src):
t = open(opt_src, 'r').read() t = open(opt_src, 'r').read()
Expand Down

0 comments on commit 9c70036

Please sign in to comment.