Changeset - 9036ebf37b04
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-19 21:40:30
drewp@bigasterisk.com
bye tkinter error reporter
1 file changed with 0 insertions and 16 deletions:
0 comments (0 inline, 0 general)
light9/run_local.py
Show inline comments
 
# bootstrap
 

	
 
import sys, os, socket
 

	
 
from twisted.python.failure import Failure
 

	
 

	
 
try:
 
    import tkinter
 
except ImportError:
 
    pass
 
else:
 

	
 
    def rce(self, exc, val, tb):
 
        sys.stderr.write("Exception in Tkinter callback\n")
 
        if True:
 
            sys.excepthook(exc, val, tb)
 
        else:
 
            Failure(val, exc, tb).printDetailedTraceback()
 

	
 
    tkinter.Tk.report_callback_exception = rce
 

	
 
import coloredlogs, logging, time
 
try:
 
    import faulthandler
 
    faulthandler.enable()
 
except ImportError:
 
    pass
 

	
 
if 0:
 
    from IPython.core import ultratb
 
    sys.excepthook = ultratb.FormattedTB(mode='Verbose',
 
                                         color_scheme='Linux',
 
                                         call_pdb=1)
 

	
 
progName = sys.argv[0].split('/')[-1]
 
log = logging.getLogger()  # this has to get the root logger
 
log.name = progName  # but we can rename it for clarity
 

	
 

	
 
def fracTimeLogger():
 
    class FractionTimeFilter(logging.Filter):
 

	
 
        def filter(self, record):
 
            record.fractionTime = (
 
                time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(record.created)) +
0 comments (0 inline, 0 general)