/usr/share/doc/python-traits/examples/tutorials/doc_examples/examples/event.py is in python-traits 4.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# event.py --- Example of a trait event
#--<Imports>--------------------------------------------------------------------
from traits.api import Event, HasTraits, List, RGBColor, Tuple
#--[Code]-----------------------------------------------------------------------
point_2d = Tuple(0, 0)
class Line2D(HasTraits):
points = List(point_2d)
line_color = RGBColor('black')
updated = Event
def redraw():
pass # Not implemented for this example
def _points_changed(self):
self.updated = True
def _updated_fired(self):
self.redraw()
|