Example #1
0
def main():
    print('generating random sentences...')
    count = 15
    docgen = DocumentGenerator()
    terminal = Terminal(count)
    terminal.write_lines()
    terminal.hide_cursor()
    for _ in range(800):
        index = random.randint(0, count - 1)
        terminal.write_line(index, docgen.sentence())
        time.sleep(.01)
    terminal.write_lines(force=True)
    terminal.show_cursor()
Example #2
0
 def test__hide_cursor_Should_CallExpected_When_NoAtty(self, cursor_patch, stderr_patch, *patches):
     stderr_patch.isatty.return_value = False
     term = Terminal(3, create=False)
     term.hide_cursor()
     cursor_patch.hide.assert_not_called()