Helper method to prevent having too much duplicated code.
(self, file_path: str, chop: bool = False)
| 13 | super().__init__() |
| 14 | |
| 15 | def page_file(self, file_path: str, chop: bool = False) -> None: |
| 16 | """Helper method to prevent having too much duplicated code.""" |
| 17 | filename = os.path.expanduser(file_path) |
| 18 | try: |
| 19 | with open(filename) as f: |
| 20 | text = f.read() |
| 21 | self.ppaged(text, chop=chop) |
| 22 | except OSError as ex: |
| 23 | self.pexcept(f"Error reading {filename!r}: {ex}") |
| 24 | |
| 25 | @cmd2.with_argument_list |
| 26 | def do_page_wrap(self, args: list[str]) -> None: |
no test coverage detected