Re: [Sugar-devel] The stacktrace for the Pippy camera example error

2011-12-07 Thread laurent bernabe
Hello,

@Gonzalo Odiard

Ok, i'll keep on using my favorite IDE and sugar emulator

@James Cameron


   - As Gonzalo Odiard made me notice that it is best to have my own IDE in
   order to build activity, I'll keep on going this way.
   - I'll look at my file system in pippy/libraries for the api reference
   - That's all I needed, for PyGame i'll look at the official api
   reference (and for standard modules, I'll go to the web)



2011/12/7 James Cameron qu...@laptop.org

 On Wed, Dec 07, 2011 at 01:26:29AM +0100, laurent bernabe wrote:
  I would like to develop activities in Pippy, but I am still wondering :
 
* Does the Pippy activity allow projects made on several files ?

 No.

 See the usage section of my Pippy design document from earlier this
 year:

 http://wiki.sugarlabs.org/go/User:Quozl

 The usage you have asked about, allow projects made on several files,
 is covered by the following usage patterns:

 write a fresh module that imports an included example module unchanged,
 deriving behaviour from existing behaviour,

 write a fresh module that imports a modified example module, and

 write two fresh modules one of which imports the other,

 Usage patterns marked (new) are not yet implemented.

 I do not recommend the current version of Pippy for serious activity
 development.  It is best used only as an introduction to single-module
 programming.

* where is the best place to get Pippy api reference ?

 For the Pippy module, used by import pippy, the documentation is
 embedded in the Python code, read the files in library/pippy ... and if
 you find you don't understand something, please ask.

 For any other module, used by import, the documentation will depend on
 the module.  Be more specific.

 --
 James Cameron
 http://quozl.linux.org.au/

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17

2011-12-07 Thread laurent bernabe
Hello,

here the camera.py modification


2011/12/7 Rafael Ortiz raf...@activitycentral.com



 On Tue, Dec 6, 2011 at 7:57 PM, James Cameron qu...@laptop.org wrote:

 On Wed, Dec 07, 2011 at 01:43:20AM +0100, laurent bernabe wrote:
  Yes, your last modifications made it work after about 2 or 3 seconds.
  (I moved the gst initialisation and implemented the try/catch loop)

 Please attach your finished camera example, then I can test it on XO,
 and merge it for the next version of Pippy.


 +1 please do, the next version wont have also the xolympics example.



  --
 James Cameron
 http://quozl.linux.org.au/
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



# camera: take a picture, animate it on screen

import gst
import pippy
import pygame
import sys
import time

# grey background
bgcolor = (128, 128, 128)



# start using pygame
pygame.init()

# turn off cursor
pygame.mouse.set_visible(False)

# create the pygame window and return a Surface object for
# drawing in that window.
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)

# grab a frame from camera to file
pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/pippypic.jpg')
pipeline.set_state(gst.STATE_PLAYING)

while True:
  try:
  # load in the grabbed camera frame
image = pygame.image.load('/tmp/pippypic.jpg')
break
  except pygame.error:
time.sleep(1)

# stop the camera frame grabbing
pipeline.set_state(gst.STATE_NULL)



angle = 0.0
scale = 2.0

while pippy.pygame.next_frame():
# every time we animate, check for quit or keydown events and exit
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == pygame.KEYDOWN:
sys.exit()

# rotate and scale the image
newImage = pygame.transform.rotozoom(image, angle, scale)
newImageRect = newImage.get_rect()
newImageRect.centerx = screen.get_rect().centerx
newImageRect.centery = screen.get_rect().centery

# display the rotated and scaled image
screen.fill(bgcolor)
screen.blit(newImage, newImageRect)
pygame.display.flip()

# choose a new rotation angle and scale
angle = angle + 5.0
scale = scale * 0.95

# finish once the scale becomes very very small
if scale  0.001:
break

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17

2011-12-07 Thread James Cameron
On Wed, Dec 07, 2011 at 10:41:22AM +0100, laurent bernabe wrote:
 here the camera.py modification

Thanks, pushed.

http://git.sugarlabs.org/pippy/mainline/commit/1c69184a9ad48d716469876cb6723d346396974b

Would appreciate test reports on OLPC XO, I'm a bit sleepy.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] sugar-toolkit-gtk3 patches

2011-12-07 Thread Benjamin Berg
Hello,

On Tue, 2011-12-06 at 00:24 +0100, Sascha Silbe wrote:
 sugar-toolkit-gtk3 is starting to get into shape (branch
 silbe-rework-20111205). Remaining issues:

