From 26305a754b0c6e9edc9ed620e58e8507a95d8dec Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 22 Oct 2014 11:41:30 -0400 Subject: default this to the whole screen --- vt100/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'vt100') diff --git a/vt100/__init__.py b/vt100/__init__.py index 5948696..422c296 100644 --- a/vt100/__init__.py +++ b/vt100/__init__.py @@ -169,7 +169,11 @@ class vt100(object): def process(self, string): return vt100_raw.process_string(addressof(self._screen), string) - def window_contents(self, row_start, col_start, row_end, col_end): + def window_contents(self, row_start=0, col_start=0, row_end=None, col_end=None): + if row_end is None: + row_end = self._rows - 1 + if col_end is None: + col_end = self._cols - 1 row_start = min(max(row_start, 0), self._rows - 1) col_start = min(max(col_start, 0), self._cols - 1) row_end = min(max(row_end, 0), self._rows - 1) @@ -178,7 +182,11 @@ class vt100(object): addressof(self._screen), row_start, col_start, row_end, col_end ).decode('utf-8') - def window_contents_formatted(self, row_start, col_start, row_end, col_end): + def window_contents_formatted(self, row_start=0, col_start=0, row_end=None, col_end=None): + if row_end is None: + row_end = self._rows - 1 + if col_end is None: + col_end = self._cols - 1 row_start = min(max(row_start, 0), self._rows - 1) col_start = min(max(col_start, 0), self._cols - 1) row_end = min(max(row_end, 0), self._rows - 1) -- cgit v1.2.3-54-g00ecf