~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to examples/threadtest.py

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
from Xlib import display, X, threaded
9
9
import time
10
 
import thread
 
10
 
 
11
try:
 
12
    # Python 3
 
13
    import _thread as thread
 
14
except ImportError:
 
15
    # Python 2
 
16
    import thread
11
17
 
12
18
def redraw(win, gc):
13
19
    # win.clear_area()
16
22
def blink(display, win, gc, cols):
17
23
    while 1:
18
24
        time.sleep(2)
19
 
        print 'Changing color', cols[0]
 
25
        print('Changing color %i' % cols[0])
20
26
        gc.change(foreground = cols[0])
21
27
        cols = (cols[1], cols[0])
22
28
        redraw(win, gc)