MCPcopy Create free account
hub / github.com/ActiveState/code / parse

Method parse

recipes/Python/578138_gprof2dotpy/recipe-578138.py:1101–1120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1099 self.profile[SAMPLES] = 0
1100
1101 def parse(self):
1102 # read lookahead
1103 self.readline()
1104
1105 self.parse_key('version')
1106 self.parse_key('creator')
1107 while self.parse_part():
1108 pass
1109 if not self.eof():
1110 sys.stderr.write('warning: line %u: unexpected line\n' % self.line_no)
1111 sys.stderr.write('%s\n' % self.lookahead())
1112
1113 # compute derived data
1114 self.profile.validate()
1115 self.profile.find_cycles()
1116 self.profile.ratio(TIME_RATIO, SAMPLES)
1117 self.profile.call_ratios(CALLS)
1118 self.profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
1119
1120 return self.profile
1121
1122 def parse_part(self):
1123 if not self.parse_header_line():

Callers

nothing calls this directly

Calls 11

parse_keyMethod · 0.95
parse_partMethod · 0.95
lookaheadMethod · 0.80
find_cyclesMethod · 0.80
ratioMethod · 0.80
call_ratiosMethod · 0.80
readlineMethod · 0.45
eofMethod · 0.45
writeMethod · 0.45
validateMethod · 0.45
integrateMethod · 0.45

Tested by

no test coverage detected