Commit 8f5d3eed9bde80853032040d1b78600a5247a24b
1 parent
231cbb01
ftguess: add a __str__ for simpler debugging
Showing
1 changed file
with
7 additions
and
0 deletions
oletools/ftguess.py
| ... | ... | @@ -683,6 +683,13 @@ class FileTypeGuesser(object): |
| 683 | 683 | self.filetype = self.ftype.filetype |
| 684 | 684 | self.application = self.ftype.application |
| 685 | 685 | |
| 686 | + def __str__(self): | |
| 687 | + """Give a short string representation of this object.""" | |
| 688 | + return '[FileTypeGuesser for {0}: {1} from {2} in {3}]'.format( | |
| 689 | + "data" if self.filepath is None | |
| 690 | + else os.path.basename(self.filepath), | |
| 691 | + self.filetype, self.application, self.container) | |
| 692 | + | |
| 686 | 693 | def close(self): |
| 687 | 694 | """ |
| 688 | 695 | This method must be called at the end of processing | ... | ... |