Nice!

 Several patches also lack a Signed-off-by from their respective author
 (Daniel Drake, Simon Schampijer, Benjamin Berg, Raul Gutierrez Segales).

Feel free to simply add the missing header to my patches. I'll try to
remember adding the option to git in the future.

If there is anything that I should do to help you get the patches in and
get everything working, please ping me.

Benjamin

PS: Sorry, that I missed almost all of the IRC meetings, I keep
forgetting them. But I see I did not even miss it yesterday :-)

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release ClassRoomBroadcast-4

2011-12-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4507

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27772/classroombroadcast-4.xo

Release notes:
*pep8 and pyflakes clean-ups

*Documentation available in:

http://wiki.sugarlabs.org/go/Activities/ClassroomBroadcast


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17

2011-12-07 Thread Rafael Ortiz
On Wed, Dec 7, 2011 at 6:14 AM, James Cameron qu...@laptop.org wrote:

 On Wed, Dec 07, 2011 at 10:41:22AM +0100, laurent bernabe wrote:
  here the camera.py modification

 Thanks, pushed.


 http://git.sugarlabs.org/pippy/mainline/commit/1c69184a9ad48d716469876cb6723d346396974b

 Would appreciate test reports on OLPC XO, I'm a bit sleepy.


Tested on an xo-1.5, the pippy camera example works
as expected.



  --
 James Cameron
 http://quozl.linux.org.au/

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Speak-35

2011-12-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4038

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27773/speak-35.xo

Release notes:
* New translations
* Fix for not-initing in jhbuild on es LANG (Gonzalo Odiard)




Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Pippy-44

2011-12-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4041

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27774/pippy-44.xo

Release notes:
* New translations
* Removing cumbersome xolympics example.
* camera example, fix for delay in image capture file being ready (James 
Cameron, Laurent Bernabe)


== Sources ==

*http://download.sugarlabs.org/sources/sucrose/fructose/Pippy/Pippy-44.tar.bz2


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH 2/2] Ensure we have an m4 directory before running intltoolize

2011-12-07 Thread Marco Pesenti Gritti
Fixes the following error:

ln: failed to create symbolic link `m4/intltool.m4': No such file or directory
cp: cannot create regular file `m4/intltool.m4': No such file or directory

Signed-off-by: Marco Pesenti Gritti ma...@marcopg.org
---
 autogen.sh |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 28bc45c..739ffac 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,6 +6,8 @@ test -n $srcdir || srcdir=.
 olddir=`pwd`
 cd $srcdir
 
+mkdir -p m4
+
 intltoolize
 autoreconf -i
 
-- 
1.7.7.3

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH 1/2] Allow to build outside the source directory

2011-12-07 Thread Marco Pesenti Gritti

Signed-off-by: Marco Pesenti Gritti ma...@marcopg.org
---
 autogen.sh |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index a71e202..28bc45c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,13 @@
 #!/bin/sh
+
+test -n $srcdir || srcdir=`dirname $0`
+test -n $srcdir || srcdir=.
+
+olddir=`pwd`
+cd $srcdir
+
 intltoolize
 autoreconf -i
-./configure --enable-maintainer-mode $@
+
+cd $olddir
+$srcdir/configure --enable-maintainer-mode $@
-- 
1.7.7.3

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] Add a run target to the makefile

2011-12-07 Thread Marco Pesenti Gritti
This allows to run sugar from outside the system path for
development purpouses.

Signed-off-by: Marco Pesenti Gritti ma...@marcopg.org
---
 Makefile.am |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9e252af..79511e8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,3 +12,12 @@ EXTRA_DIST =\
intltool-extract.in
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb
+
+run:
+   PATH=$(prefix)/bin:$(PATH) \
+   PYTHONPATH=$(pythondir) \
+   XDG_DATA_DIRS=$(datadir) \
+   GTK_PATH=$(prefix)/lib/gtk-2.0 \
+   GTK_DATA_PREFIX=$(prefix) \
+   GI_TYPELIB_PATH=$(prefix)/lib/girepository-1.0 \
+   sugar-emulator
-- 
1.7.7.3

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] Add a run target to the makefile

2011-12-07 Thread Marco Pesenti Gritti
This allows to run sugar from outside the system path for
development purpouses.

Signed-off-by: Marco Pesenti Gritti ma...@marcopg.org
---
 Makefile.am |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9e252af..97992be 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,3 +12,12 @@ EXTRA_DIST =\
