]> git.phdru.name Git - m_lib.git/blob - m_lib/pbar/test/test4.py
Use print function for Py3 compatibility
[m_lib.git] / m_lib / pbar / test / test4.py
1 #! /usr/bin/env python
2 """
3    Test N4: earse()/redraw()
4 """
5
6 from __future__ import print_function
7 import sys
8 from time import sleep
9 from m_lib.pbar.tty_pbar import ttyProgressBar
10
11
12 def test():
13    sys.stdout.write("Displaying... ")
14    sys.stdout.flush()
15
16    pbar = ttyProgressBar(0, 100)
17    pbar.display(42)
18    sleep(2)
19    pbar.erase()
20
21    sys.stdout.write("erasing... ")
22    sys.stdout.flush()
23    sleep(2)
24
25    sys.stdout.write("redisplaying... ")
26    sys.stdout.flush()
27    pbar.redraw()
28    sleep(2)
29
30    del pbar
31    print("Ok")
32
33
34 if __name__ == "__main__":
35    test()