| 374 | return html |
| 375 | |
| 376 | def dump_html(self): |
| 377 | frame = inspect.currentframe() |
| 378 | |
| 379 | try: |
| 380 | framefile = fsjoin("tmp", self.classname, "%s_line%s.dump.html" |
| 381 | % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)) |
| 382 | |
| 383 | if not exists(os.path.join("tmp", self.classname)): |
| 384 | os.makedirs(os.path.join("tmp", self.classname)) |
| 385 | |
| 386 | with open(framefile, "wb") as f: |
| 387 | try: |
| 388 | html = encode(self.last_html) |
| 389 | except Exception: |
| 390 | html = self.last_html |
| 391 | |
| 392 | f.write(html) |
| 393 | |
| 394 | except IOError, e: |
| 395 | self.log_error(e) |
| 396 | |
| 397 | finally: |
| 398 | del frame #: Delete the frame or it wont be cleaned |
| 399 | |
| 400 | def clean(self): |
| 401 | """ |