Beispiel #1
0
 def test_clear(self):
     # clear will raise error if TERM is not set
     if os.getenv('TERM') is None:
         os.environ['TERM'] = 'xterm'
     screen = Screen()
     screen.println('Clearing screen...')
     screen.clear()
Beispiel #2
0
 def test_flush(self):
     screen = Screen()
     # standard printf will buffer, so output won't come until newline
     screen.println('The next line should print all at once...')
     for i in range(0, 40):
         screen.printf('.')
         time.sleep(0.5)
     screen.println()
     # now flush after each dot
     screen.println('The next line should print smoothly...')
     for i in range(0, 40):
         screen.printf('.')
         screen.flush()
         time.sleep(0.5)
     screen.println()
 def test_clear(self):
     screen = Screen()
     screen.println('Clearing screen...')
     screen.clear()
 def test_println(self):
     screen = Screen()
     screen.println('single message.')
     screen.println('this a second line.')
     screen.println('this', 'is', 'a', 'list', 'message')
     screen.println(
         'same is a line with an explicit newline, which should cause an empty space below me.\n'
     )
     screen.println('this is a %s message.' % 'printf-style')
     screen.println('this is a {0} message.'.format('format-style'))