Beremiz.py
branchwx.NewID_abuse_fix
changeset 2553 4b967831374f
parent 2443 75a274023970
child 2558 c9d16163f981
child 2569 4f4d778c9376
equal deleted inserted replaced
2552:46a1e8d1e92c 2553:4b967831374f
    30 import getopt
    30 import getopt
    31 from past.builtins import execfile
    31 from past.builtins import execfile
    32 
    32 
    33 import wx
    33 import wx
    34 from wx.lib.agw.advancedsplash import AdvancedSplash, AS_NOTIMEOUT, AS_CENTER_ON_SCREEN
    34 from wx.lib.agw.advancedsplash import AdvancedSplash, AS_NOTIMEOUT, AS_CENTER_ON_SCREEN
       
    35 
       
    36 import traceback
       
    37 from pprint import pprint
       
    38 orig_NewId = wx.NewId
       
    39 log_newid = {}
       
    40 def NewId(*a,**k):
       
    41     res = orig_NewId(*a,**k)
       
    42     bt = '|'.join([':'.join([f,str(l)]) for f,l,_0,_1 in traceback.extract_stack()[-2:-1]])
       
    43     log_newid[bt] = log_newid.get(bt, 0) + 1
       
    44     worst = log_newid.items()
       
    45     worst.sort(key=lambda x:x[1])
       
    46     pprint(worst)
       
    47     return res
       
    48 wx.NewId = NewId
    35 
    49 
    36 import util.paths as paths
    50 import util.paths as paths
    37 
    51 
    38 
    52 
    39 class BeremizIDELauncher(object):
    53 class BeremizIDELauncher(object):