- Timestamp:
- Aug 9, 2017 12:08:10 PM (6 years ago)
- Location:
- branch/2frame
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASIIpath.py
r2967 r2979 549 549 550 550 551 def IPyBreak_base( ):551 def IPyBreak_base(userMsg=None): 552 552 '''A routine that invokes an IPython session at the calling location 553 553 This routine is only used when debug=True is set in config.py … … 568 568 frame = inspect.currentframe().f_back 569 569 msg = 'Entering IPython console inside {0.f_code.co_filename} at line {0.f_lineno}\n'.format(frame) 570 if userMsg: msg += userMsg 570 571 ipshell(msg,stack_depth=2) # Go up one level, to see the calling routine 571 572 sys.excepthook = savehook # reset IPython's change to the exception hook -
branch/2frame/GSASIIscriptable.py
r2974 r2979 1481 1481 for p in phases: 1482 1482 print(fname, p.name) 1483 1483 def 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 1484 1493 1485 1494 def refine(*args): … … 1504 1513 "refine": refine, 1505 1514 "seqrefine": seqrefine, 1506 "export": export} 1515 "export": export, 1516 "browse": IPyBrowse} 1507 1517 1508 1518 … … 1515 1525 elif len(argv) == 1 or argv[1] in ('help', '--help', '-h'): 1516 1526 # TODO print usage 1517 subcommand_names = ' | '.join(s ubcommands.keys())1527 subcommand_names = ' | '.join(sorted(subcommands.keys())) 1518 1528 print("USAGE: {} [ {} ] ...".format(argv[0], subcommand_names)) 1519 1529 else: 1520 1530 print("Unknown subcommand: {}".format(argv[1])) 1521 1531 print("Available subcommands:") 1522 for name in s ubcommands.keys():1532 for name in sorted(subcommands.keys()): 1523 1533 print("\t{}".format(name)) 1524 1534 sys.exit(-1)
Note: See TracChangeset
for help on using the changeset viewer.