psdump(filename=None, layer_shift=0, rebuild=1) Creates an EPS file describing a packet. If filename is not provided a temporary file is created and gs is called. :param filename: the file's filename
(self, filename=None, **kargs)
| 518 | pass |
| 519 | |
| 520 | def psdump(self, filename=None, **kargs): |
| 521 | # type: (Optional[str], **Any) -> None |
| 522 | """ |
| 523 | psdump(filename=None, layer_shift=0, rebuild=1) |
| 524 | |
| 525 | Creates an EPS file describing a packet. If filename is not provided a |
| 526 | temporary file is created and gs is called. |
| 527 | |
| 528 | :param filename: the file's filename |
| 529 | """ |
| 530 | from scapy.config import conf |
| 531 | from scapy.utils import get_temp_file, ContextManagerSubprocess |
| 532 | canvas = self.canvas_dump(**kargs) |
| 533 | if filename is None: |
| 534 | fname = get_temp_file(autoext=kargs.get("suffix", ".eps")) |
| 535 | canvas.writeEPSfile(fname) |
| 536 | if WINDOWS and not conf.prog.psreader: |
| 537 | os.startfile(fname) |
| 538 | else: |
| 539 | with ContextManagerSubprocess(conf.prog.psreader): |
| 540 | subprocess.Popen([conf.prog.psreader, fname]) |
| 541 | else: |
| 542 | canvas.writeEPSfile(filename) |
| 543 | print() |
| 544 | |
| 545 | def pdfdump(self, filename=None, **kargs): |
| 546 | # type: (Optional[str], **Any) -> None |
nothing calls this directly
no test coverage detected