Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
ProfileBrowser Class Reference
Inheritance diagram for ProfileBrowser:
Cmd

Public Member Functions

def __init__
 
def generic
 
def generic_help
 
def do_add
 
def help_add
 
def do_callees
 
def help_callees
 
def do_callers
 
def help_callers
 
def do_EOF
 
def help_EOF
 
def do_quit
 
def help_quit
 
def do_read
 
def help_read
 
def do_reverse
 
def help_reverse
 
def do_sort
 
def help_sort
 
def complete_sort
 
def do_stats
 
def help_stats
 
def do_strip
 
def help_strip
 
def postcmd
 
- Public Member Functions inherited from Cmd
def __init__
 
def cmdloop
 
def precmd
 
def postcmd
 
def preloop
 
def postloop
 
def parseline
 
def onecmd
 
def emptyline
 
def default
 
def completedefault
 
def completenames
 
def complete
 
def get_names
 
def complete_help
 
def do_help
 
def print_topics
 

Data Fields

 prompt
 
 stats
 
- Data Fields inherited from Cmd
 lastcmd
 
 completion_matches
 

Additional Inherited Members

- Static Public Attributes inherited from Cmd
 prompt = PROMPT
 
 identchars = IDENTCHARS
 
string ruler = '='
 
string lastcmd = ''
 
list cmdqueue = []
 
 intro = None
 
string doc_leader = ""
 
string doc_header = "Documented commands (type help <topic>):"
 
string misc_header = "Miscellaneous help topics:"
 
string undoc_header = "Undocumented commands:"
 
string nohelp = "*** No help on %s"
 
int use_rawinput = 1
 

Detailed Description

Definition at line 505 of file pstats.py.

Constructor & Destructor Documentation

def __init__ (   self,
  profile = None 
)

Definition at line 506 of file pstats.py.

References Cmd.__init__().

507  def __init__(self, profile=None):
509  self.prompt = "% "
510  if profile:
511  self.stats = Stats(profile)
512  else:
513  self.stats = None

Member Function Documentation

def complete_sort (   self,
  text,
  args 
)

Definition at line 609 of file pstats.py.

610  def complete_sort(self, text, *args):
611  return [a for a in Stats.sort_arg_dict_default.keys() if a.startswith(text)]
def do_add (   self,
  line 
)

Definition at line 546 of file pstats.py.

547  def do_add(self, line):
548  self.stats.add(line)
return 0
def do_callees (   self,
  line 
)

Definition at line 552 of file pstats.py.

References ProfileBrowser.generic().

553  def do_callees(self, line):
return self.generic('print_callees', line)
def do_callers (   self,
  line 
)

Definition at line 558 of file pstats.py.

References ProfileBrowser.generic().

559  def do_callers(self, line):
return self.generic('print_callers', line)
def do_EOF (   self,
  line 
)

Definition at line 564 of file pstats.py.

565  def do_EOF(self, line):
566  print ""
return 1
def do_quit (   self,
  line 
)

Definition at line 570 of file pstats.py.

571  def do_quit(self, line):
return 1
def do_read (   self,
  line 
)

Definition at line 575 of file pstats.py.

References Cmd.prompt, Stats.stats, Profile.stats, and ProfileBrowser.stats.

576  def do_read(self, line):
577  if line:
578  try:
579  self.stats = Stats(line)
580  except IOError, args:
581  print args[1]
582  return
583  self.prompt = line + "% "
584  elif len(self.prompt) > 2:
585  line = self.prompt[-2:]
586  else:
587  print "No statistics object is current -- cannot reload."
return 0
def do_reverse (   self,
  line 
)

Definition at line 591 of file pstats.py.

592  def do_reverse(self, line):
593  self.stats.reverse_order()
return 0
def do_sort (   self,
  line 
)

Definition at line 597 of file pstats.py.

References fnmatch.filter(), and dumbdbm.keys().

598  def do_sort(self, line):
599  abbrevs = self.stats.get_sort_arg_defs().keys()
600  if line and not filter(lambda x,a=abbrevs: x not in a,line.split()):
601  apply(self.stats.sort_stats, line.split())
602  else:
603  print "Valid sort keys (unique prefixes are accepted):"
604  for (key, value) in Stats.sort_arg_dict_default.items():
605  print "%s -- %s" % (key, value[1])
return 0
def do_stats (   self,
  line 
)

Definition at line 612 of file pstats.py.

References ProfileBrowser.generic().

613  def do_stats(self, line):
return self.generic('print_stats', line)
def do_strip (   self,
  line 
)

Definition at line 618 of file pstats.py.

619  def do_strip(self, line):
620  self.stats.strip_dirs()
return 0
def generic (   self,
  fn,
  line 
)

Definition at line 514 of file pstats.py.

References Stats.stats, Profile.stats, and ProfileBrowser.stats.

515  def generic(self, fn, line):
516  args = line.split()
517  processed = []
518  for term in args:
519  try:
520  processed.append(int(term))
521  continue
522  except ValueError:
523  pass
524  try:
525  frac = float(term)
526  if frac > 1 or frac < 0:
527  print "Fraction argument mus be in [0, 1]"
528  continue
529  processed.append(frac)
530  continue
531  except ValueError:
532  pass
533  processed.append(term)
534  if self.stats:
535  apply(getattr(self.stats, fn), processed)
536  else:
537  print "No statistics object is loaded."
return 0
def generic_help (   self)

Definition at line 538 of file pstats.py.

539  def generic_help(self):
540  print "Arguments may be:"
541  print "* An integer maximum number of entries to print."
542  print "* A decimal fractional number between 0 and 1, controlling"
543  print " what fraction of selected entries to print."
544  print "* A regular expression; only entries with function names"
545  print " that match it are printed."
def help_add (   self)

Definition at line 549 of file pstats.py.

550  def help_add(self):
551  print "Add profile info from given file to current statistics object."
def help_callees (   self)

Definition at line 554 of file pstats.py.

References ProfileBrowser.generic_help().

555  def help_callees(self):
556  print "Print callees statistics from the current stat object."
557  self.generic_help()
def help_callers (   self)

Definition at line 560 of file pstats.py.

References ProfileBrowser.generic_help().

561  def help_callers(self):
562  print "Print callers statistics from the current stat object."
563  self.generic_help()
def help_EOF (   self)

Definition at line 567 of file pstats.py.

568  def help_EOF(self):
569  print "Leave the profile brower."
def help_quit (   self)

Definition at line 572 of file pstats.py.

573  def help_quit(self):
574  print "Leave the profile brower."
def help_read (   self)

Definition at line 588 of file pstats.py.

589  def help_read(self):
590  print "Read in profile data from a specified file."
def help_reverse (   self)

Definition at line 594 of file pstats.py.

595  def help_reverse(self):
596  print "Reverse the sort order of the profiling report."
def help_sort (   self)

Definition at line 606 of file pstats.py.

607  def help_sort(self):
608  print "Sort profile data according to specified keys."
print "(Typing `sort' without arguments lists valid keys.)"
def help_stats (   self)

Definition at line 614 of file pstats.py.

References ProfileBrowser.generic_help().

615  def help_stats(self):
616  print "Print statistics from the current stat object."
617  self.generic_help()
def help_strip (   self)

Definition at line 621 of file pstats.py.

622  def help_strip(self):
623  print "Strip leading path information from filenames in the report."
def postcmd (   self,
  stop,
  line 
)

Definition at line 624 of file pstats.py.

625  def postcmd(self, stop, line):
626  if stop:
627  return stop
628  return None
629 
import sys

Field Documentation

prompt

Definition at line 508 of file pstats.py.

stats

Definition at line 510 of file pstats.py.


The documentation for this class was generated from the following file: