Re: [Sugar-devel] [PATCH] fix trivial typo in extension loading exception

2010-06-01 Thread James Cameron
On Tue, Jun 01, 2010 at 08:17:32AM +, Sascha Silbe wrote:
> While you're at it, can you avoid the escaping by using different quotes
> and replace "%" with "," (for consistency with our style guidelines - it
> doesn't really make a difference in this particular case), please?

I've read your style guidelines on
http://wiki.sugarlabs.org/go/Development_Team/Code_guidelines in
particular the use of logging.debug('foo %r bar', x) instead of
logging.debug('foo %r bar' % x) as you pointed out, but also that the
code is about communicating to people, and I propose the following
alternate patch which simplifies the message so that it is succinct and
therefore more readily comprehended:

>From c6063e8e61286f225027493d7b63368e652e6c27 Mon Sep 17 00:00:00 2001
From: James Cameron 
Date: Wed, 2 Jun 2010 16:30:29 +1000
Subject: [PATCH] simplify extension loading exception error

Discovered in shell logs of os240py, this exception was triggered due
to the yet to be merged touchpad control panel extension.  But the
exception used incorrect grammar.
---
 src/jarabe/controlpanel/gui.py |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 51d9820..0f002fd 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -259,8 +259,7 @@ class ControlPanel(gtk.Window):
 keywords.append(item)
 options[item]['keywords'] = keywords
 else:
-_logger.error('There is no CLASS constant specifieds ' 
\
-  'in the view file \'%s\'.' % item)
+_logger.error('no CLASS attribute in %s', item)
 except Exception:
 logging.error('Exception while loading extension:\n' + \
 ''.join(traceback.format_exception(*sys.exc_info(
-- 
1.7.1

-- 
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] Paint: use keys for change line width (OLPC#8865)

2010-06-01 Thread James Cameron
On Wed, Jun 02, 2010 at 02:02:04AM -0300, Gonzalo Odiard wrote:
> Tomeu was right. Catching the key stokes in the activity works.

Yes, I see, that works well.

Are you happy with relative size change rather than absolute?  The
ticket originally asked for absolute size setting.  You have made the
keys change the size relative to the current size.

Here is the patch with your usual whitespace errors fixed, and a rewrite
of the key handling using a dictionary again.

>From e2f9eba803f44aeba778221825dc6f976087b3a4 Mon Sep 17 00:00:00 2001
From: Gonzalo Odiard 
Date: Wed, 2 Jun 2010 16:07:06 +1000
Subject: [PATCH] slider keys change line size, dev.laptop.org #8865

Connects XO-1 and XO-1.5 slider function keys to line size change for
pencil, eraser, brush and rainbow.  The size change is relative to
current size.

http://dev.laptop.org/ticket/8865

Reviewed-by: James Cameron 
Tested-by: James Cameron 
---
 Area.py|   12 +++-
 OficinaActivity.py |7 +++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Area.py b/Area.py
index 7b8c8b4..570d093 100644
--- a/Area.py
+++ b/Area.py
@@ -97,15 +97,13 @@ class Area(gtk.DrawingArea):
 gtk.gdk.BUTTON_PRESS_MASK |
 gtk.gdk.BUTTON_RELEASE_MASK|
 gtk.gdk.EXPOSURE_MASK |
-gtk.gdk.KEY_PRESS_MASK |
-gtk.gdk.KEY_RELEASE_MASK) 
+gtk.gdk.KEY_PRESS_MASK)
 
 self.connect("expose_event",self.expose)
 self.connect("motion_notify_event", self.mousemove)
 self.connect("button_press_event", self.mousedown)
 self.connect("button_release_event", self.mouseup)
 self.connect("key_press_event", self.key_press)
-self.connect("key_release_event", self.key_release)
 
 self.set_flags(gtk.CAN_FOCUS)
 self.grab_focus()
@@ -1164,8 +1162,12 @@ class Area(gtk.DrawingArea):
 self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.TCROSS))
 widget.queue_draw()
 
-def key_release(self,widget,event):
-pass
+def change_line_size(self, delta):
+if self.tool['name'] in ['pencil','eraser','brush','rainbow']:
+size = self.tool['line size'] + delta
+self.tool['line size'] = size
+self.configure_line(size)
+self.queue_draw()
 
 def _keep_selection_ratio(self, coords):
 def sign(x):
diff --git a/OficinaActivity.py b/OficinaActivity.py
index 332f198..c72576a 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -117,6 +117,8 @@ class OficinaActivity(activity.Activity):
 self.set_toolbox(toolbox)
 toolbox.show()
 
+self.connect("key_press_event", self.key_press)
+
 # setup self.area only once
 
 def map_cp(widget):
@@ -131,6 +133,11 @@ class OficinaActivity(activity.Activity):
 
 self._setup_handle = self.connect('map', map_cp)
 
+def key_press(self, widget, event):
+sliders = {65474: -5, 65475: -1, 65476: 1, 65477: 5}
+if event.keyval in sliders:
+self.area.change_line_size(sliders[event.keyval])
+
 def read_file(self, file_path):
 '''Read file from Sugar Journal.'''
 
-- 
1.7.1

-- 
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] Paint: use keys for change line width (OLPC#8865)

2010-06-01 Thread Gonzalo Odiard
Tomeu was right. Catching the key stokes in the activity works.

>From 08e0226731c13e74b993b59c1a2c8165e9ad3654 Mon Sep 17 00:00:00 2001
From: Gonzalo Odiard 
Date: Wed, 2 Jun 2010 01:59:54 -0300
Subject: [PATCH] implement OLPC #8865

---
 Area.py|   13 -
 OficinaActivity.py |   15 +++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/Area.py b/Area.py
index e81fcdc..8a5e523 100644
--- a/Area.py
+++ b/Area.py
@@ -97,15 +97,13 @@ class Area(gtk.DrawingArea):
 gtk.gdk.BUTTON_PRESS_MASK |
 gtk.gdk.BUTTON_RELEASE_MASK|
 gtk.gdk.EXPOSURE_MASK |
-gtk.gdk.KEY_PRESS_MASK |
-gtk.gdk.KEY_RELEASE_MASK)
+gtk.gdk.KEY_PRESS_MASK)

 self.connect("expose_event",self.expose)
 self.connect("motion_notify_event", self.mousemove)
 self.connect("button_press_event", self.mousedown)
 self.connect("button_release_event", self.mouseup)
 self.connect("key_press_event", self.key_press)
-self.connect("key_release_event", self.key_release)

 self.set_flags(gtk.CAN_FOCUS)
 self.grab_focus()
@@ -1163,8 +1161,13 @@ class Area(gtk.DrawingArea):
 self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.TCROSS))
 widget.queue_draw()

-def key_release(self,widget,event):
-pass
+def change_line_size(self, delta):
+if self.tool['name'] in ['pencil','eraser','brush','rainbow']:
+size = self.tool['line size'] + delta
+self.tool['line size'] = size
+self.configure_line(size)
+self.queue_draw()
+

 def _keep_selection_ratio(self, coords):
 def sign(x):
diff --git a/OficinaActivity.py b/OficinaActivity.py
index f7dd088..8259ca8 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -116,6 +116,8 @@ class OficinaActivity(activity.Activity):
 self.set_toolbox(toolbox)
 toolbox.show()

+self.connect("key_press_event", self.key_press)
+
 # setup self.area only once

 def map_cp(widget):
@@ -130,6 +132,19 @@ class OficinaActivity(activity.Activity):

 self._setup_handle = self.connect('map', map_cp)

+
+def key_press(self,widget,event):
+if (event.keyval >= 65474) and (event.keyval <= 65477):
+if event.keyval == 65474:
+self.area.change_line_size(-5)
+elif event.keyval == 65475:
+self.area.change_line_size(-1)
+elif event.keyval == 65476:
+self.area.change_line_size(1)
+elif event.keyval == 65477:
+self.area.change_line_size(5)
+
+
 def read_file(self, file_path):
 '''Read file from Sugar Journal.'''

-- 
1.6.6.1


-- 
Gonzalo


0001-implement-OLPC-8865.patch
Description: Binary data
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] fix trivial typo in extension loading exception

2010-06-01 Thread James Cameron
On Tue, Jun 01, 2010 at 08:17:32AM +, Sascha Silbe wrote:
> While you're at it, can you avoid the escaping by using different
> quotes and replace "%" with "," (for consistency with our style
> guidelines - it doesn't really make a difference in this particular
> case), please?

Heh.  Sure.  Tell me where your style guidelines are?

Diversion.

What we're missing from the process at the moment is the people who
apply the patches are supposed to say so as a reply to the thread.
Either nobody is applying these reviewed patches, or those who are
applying them are not saying so.  ;-}

I mention that because it's the sort of thing that I'd expect you as a
committer to the repository to have handled yourself rather than write a
reply about it.  I presume you were terribly busy and couldn't afford
the time.  Or is there something about the process I'm not
understanding?

-- 
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] Activity updater

2010-06-01 Thread Bernie Innocenti
El Tue, 01-06-2010 a las 20:11 +, Aleksey Lim escribió:

> I'm planing to finish GCompris/TuxPaint/OOo4Kids(hope it won't be hard)
> sugarizing and will start work to provide all these blobs from ASLO
> (experimental activities, per arch blobs, more QA useful workflow) and
> can start microformat work as well.

Dude, you totally rule!!

Let me know if you need help testing any of this work.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

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


Re: [Sugar-devel] ANNOUNCE: Sugar 0.88 for the XO-1

2010-06-01 Thread Bernie Innocenti
El Sat, 29-05-2010 a las 11:20 +1000, fors...@ozonline.com.au escribió:
> os240py
> 
> Measure sometimes locks up on recording a waveform, quitting from frame
> then brings up metacity dialog "activity is not responding" Dont think
> there was any error log.

I've never seen this happen myself... Can you test the same version of
Measure with an older version of Sugar? For example, os179py.


> more on delayed  or absent pulsing start icon and activities starting
> in window: i suspect the two may be related, on the rare occasion that
> an activity started in a window, the pulsing icon was absent (also rare)
> 
> sugar sometimes restarts; only seen 3 times, twice clicking on journal
> and once deleting a journal entry

Restart?? Wow. I wonder if we're making X11 crash. If you get this
again, could you check /var/log/Xorg.0.log.old?

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

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


Re: [Sugar-devel] ANNOUNCE: Sugar 0.88 for the XO-1

2010-06-01 Thread Bernie Innocenti
El Fri, 28-05-2010 a las 21:16 +1000, fors...@ozonline.com.au escribió:
> bugs os240py
> 
> Activities sometimes launch and stay in a window (seen with paint and turtle 
> blocks)
> but not happening today more frequently the window appears only for a 
> fraction of a
> second at launch (with scratch and abacus the window is visible for half a 
> second or so)
> and Pippy always launches pygame in a window

I've also seen this happen, but only temporarily, while the cpu is being
hogged by some activity.

Thou I think it never happened to me in SoaS or in sugar-emulator. Can
anyone confirm this? So we'd figure out whether or or not it's
OS-specific.


> once paint briefly said activity failed to start, just before it started ok
> pulsing icon during activity start is delayed in appearing, eg takes
> 4 seconds with turtle blocks, thats one of the slowest

I have seen this issue too.

These are obviously fall-outs from the switch to Metacity. If debugging
these issues turns out to take too much time, we could simply revert to
matchbox for this release. Anyway, until we add support for non-sugar
applications, there's no big advantage in using Metacity.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

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


Re: [Sugar-devel] Activity updater

2010-06-01 Thread Aleksey Lim
On Tue, Jun 01, 2010 at 03:22:08PM -0400, Bernie Innocenti wrote:
> El Fri, 28-05-2010 a las 09:23 +, Aleksey Lim escribió:
> 
> > But what about more trivial way, just create new php generated page
> > (like update-aslo.php) to generate page with what updater needs. In that
> > case such script will be stored out of AMO code base and won't contain
> > any AMO UI elements.
> 
> Indeed, that would make the microformat updater slightly more efficient
> and less invasive.

I'm planing to finish GCompris/TuxPaint/OOo4Kids(hope it won't be hard)
sugarizing and will start work to provide all these blobs from ASLO
(experimental activities, per arch blobs, more QA useful workflow) and
can start microformat work as well.

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


Re: [Sugar-devel] Activity updater

2010-06-01 Thread Bernie Innocenti
El Fri, 28-05-2010 a las 09:23 +, Aleksey Lim escribió:

> But what about more trivial way, just create new php generated page
> (like update-aslo.php) to generate page with what updater needs. In that
> case such script will be stored out of AMO code base and won't contain
> any AMO UI elements.

Indeed, that would make the microformat updater slightly more efficient
and less invasive.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/


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


[Sugar-devel] Sugar Digest 2010-06-01

2010-06-01 Thread Walter Bender
==Sugar Digest==

