Lines Matching refs:self

178   def __init__(self, loc, in_bytes, expanded, expanded_bytes):
179 self.loc = loc
180 self.in_bytes = in_bytes
181 self.expanded = expanded
182 self.expanded_bytes = expanded_bytes
184 def ratio(self):
185 return self.expanded / (self.loc+1)
187 def to_string(self):
188 exp_bytes, exp_unit = fmt_bytes(self.expanded_bytes)
189 in_bytes, in_unit = fmt_bytes(self.in_bytes)
191 self.loc, in_bytes, in_unit, self.expanded, exp_bytes, exp_unit, self.ratio())
195 def __init__(self, file, target, loc, in_bytes, expanded, expanded_bytes):
197 self.file = file
198 self.target = target
200 def to_string(self):
201 return "{} {} {}".format(super().to_string(), self.file, self.target)
205 def __init__(self, name, regexp_string):
207 self.name = name
208 self.count = 0
209 self.regexp = re.compile(regexp_string)
211 def account(self, unit):
212 if (self.regexp.match(unit.file)):
213 self.loc += unit.loc
214 self.in_bytes += unit.in_bytes
215 self.expanded += unit.expanded
216 self.expanded_bytes += unit.expanded_bytes
217 self.count += 1
219 def to_string(self, name_width):
221 self.name, name_width, self.count, super().to_string())
262 def __init__(self):
263 self.groups = SetupReportGroups()
264 self.units = {}
265 self.source_dependencies = {}
266 self.header_dependents = {}
268 def track(self, filename):
270 for group in self.groups.values():
275 def recordFile(self, filename, targetname, loc, in_bytes, expanded, expanded_bytes):
277 self.units[filename] = unit
278 for group in self.groups.values():
281 def maxGroupWidth(self):
282 return MaxWidth([v.name for v in self.groups.values()])
284 def printGroupResults(self, file):
285 for key in sorted(self.groups.keys()):
286 print(self.groups[key].to_string(self.maxGroupWidth()), file=file)
288 def printSorted(self, key, count, reverse, out):
289 for unit in sorted(list(self.units.values()), key=key, reverse=reverse)[:count]:
292 def addHeaderDeps(self, source_dependencies, header_dependents):
293 self.source_dependencies = source_dependencies
294 self.header_dependents = header_dependents
298 def default(self, o):
309 return json.JSONEncoder.default(self, o)
313 def __init__(self):
314 self.max_width = 0
316 def print(self, statusline, end="\r", file=sys.stdout):
317 self.max_width = max(self.max_width, len(statusline))
318 print("{0:<{1}}".format(statusline, self.max_width),
323 def __init__(self):
324 self.cmd_pattern = re.compile(
328 def process(self, compilation_unit):
329 cmd = self.cmd_pattern.match(compilation_unit['command'])