Changeset 1566


Ignore:
Timestamp:
Nov 10, 2014 12:52:35 PM (7 years ago)
Author:
toby
Message:

move debug invovation after parse of most routines; remove traceback formatting on windows

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1561 r1566  
    36203620    #print "wxPython description",wx.PlatformInfo
    36213621    print "This is GSAS-II version:     ",__version__,' revision '+str(GSASIIpath.GetVersionNumber())
     3622    GSASIIpath.InvokeDebugOpts()
    36223623    main() # start the GUI
  • trunk/GSASIIpath.py

    r1563 r1566  
    309309    sys.exit()
    310310
    311 def IPyBreak():
     311def IPyBreak_base():
    312312    '''A routine that invokes an IPython session at the calling location
    313313    This routine is only used when debug=True is set in config.py
     
    339339    '''
    340340    from IPython.core import ultratb
    341     ultratb.FormattedTB(call_pdb=False,color_scheme='LightBG')(*args)
     341    if 'win' in sys.platform:
     342        ultratb.FormattedTB(call_pdb=False,color_scheme='NoColor')(*args)
     343    else:
     344        ultratb.FormattedTB(call_pdb=False,color_scheme='LightBG')(*args)
    342345    try:
    343346        from IPython.terminal.embed import InteractiveShellEmbed
     
    362365    pass
    363366
    364 if GetConfigValue('debug'):
    365     print 'Debug on: IPython: Exceptions and G2path.IPyBreak(); pdb: G2path.pdbBreak()'
    366     sys.excepthook = exceptHook
    367     import pdb
    368     pdbBreak = pdb.set_trace
    369 else:
    370     IPyBreak = DoNothing
    371     pdbBreak = DoNothing
     367IPyBreak = DoNothing
     368pdbBreak = DoNothing
     369def InvokeDebugOpts():
     370    'Called in GSASII.py to set up debug options'
     371    if GetConfigValue('debug'):
     372        print 'Debug on: IPython: Exceptions and G2path.IPyBreak(); pdb: G2path.pdbBreak()'
     373        sys.excepthook = exceptHook
     374        import pdb
     375        global pdbBreak
     376        pdbBreak = pdb.set_trace
     377        global IPyBreak
     378        IPyBreak = IPyBreak_base
    372379   
    373380if __name__ == '__main__':
     381    '''What follows is called to update (or downdate) GSAS-II in a separate process.
     382    '''
    374383    import subprocess
    375384    import time
Note: See TracChangeset for help on using the changeset viewer.