Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xRecordActivity.py12
-rw-r--r--glive.py4
-rw-r--r--model.py3
-rw-r--r--recorded.py11
-rw-r--r--serialize.py0
-rw-r--r--utils.py20
6 files changed, 24 insertions, 26 deletions
diff --git a/RecordActivity.py b/RecordActivity.py
index 114f438..3bef691 100755
--- a/RecordActivity.py
+++ b/RecordActivity.py
@@ -329,18 +329,6 @@ class RecordActivity(activity.Activity):
self.doPostMediaSave( xmlFile, el, recd, mediaObject )
- def _get_base64_pixbuf_data(self, pixbuf):
- data = [""]
- pixbuf.save_to_callback(self._save_data_to_buffer_cb, "png", {}, data)
- import base64
- return base64.b64encode(str(data[0]))
-
-
- def _save_data_to_buffer_cb(self, buf, data):
- data[0] += buf
- return True
-
-
def _mediaSaveCb( self, recd ):
self.doPostMediaSave( recd )
diff --git a/glive.py b/glive.py
index 663b270..08c0ae5 100644
--- a/glive.py
+++ b/glive.py
@@ -24,10 +24,10 @@ import gtk
import pygtk
pygtk.require('2.0')
import sys
-import pygst
-pygst.require('0.10')
import gst
import gst.interfaces
+import pygst
+pygst.require('0.10')
import time
import threading
import gobject
diff --git a/model.py b/model.py
index 7eef17e..99c77bf 100644
--- a/model.py
+++ b/model.py
@@ -32,8 +32,6 @@ import shutil
import gc
import math
import gtk.gdk
-import sugar.env
-import random
import time
from time import strftime
import gobject
@@ -48,6 +46,7 @@ from color import Color
from sugar import util
from sugar.datastore import datastore
+import sugar.env
import _camera
diff --git a/recorded.py b/recorded.py
index 51eb8f1..48a670c 100644
--- a/recorded.py
+++ b/recorded.py
@@ -203,13 +203,4 @@ class Recorded:
print("RecordActivity error -- unable to get datastore object in getMediaFilepath")
return None
- return self.datastoreOb.file_path
-
-
- def pixbufFromString( self, str ):
- pbl = gtk.gdk.PixbufLoader()
- import base64
- data = base64.b64decode( str )
- pbl.write(data)
- pbl.close()
- return pbl.get_pixbuf() \ No newline at end of file
+ return self.datastoreOb.file_path \ No newline at end of file
diff --git a/serialize.py b/serialize.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/serialize.py
diff --git a/utils.py b/utils.py
new file mode 100644
index 0000000..c683dc8
--- /dev/null
+++ b/utils.py
@@ -0,0 +1,20 @@
+import base64
+
+
+def getStringFromPixbuf(pixbuf):
+ data = [""]
+ pixbuf.save_to_callback(_saveDataToBufferCb, "png", {}, data)
+ return base64.b64encode(str(data[0]))
+
+
+def _saveDataToBufferCb(buf, data):
+ data[0] += buf
+ return True
+
+
+def getPixbufFromString(str):
+ pbl = gtk.gdk.PixbufLoader()
+ data = base64.b64decode( str )
+ pbl.write(data)
+ pbl.close()
+ return pbl.get_pixbuf() \ No newline at end of file