~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to examples/draw-proto.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:
104
104
                current.motion(e)
105
105
 
106
106
# A drawed objects, consisting of either a single
107
 
# romboid, or two romboids connected by a winding line
 
107
# rhomboid, or two rhomboids connected by a winding line
108
108
 
109
109
class Movement:
110
110
    def __init__(self, win, ev):
118
118
        self.time = ev.time
119
119
        self.lines = [(ev.event_x, ev.event_y)]
120
120
 
121
 
        self.first = Romboid(self.win, ev)
 
121
        self.first = Rhomboid(self.win, ev)
122
122
        self.last = None
123
123
 
124
124
    def motion(self, ev):
179
179
    def finish(self, ev):
180
180
        self.motion(ev)
181
181
        if len(self.lines) > 1:
182
 
            self.last = Romboid(self.win, ev)
 
182
            self.last = Rhomboid(self.win, ev)
183
183
 
184
184
            self.left = min(ev.event_x - 5, self.left)
185
185
            self.right = max(ev.event_x + 5, self.right)
203
203
                self.last.draw()
204
204
 
205
205
 
206
 
# A romboid, drawed around the Movement endpoints
207
 
class Romboid:
 
206
# A rhomboid, drawed around the Movement endpoints
 
207
class Rhomboid:
208
208
    def __init__(self, win, ev):
209
209
        self.win = win
210
210
        self.x = ev.event_x
212
212
        self.draw()
213
213
 
214
214
    def draw(self):
215
 
        # Draw the segments of the romboid
 
215
        # Draw the segments of the rhomboid
216
216
        PolyLine(self.win.d, None,
217
217
                 X.CoordModePrevious,
218
218
                 self.win.window,