- Timestamp:
- 10/15/15 20:46:11 (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/scripts.py
r836 r837 378 378 # 'everything else' is essentially the functional interface 379 379 else: 380 out = kwds.get('out', None) 381 bounds = kwds.get('bounds', None) 382 label = kwds.get('label', None) 383 nid = kwds.get('nid', None) 384 iter = kwds.get('iter', None) 385 reduce = kwds.get('reduce', None) 386 scale = kwds.get('scale', None) 387 shift = kwds.get('shift', None) 388 fill = kwds.get('fill', False) 389 depth = kwds.get('depth', False) 390 dots = kwds.get('dots', False) 391 join = kwds.get('join', False) 392 393 # special case: bounds passed as list of slices 394 if not isinstance(bounds, (basestring, type(None))): 395 cmdargs = '' 396 for b in bounds: 397 if isinstance(b, slice): 398 cmdargs += "{}:{}:{}, ".format(b.start, b.stop, b.step) 399 else: 400 cmdargs += "{}, ".format(b) 401 bounds = cmdargs[:-2] 380 cmdargs = kwds.get('kwds', '') 381 if not cmdargs: 382 out = kwds.get('out', None) 383 bounds = kwds.get('bounds', None) 384 label = kwds.get('label', None) 385 nid = kwds.get('nid', None) 386 iter = kwds.get('iter', None) 387 reduce = kwds.get('reduce', None) 388 scale = kwds.get('scale', None) 389 shift = kwds.get('shift', None) 390 fill = kwds.get('fill', False) 391 depth = kwds.get('depth', False) 392 dots = kwds.get('dots', False) 393 join = kwds.get('join', False) 394 395 # special case: bounds passed as list of slices 396 if not isinstance(bounds, (basestring, type(None))): 397 cmdargs = '' 398 for b in bounds: 399 if isinstance(b, slice): 400 cmdargs += "{}:{}:{}, ".format(b.start, b.stop, b.step) 401 else: 402 cmdargs += "{}, ".format(b) 403 bounds = cmdargs[:-2] 404 cmdargs = '' 405 406 if callable(reduce): _reducer, reduce = reduce, None 402 407 403 408 # special case: model passed as model instance 404 409 #model.__doc__.split('using::')[1].split()[0].strip() 405 410 if callable(model): _model, model = model, "None" 406 if callable(reduce): _reducer, reduce = reduce, None407 411 408 412 # handle logfile if given … … 414 418 415 419 # process "commandline" arguments 416 cmdargs = '' 417 cmdargs += '' if out is None else '--out={} '.format(out) 418 cmdargs += '' if bounds is None else '--bounds="{}" '.format(bounds) 419 cmdargs += '' if label is None else '--label={} '.format(label) 420 cmdargs += '' if nid is None else '--nid={} '.format(nid) 421 cmdargs += '' if iter is None else '--iter={} '.format(iter) 422 cmdargs += '' if reduce is None else '--reduce={} '.format(reduce) 423 cmdargs += '' if scale is None else '--scale={} '.format(scale) 424 cmdargs += '' if shift is None else '--shift={} '.format(shift) 425 cmdargs += '' if fill == False else '--fill ' 426 cmdargs += '' if depth == False else '--depth ' 427 cmdargs += '' if dots == False else '--dots ' 428 cmdargs += '' if join == False else '--join ' 420 if not cmdargs: 421 cmdargs = '' 422 cmdargs += '' if out is None else '--out={} '.format(out) 423 cmdargs += '' if bounds is None else '--bounds="{}" '.format(bounds) 424 cmdargs += '' if label is None else '--label={} '.format(label) 425 cmdargs += '' if nid is None else '--nid={} '.format(nid) 426 cmdargs += '' if iter is None else '--iter={} '.format(iter) 427 cmdargs += '' if reduce is None else '--reduce={} '.format(reduce) 428 cmdargs += '' if scale is None else '--scale={} '.format(scale) 429 cmdargs += '' if shift is None else '--shift={} '.format(shift) 430 cmdargs += '' if fill == False else '--fill ' 431 cmdargs += '' if depth == False else '--depth ' 432 cmdargs += '' if dots == False else '--dots ' 433 cmdargs += '' if join == False else '--join ' 434 else: 435 cmdargs = ' ' + cmdargs 429 436 cmdargs = model.split() + shlex.split(cmdargs) 430 437 … … 700 707 # 'everything else' is essentially the functional interface 701 708 else: 702 out = kwds.get('out', None) 703 dots = kwds.get('dots', False) 704 line = kwds.get('line', False) 705 iter = kwds.get('iter', None) 706 legend = kwds.get('legend', False) 707 nid = kwds.get('nid', None) 708 param = kwds.get('param', None) 709 710 # process "commandline" arguments 711 cmdargs = '' 712 cmdargs += '' if out is None else '--out={} '.format(out) 713 cmdargs += '' if dots == False else '--dots ' 714 cmdargs += '' if line == False else '--line ' 715 cmdargs += '' if iter is None else '--iter={} '.format(iter) 716 cmdargs += '' if legend == False else '--legend ' 717 cmdargs += '' if nid is None else '--nid={} '.format(nid) 718 cmdargs += '' if param is None else '--param="{}" '.format(param) 709 cmdargs = kwds.get('kwds', '') 710 if not cmdargs: 711 out = kwds.get('out', None) 712 dots = kwds.get('dots', False) 713 line = kwds.get('line', False) 714 iter = kwds.get('iter', None) 715 legend = kwds.get('legend', False) 716 nid = kwds.get('nid', None) 717 param = kwds.get('param', None) 718 719 # process "commandline" arguments 720 cmdargs = '' 721 cmdargs += '' if out is None else '--out={} '.format(out) 722 cmdargs += '' if dots == False else '--dots ' 723 cmdargs += '' if line == False else '--line ' 724 cmdargs += '' if iter is None else '--iter={} '.format(iter) 725 cmdargs += '' if legend == False else '--legend ' 726 cmdargs += '' if nid is None else '--nid={} '.format(nid) 727 cmdargs += '' if param is None else '--param="{}" '.format(param) 728 else: 729 cmdargs = ' ' + cmdargs 719 730 if isinstance(filename, basestring): 720 731 cmdargs = filename.split() + shlex.split(cmdargs)
Note: See TracChangeset
for help on using the changeset viewer.