Paging output, mimic external command less/more
(text, pagesize=None)
| 245 | return '\n'.join(trimmed) |
| 246 | |
| 247 | def pager(text, pagesize=None): |
| 248 | """ |
| 249 | Paging output, mimic external command less/more |
| 250 | """ |
| 251 | if not pagesize: |
| 252 | pagesize = config.Option.get("pagesize") |
| 253 | |
| 254 | if pagesize <= 0: |
| 255 | msg(text) |
| 256 | return |
| 257 | |
| 258 | i = 1 |
| 259 | text = text.splitlines() |
| 260 | l = len(text) |
| 261 | |
| 262 | for line in text: |
| 263 | msg(line) |
| 264 | if i % pagesize == 0: |
| 265 | ans = input("--More--(%d/%d)" % (i, l)) |
| 266 | if ans.lower().strip() == "q": |
| 267 | break |
| 268 | i += 1 |
| 269 | |
| 270 | return |
| 271 | |
| 272 | def execute_external_command(command, cmd_input=None): |
| 273 | """ |
no test coverage detected