Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-12-24 19:35:01 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-12-24 19:35:01 (GMT)
commit9b9061f8dbbfef4696226a43285109e3a63146b7 (patch)
treebcdbfbbadef00b9235aaf4e3d879e1b72e675d21 /TurtleArt/tawindow.py
parent2e05bede70d995e2affd57c81a8e4453a8986af6 (diff)
adding luminance block; checking for camera before creating palette entries
Diffstat (limited to 'TurtleArt/tawindow.py')
-rwxr-xr-xTurtleArt/tawindow.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index ceb9a69..45c5282 100755
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -25,6 +25,7 @@ import pygtk
pygtk.require('2.0')
import gtk
import gobject
+import gst
import os
import os.path
import dbus
@@ -262,6 +263,14 @@ class TurtleArtWindow():
PALETTES[PALETTE_NAMES.index('sensor')].append('voltage')
self.audio_started = False
+ self.camera = False
+ v4l2src = gst.element_factory_make('v4l2src')
+ if v4l2src.props.device_name is not None:
+ PALETTES[PALETTE_NAMES.index('sensor')].append('readcamera')
+ PALETTES[PALETTE_NAMES.index('sensor')].append('luminance')
+ PALETTES[PALETTE_NAMES.index('sensor')].append('camera')
+ self.camera = True
+
"""
The following code will initialize a USB RFID reader. Please note that
in order to make this initialization function work, it is necessary to