File: code_block1.py

package info (click to toggle)
python-traitsui 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 13,292 kB
  • sloc: python: 39,867; makefile: 120; sh: 5
file content (22 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from traits.api import *
from traitsui.api import *

class Camera( HasTraits ):
   """ Camera object """
   gain = Enum(1, 2, 3,
      desc="the gain index of the camera",
      label="gain", )
   exposure = CInt(10,
      desc="the exposure time, in ms",
      label="Exposure", )

   def capture(self):
      """ Captures an image on the camera and returns it """
      print "capturing an image at %i ms exposure, gain: %i" % (
                    self.exposure, self.gain )

if  __name__ == "__main__":
   camera = Camera()
   camera.configure_traits()
   camera.capture()