1. [http://www.paraguayeduca.org/ Paraguay educa] team conducted a
two-week workshop on Sugar Activity development. It is great that
deployments are facilitating local Activity development—many of our
most popular activities have come from downstream, which is exactly as
it should be.

The Paraguay course was taught by Raúl Gutierrez, Bernie Innocenti,
Martin Abente, and Jorge Saldivar. They covered all the basics and
broke the students into project teams, which resulted in four new
activities: Scrabble, Pintando Fracciones, SugarBrain, and Conozco.
(The  detailed syllabus is available on their wiki
[http://wiki.paraguayeduca.org/index.php/Curso_Sugar_FPUNA].)

Raúl raised an interesting question on IRC (and subsequently in email
[http://lists.sugarlabs.org/archive/iaep/2010-May/010965.html]) about
issuing a certification participation in the class. It has been a goal
that as Sugar deployments expand, affiliates of Local Sugar Labs would
offer services. We have a mechanism for approving the creation of
local labs. Is that mechanism adequate, or should we have a separate
mechanism for approving the certifications they award? (As someone who
would be looking to hire a developer, it would be reassuring to know
that Sugar Labs has confidence in their skills. This would suggest
that their be a community-based process in place.)

In the case of Moodle, only selected "Moodle Partners" can officially
certify a developer's skills in Moodle-based e-learning. They have a
"rigorous and highly-regarded assessment programme developed by the
international Moodle community." We have no such rigorous Sugar
assessment program, but perhaps the Activity Team should develop one.
In the meantime, I am in favor of deferring to our local Sugar Labs.

2. Meanwhile, we have surpassed the 3-million-served mark on our
activity portal [http://activities.sugarlabs.org].

3. CeibalJam, a community-based group in Uruguay, which was recently
acknowledged by Ars Electronica, has made yet another contribution:
[http://sites.google.com/site/sugaractivities/jam], an advanced
multimedia player for Sugar. (See it in action on YouTube
[http://www.youtube.com/watch?v=VUpvN0ngsZw].)

Features include:

* multiple audio formats
* multiple video formats
* on-line radio
* on-line streaming video

4. Last week we announced Sugar-on-a-Stick Mirabelle. This week,
Thomas C Gilliard announced a revised Sugar-Creation-Kit DVD for
downloading for "sneakernet" and behind-firewall installs. From one
download [http://people.sugarlabs.org/Tgillard/Sugar-Creation-Kit-09.iso],
you have everything you need to locally build a complete environment
for Sugar. See 
http://people.sugarlabs.org/Tgillard/SugarCreationKit09-Contents.txt
for details.

5. Alas, I was unable to attend the recent Deployment Team meeting,
but Tabitha Roder took detailed notes
[http://lists.sugarlabs.org/archive/iaep/2010-May/010959.html]. It
reads like a great start to addressing the questions of how we build a
bridge between developers and deployments and between deployments
themselves. Thanks to all who attended and to Raul for organizing it.

===In the community===

6. Sugar will be represented at Linux Tag 2010 (June 9–12 in Berlin)
(See http://www.linuxtag.org/2010/).

7. Sugar World Cup 2010 will be held from 11 June to 11 July (See
http://wiki.suagrlabs.org/go/SugarWorldCup2010).

===Tech talk===

8. Aleksey Lim has been working on the Sugar 0install version of Open
Office for Kids. See [http://services.sugarlabs.org/ooo4kids/].

9. I added a few new features to the Abacus activity
[http://activities.sugarlabs.org/en-US/sugar/addon/4293], including a
binary abacus and an abacus that lets you add fractions, e.g.,
1/2+1/3+1/6.

===Sugar Labs===

Gary Martin has generated a SOM from the past week of discussion on
the IAEP mailing list (See
http://wiki.suagrlabs.org/go/File:2010-May-22-28-som.jpg).

Visit our planet [http://planet.sugarlabs.org] for more updates about
Sugar and Sugar deployments.

-walter
-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Please review code (was Re: Speak answering maths questions)

2010-06-01 Thread Rafael Enrique Ortiz Guerrero
This is great Tim,
this is one of the features that we would like to see on Speak for
some time now. I've heard these ideas by professors that we have been
working with in Bogotá, Colombia.



Rafael Ortiz



On Tue, Jun 1, 2010 at 5:52 AM, Tim McNamara
 wrote:
> Hi Chris, et al.
>
> ref http://pastebin.com/2XNCHGiy
>
> I am most of the way there, as you can see from lines 91 - 143. The function
> is attempting to return something that can be read out loud back to a child
> if they ask the Speak robot a mathematical question.
>
> My biggest question is the best way to import the functionality from the
> Calculate activity. As per silbe's comments on IRC, I'm leaning towards
> duplicating the two modules inside of the Speak activity.
>
> I guess I could implement my own parser, I thought about using the ast
> module. Then I realised that I would just make a poor replication of the
> parser & evaluator that's already been created.
>
> Thoughts/comments welcome.
>
> Tim
>
>
>
> On 30 May 2010 05:34, Chris Ball  wrote:
>>
>> Hi Tim,
>>
>> I'd suggest looking at the parsing logic in the Calculate activity --
>> it deals with the same problems.
>>
>> - Chris.
>> --
>> Chris Ball   
>> One Laptop Per Child
>
>
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Browse activity not working

2010-06-01 Thread Luke Faraone
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/01/2010 06:01 AM, John Samuel wrote:
> This is John here, I recently installed Sugar 0.88 Xephyr. I used the
> following code to install :
> 
> sudo add-apt-repository ppa:alsroot/trisquel-edu-3.5
> sudo apt-get update
> sudo apt-get install sugar-platform
> 
> 
> But when I try to run the Browse activity, I get the following error :
> 
> Browse failed to start.
> 
> I tried to run the Browse activity from the terminal and got the
> following error :
> 
> 
> r...@labadmin-desktop:/usr/share/sugar/activities/Browse.activity#
> python browser.py 
> Traceback (most recent call last):
>   File "browser.py", line 26, in 
> import hulahop
>   File "/usr/lib/pymodules/python2.6/hulahop/__init__.py", line 29, in
> 
> from hulahop._hulahop import shutdown
> ImportError: libxul.so : cannot open shared object
> file: No such file or directory
> r...@labadmin-desktop:/usr/share/sugar/activities/Browse.activity#

Unfortunately, Hulahop is broken in Ubuntu 10.04 LTS. We're currently
trying to find a way to fix that, but the way forward will probably be a
WebKit-based Browse.

Thanks,
Luke Faraone
http://luke.faraone.cc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkwFIYMACgkQtrC51grHAgZuRQCfWBsUcgvhfy6BXJFmGPfeHTB3
9UsAoK033ttykT71Ins16RVl1OVJ2n+r
=LES5
-END PGP SIGNATURE-
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Abacus-7

2010-06-01 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4293

Sugar Platform:
0.82 - 0.88

Download Now:
http://activities.sugarlabs.org/downloads/file/26926/abacus-7.xo

Release notes:
* Fixed problem with save/restore of fraction abacus
* Changed colors of fraction beads



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] Please review code

2010-06-01 Thread Chris Ball
Hi Tim,

   > I am most of the way there, as you can see from lines 91 -
   > 143. The function is attempting to return something that can be
   > read out loud back to a child if they ask the Speak robot a
   > mathematical question.

Looks good to me.

   > My biggest question is the best way to import the functionality
   > from the Calculate activity. As per silbe's comments on IRC, I'm
   > leaning towards duplicating the two modules inside of the Speak
   > activity.

Yes, duplication seems to be the best idea for now.

Thanks!

- Chris.
-- 
Chris Ball   
One Laptop Per Child
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Pop Quiz

2010-06-01 Thread ALEXANDER JONES (RIT Student)
Hey all,
 I'm on summer break and am planning on working a lot on the activity
Pop Quiz (http://wiki.sugarlabs.org/go/Pop_Quiz). My goal is to have it in a
functional state by the end of the summer. Please get in touch if you have
any questions/comments/concerns. There should be weekly updates for it
starting shortly.
  Alex (IRC:Boe08)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Please review code (was Re: Speak answering maths questions)

2010-06-01 Thread Tim McNamara
Hi Chris, et al.

ref http://pastebin.com/2XNCHGiy

I am most of the way there, as you can see from lines 91 - 143. The function
is attempting to return something that can be read out loud back to a child
if they ask the Speak robot a mathematical question.

My biggest question is the best way to import the functionality from the
Calculate activity. As per silbe's comments on IRC, I'm leaning towards
duplicating the two modules inside of the Speak activity.

I guess I could implement my own parser, I thought about using the ast
module. Then I realised that I would just make a poor replication of the
parser & evaluator that's already been created.

Thoughts/comments welcome.

Tim



On 30 May 2010 05:34, Chris Ball  wrote:

> Hi Tim,
>
> I'd suggest looking at the parsing logic in the Calculate activity --
> it deals with the same problems.
>
> - Chris.
> --
> Chris Ball   
> One Laptop Per Child
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Browse activity not working

2010-06-01 Thread John Samuel
This is John here, I recently installed Sugar 0.88 Xephyr. I used the following 
code to install : 

sudo add-apt-repository ppa:alsroot/trisquel-edu-3.5
sudo apt-get update
sudo apt-get install sugar-platform

But when I try to run the Browse activity, I get the following error :

Browse failed to start.

I tried to run the Browse activity from the terminal and got the following 
error : 


r...@labadmin-desktop:/usr/share/sugar/activities/Browse.activity# python 
browser.py
Traceback (most recent call last):
  File "browser.py", line 26, in 
    import hulahop
  File "/usr/lib/pymodules/python2.6/hulahop/__init__.py", line 29, in 
    from hulahop._hulahop import shutdown
ImportError: libxul.so: cannot open shared object
 file: No such file or directory
r...@labadmin-desktop:/usr/share/sugar/activities/Browse.activity# 


Kindly help

John Samuel


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


Re: [Sugar-devel] Paint: how can use keys?

2010-06-01 Thread Sascha Silbe
Excerpts from Tomeu Vizoso's message of Tue Jun 01 08:18:52 + 2010:
> On Tue, Jun 1, 2010 at 09:23, James Cameron  wrote:
> > If you need activity global events, consider accelerators.
> What about listening for those events on the top level window
> (Activity class) instead of the canvas? I think the journal is doing
> that, and I guess other activities as well.

Whatever you end up doing, please report back to the list. Terminal
has a similary issue (shortcuts not working while the VTE widget has
the focus).

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


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


Re: [Sugar-devel] Paint: how can use keys?

2010-06-01 Thread Tomeu Vizoso
On Tue, Jun 1, 2010 at 09:23, James Cameron  wrote:
> On Tue, Jun 01, 2010 at 12:47:10AM -0300, Gonzalo Odiard wrote:
>> I am trying to use the keys with the circles with diferent sizes to
>> change the size of the tool, but didn't see any event.
>> Can anybody help me?
>
> I've tried what you tried, and found that there were no events logged
> until focus was switched to the drawing area widget.
>
> For example, start Paint, focus is on "Stroke Color".  Press right-arrow
> key and focus moves to Pencil icon.  Press Tab once and focus will be on
> the toolbar tabs.  Again, and focus will move to the Area
> (gtk.DrawingArea) widget.
>
> Only with focus there are events seen by key_press.
>
> If you need activity global events, consider accelerators.

What about listening for those events on the top level window
(Activity class) instead of the canvas? I think the journal is doing
that, and I guess other activities as well.

Regards,

Tomeu

> --
> 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 mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] fix trivial typo in extension loading exception

2010-06-01 Thread Sascha Silbe
Excerpts from James Cameron's message of Tue Jun 01 01:27:02 + 2010:

> diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
> index 51d9820..0ec70d3 100644
> --- a/src/jarabe/controlpanel/gui.py
> +++ b/src/jarabe/controlpanel/gui.py
> @@ -259,7 +259,7 @@ class ControlPanel(gtk.Window):
>  keywords.append(item)
>  options[item]['keywords'] = keywords
>  else:
> -_logger.error('There is no CLASS constant specifieds 
> ' \
> +_logger.error('There is no CLASS constant specified 
> ' \
>'in the view file \'%s\'.' % item)
While you're at it, can you avoid the escaping by using different quotes
and replace "%" with "," (for consistency with our style guidelines - it
doesn't really make a difference in this particular case), please?

With or without that change:
Reviewed-By: Sascha Silbe 

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


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


Re: [Sugar-devel] Paint: how can use keys?

2010-06-01 Thread James Cameron
On Tue, Jun 01, 2010 at 12:47:10AM -0300, Gonzalo Odiard wrote:
> I am trying to use the keys with the circles with diferent sizes to
> change the size of the tool, but didn't see any event.
> Can anybody help me?

I've tried what you tried, and found that there were no events logged
until focus was switched to the drawing area widget.

For example, start Paint, focus is on "Stroke Color".  Press right-arrow
key and focus moves to Pencil icon.  Press Tab once and focus will be on
the toolbar tabs.  Again, and focus will move to the Area
(gtk.DrawingArea) widget.

Only with focus there are events seen by key_press.

If you need activity global events, consider accelerators.

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