intltool-extract.in
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb
+
+run:
+   PATH=$(prefix)/bin:$(PATH) \
+   PYTHONPATH=$(pythondir) \
+   XDG_DATA_DIRS=$(datadir) \
+   GTK_PATH=$(libdir)/gtk-2.0 \
+   GTK_DATA_PREFIX=$(prefix) \
+   GI_TYPELIB_PATH=$(libdir)/girepository-1.0 \
+   sugar-emulator
-- 
1.7.7.3

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] forcing a specific language translation

2011-12-07 Thread Erik Blankinship
Normally, I use something like this to automatically get translations
from the right .mo file

from gettext import gettext

def _( s ):
return gettext( s )

But what if I want to force my activity to run in a different
language?  (e.g. Swedish Chef Cookbook Activity)

I tried this:

import gettext
force_lang = gettext.translation('SwedishChef', languages=['sv'] )
force_lang.install( )

def _( s ):
return force_lang.gettext( s )

But it did not work and I get back the default strings from my python
code instead.

Any suggestions?  Thanks!

Erik
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17

2011-12-07 Thread James Cameron
On Wed, Dec 07, 2011 at 11:01:12AM -0500, Rafael Ortiz wrote:
 Tested on an xo-1.5, the pippy camera example works
 as expected.

Good, thanks.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Reflection-2

2011-12-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4517

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27775/reflection-2.xo

Release notes:
2

ENHANCEMENTS:
* new bilateral symmetry game
* save/restore game state to Journal
* enable sharing

BUG_FIX:
* cache dot shapes/colors



Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Reflection-2

2011-12-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4517

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27775/reflection-2.xo

Release notes:
2

ENHANCEMENTS:
* new bilateral symmetry game
* save/restore game state to Journal
* enable sharing

BUG_FIX:
* cache dot shapes/colors



Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Sugar Digest 2011-12-07

2011-12-07 Thread Walter Bender
== Sugar Digest ==

1. I was on a flight from Miami to Boston with Reuben Caron last night
during which we discussed the hot-button topic of Flash games. Reuben
was on his way back from a deployment that was heavy into Flash and
was looking for a way to wean itself from a dependency on deprecated
software that was both opaque and power hungry. Having just finished
porting a Flash game to Sugar--it really is not so difficult--I
suggested that we encourage the deployment to Sugarize their Flash
assets. So we took a quick scan through their library and chose a
reflective-symmetry game as a place to start. Two hours later, we had
Reflection [1] running in Sugar. Version 2, which I wrote on the train
into Cambridge this morning includes collaboration and a mode of
symmetry not available in the original Flash game.

Ultimately, it comes down to sustainability. It is my opinion that
deployments are capable of building capacity and writing simple Sugar
activities that they can tailor to their needs is a skill that pays
off in the short term--no need to sustain Flash--and the long
term--they learn to build tools to solve problems.

2. I've been busy this week with some other programming tasks as well:
enhancing Measure and Turtle Art to take advantage of stereo input:
both analog audio and DC resistance modes. As a result, you can now
attach multiple sensors to the microphone input of an XO 1.5 and read
two channels of data. I wrote a simple Turtle Art program [2] to paint
using a photo-resistor and a mechanical switch. Try doing that in
Flash!!

3. Christofer is doing more Sugar hacking (See [3]).

4. Aleksey Lim has gotten multilingual chat working again on the Sugar
IRC channels (Well, just bilinugual for the moment: Spanish and
English). Instructions on how to use the service are found here [4].
Translation is provided by the Apertium project [5]. The project
accepts contributions [6] to their translation system--those of you
who are bilingual should please try to help.

=== Sugar Labs ===

Gary Martin has generated SOMs from the past few weeks of discussion
on the IAEP mailing list:

2011 Nov 26th-Dec 2nd (45 emails) [7]

Visit our planet [8] for more updates about Sugar and Sugar deployments.


-walter

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org

[1] http://wiki.sugarlabs.org/go/Activities/Reflection
[2] http://wiki.sugarlabs.org/go/File:TAdual-sensor-mode.png
[3] 
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/303924_152746174826035_12719595747_169168_604539697_n.jpg
[4] http://wiki.sugarlabs.org/go/Service/meeting/Usage#Multi-lingual_relaying
[5] http://apertium.org
[6] http://wiki.apertium.org/wiki/Contributing_to_an_existing_pair
[7] http://wiki.sugarlabs.org/go/File:2011-Nov-26-Dec-2-som.jpg
[8] http://planet.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel