equal
deleted
inserted
replaced
103 |
103 |
104 class FilterTerminal(filter_interface.Filter): |
104 class FilterTerminal(filter_interface.Filter): |
105 |
105 |
106 attribute_re = re.compile("([a-z][a-z0-9]*)='([^']*)'",re.I) |
106 attribute_re = re.compile("([a-z][a-z0-9]*)='([^']*)'",re.I) |
107 maxdots = 40 # if one prints dots then don't print masses |
107 maxdots = 40 # if one prints dots then don't print masses |
108 recipelinelimit = 200 # don't scan ultra-long recipes in case we run out of memory |
108 recipelinelimit = 100 # don't scan ultra-long recipes in case we run out of memory |
109 |
109 |
110 # recipes that we think most users are interested in |
110 # recipes that we think most users are interested in |
111 # and the mapping that we will use to output them as |
111 # and the mapping that we will use to output them as |
112 docare = { |
112 docare = { |
113 "asmcompile" : "asmcompile" , |
113 "asmcompile" : "asmcompile" , |
280 self.logit_if() |
280 self.logit_if() |
281 |
281 |
282 # This variable holds all recipe information |
282 # This variable holds all recipe information |
283 self.failed = False # Recipe status |
283 self.failed = False # Recipe status |
284 self.recipeBody = [] |
284 self.recipeBody = [] |
|
285 self.recipelineExceeded = 0 |
285 return |
286 return |
286 elif text.startswith("</recipe>"): |
287 elif text.startswith("</recipe>"): |
287 # detect the end of a recipe |
288 # detect the end of a recipe |
288 if not self.inRecipe: |
289 if not self.inRecipe: |
289 sys.stdout.flush() |
290 sys.stdout.flush() |
334 if self.inRecipe: |
335 if self.inRecipe: |
335 self.inBody = True |
336 self.inBody = True |
336 elif text.startswith("]]>"): |
337 elif text.startswith("]]>"): |
337 if self.inRecipe: |
338 if self.inRecipe: |
338 self.inBody = False |
339 self.inBody = False |
|
340 if self.recipelineExceeded: |
|
341 self.recipeBody.append("[filter_terminal: OUTPUT TRUNCATED: Recipe output limit exceeded; " + \ |
|
342 "see logfile for full output (%s lines shown out of %s)]" % \ |
|
343 (FilterTerminal.recipelinelimit, FilterTerminal.recipelinelimit + self.recipelineExceeded)) |
339 elif text.startswith("<info>Copied"): |
344 elif text.startswith("<info>Copied"): |
340 if not self.analyseonly and not self.quiet: |
345 if not self.analyseonly and not self.quiet: |
341 start = text.find(" to ") + 4 |
346 start = text.find(" to ") + 4 |
342 end = text.find("</info>",start) |
347 end = text.find("</info>",start) |
343 short_target = text[start:end] |
348 short_target = text[start:end] |
363 elif self.inBody: |
368 elif self.inBody: |
364 # We are parsing the output from a recipe |
369 # We are parsing the output from a recipe |
365 # we have to keep the output until we find out |
370 # we have to keep the output until we find out |
366 # if the recipe failed. But not all of it if it turns |
371 # if the recipe failed. But not all of it if it turns |
367 # out to be very long |
372 # out to be very long |
368 if len(self.recipeBody) < FilterTerminal.recipelinelimit: |
373 if len(self.recipeBody) <= FilterTerminal.recipelinelimit: |
369 self.recipeBody.append(text) |
374 self.recipeBody.append(text) |
|
375 else: |
|
376 self.recipelineExceeded += 1 |
|
377 |
370 |
378 |
371 def logit(self): |
379 def logit(self): |
372 """ log a message """ |
380 """ log a message """ |
373 info = self.recipe_dict['mappedname'].ljust(FilterTerminal.recipewidth) |
381 info = self.recipe_dict['mappedname'].ljust(FilterTerminal.recipewidth) |
374 config = self.recipe_dict['config'] |
382 config = self.recipe_dict['config'] |