Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/face.py
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2012-07-31 14:09:40 (GMT)
committer flavio <fdanesse@gmail.com>2012-07-31 14:09:40 (GMT)
commitbdee0fb30a0e4d9da08fc7481e20070a3ce7ac0a (patch)
tree7c4df1c9a1e73b4b495497a1f00eedac74b9a5f7 /face.py
parent777d75ee9daedc65e37f4b15e924feb2f6b6dcb6 (diff)
Modularization of the eye
Diffstat (limited to 'face.py')
-rw-r--r--face.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/face.py b/face.py
index 7dd0498..6e208a5 100644
--- a/face.py
+++ b/face.py
@@ -31,7 +31,8 @@ import sugar3.graphics.style as style
import espeak
import eye
-import glasses
+from eye import Eye
+from eye import Glasses
from mouth import Mouth
from mouth import FFTMouth
from mouth import WaveformMouth
@@ -52,7 +53,7 @@ class Status():
self.mouth = Mouth
def serialize(self):
- eyes = {eye.Eye: 1, glasses.Glasses: 2}
+ eyes = {Eye: 1, Glasses: 2}
mouths = {Mouth: 1,
FFTMouth: 2,
@@ -67,7 +68,7 @@ class Status():
'mouth': mouths[self.mouth]})
def deserialize(self, buf):
- eyes = {1: eye.Eye, 2: glasses.Glasses}
+ eyes = {1: Eye, 2: Glasses}
mouths = {1: Mouth,
2: FFTMouth,
@@ -141,11 +142,13 @@ class View(Gtk.EventBox):
if status: self.status = status
- for eye in self._eyes:
- self._eyebox.remove(eye)
+ for child in self._eyebox.get_children():
+ self._eyebox.remove(child)
+ child.destroy()
for child in self._mouthbox.get_children():
self._mouthbox.remove(child)
+ child.destroy()
self._eyes = []
for i in self.status.eyes: