Пример #1
0
 def get_adapter(self, key):
     from runsnakerun import pstatsadapter
     if key == 'functions':
         return pstatsadapter.PStatsAdapter()
     elif key == 'location':
         return pstatsadapter.DirectoryViewAdapter()
     else:
         raise KeyError("""Unknown root type %s""" % (key, ))
Пример #2
0
 def RootNode(self):
     """Return our current root node and appropriate adapter for it"""
     if self.memoryView:
         adapter = meliaeadapter.MeliaeAdapter()
         tree, rows = self.loader
     else:
         if self.directoryView:
             adapter = pstatsadapter.DirectoryViewAdapter()
             tree = self.loader.location_tree
             rows = self.loader.location_rows
         else:
             adapter = pstatsadapter.PStatsAdapter()
             tree = self.loader.tree
             rows = self.loader.rows
         adapter.SetPercentage(self.percentageView,
                               self.loader.tree.cummulative)
     return adapter, tree, rows
Пример #3
0
 def __init__(
     self, parent=None, id=-1,
     title=_("Run Snake Run"),
     pos=wx.DefaultPosition,
     size=wx.DefaultSize,
     style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN,
     name= _("RunSnakeRun"),
     config_parser=None,
 ):
     """Initialise the Frame"""
     wx.Frame.__init__(self, parent, id, title, pos, size, style, name)
     # TODO: toolbar for back, up, root, directory-view, percentage view
     self.adapter = pstatsadapter.PStatsAdapter()
     self.CreateControls(config_parser)
     self.history = [] # set of (activated_node, selected_node) pairs...
     icon = self.LoadRSRIcon()
     if icon:
         self.SetIcon( icon )