MCPcopy
hub / github.com/dbcli/pgcli / echo_via_pager

Method echo_via_pager

pgcli/main.py:1342–1354  ·  view source on GitHub ↗
(self, text, color=None)

Source from the content-addressed store, hash-verified

1340 return len(lines) >= (self.prompt_app.output.get_size().rows - 4)
1341
1342 def echo_via_pager(self, text, color=None):
1343 if self.pgspecial.pager_config == PAGER_OFF or self.watch_command:
1344 click.echo(text, color=color)
1345 elif self.pgspecial.pager_config == PAGER_LONG_OUTPUT and self.table_format != "csv":
1346 lines = text.split("\n")
1347
1348 # The last 4 lines are reserved for the pgcli menu and padding
1349 if self.is_too_tall(lines) or any(self.is_too_wide(l) for l in lines):
1350 click.echo_via_pager(text, color=color)
1351 else:
1352 click.echo(text, color=color)
1353 else:
1354 click.echo_via_pager(text, color)
1355
1356
1357@click.command()

Callers 5

execute_commandMethod · 0.95
cliFunction · 0.95
test_pset_pager_offFunction · 0.80
test_pset_pager_alwaysFunction · 0.80
test_pset_pager_onFunction · 0.80

Calls 3

is_too_tallMethod · 0.95
is_too_wideMethod · 0.95
echoMethod · 0.80

Tested by 3

test_pset_pager_offFunction · 0.64
test_pset_pager_alwaysFunction · 0.64
test_pset_pager_onFunction · 0.64