Ignore:
Timestamp:
Aug 9, 2017 12:08:10 PM (6 years ago)
Author:
toby
Message:

add scriptable option to browse data structure in IPython

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIscriptable.py

    r2974 r2979  
    14811481                for p in phases:
    14821482                    print(fname, p.name)
    1483 
     1483def IPyBrowse(*args):
     1484    """Load a .gpx file and then open a IPython shell to browse it
     1485    """
     1486    filename = []
     1487    for arg in args:
     1488        fname = arg
     1489        proj, nameList = LoadDictFromProjFile(fname)
     1490        msg = "\nfile {} loaded into proj (dict) with names in nameList".format(fname)
     1491        GSASIIpath.IPyBreak_base(msg)
     1492        break
    14841493
    14851494def refine(*args):
     
    15041513               "refine": refine,
    15051514               "seqrefine": seqrefine,
    1506                "export": export}
     1515               "export": export,
     1516               "browse": IPyBrowse}
    15071517
    15081518
     
    15151525    elif len(argv) == 1 or argv[1] in ('help', '--help', '-h'):
    15161526        # TODO print usage
    1517         subcommand_names = ' | '.join(subcommands.keys())
     1527        subcommand_names = ' | '.join(sorted(subcommands.keys()))
    15181528        print("USAGE: {} [ {} ] ...".format(argv[0], subcommand_names))
    15191529    else:
    15201530        print("Unknown subcommand: {}".format(argv[1]))
    15211531        print("Available subcommands:")
    1522         for name in subcommands.keys():
     1532        for name in sorted(subcommands.keys()):
    15231533            print("\t{}".format(name))
    15241534        sys.exit(-1)
Note: See TracChangeset for help on using the changeset viewer.