Re: [Sugar-devel] creating your own templates in write activity

2009-07-20 Thread Manusheel Gupta
Tomeu,



On Sat, Jul 18, 2009 at 3:16 PM, Tomeu Vizoso to...@sugarlabs.org wrote:


 That sounds great, how do you plan to deploy it? Are you going to
 integrate your changes into the existing Write activity or will do a
 new one based on that?



We plan to integrate the changes into the existing Write activity.


Regards,

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


Re: [Sugar-devel] Gnash gtk+ widget support

2009-07-20 Thread Tomeu Vizoso
On Sun, Jul 19, 2009 at 22:53, Gary C Marting...@garycmartin.com wrote:
 Hi Tomeu,

 Given that gnash, with the correct gtk+ python support, is not going to be
 here officially until F12 (November), does that make your gnash gtk+ work as
 something more reasonable to push*** for in the Sugar 0.88 time-scale?

Why 0.88? F12 is supposed to ship both Sugar 0.86 and Gnash 0.8.6 (or
9 or whatever they call the next version). I think now is a good
moment to test Gnash-based activities on Strawberry with the Gnash
rpms I posted in the blog. Then, when Sugar 0.86 ships, all distros
with an updated Gnash will be able to run these activities without any
fuss.

 Hmmm, I guess that's actually more a distro question

Yeah, it's a distro question, but the upstream roadmaps seem to be
aligned so that distros can pick up this work in their next releases.

Regards,

Tomeu

 , if say a future SoaS
 or OLPC release decided to install custom gnash rpms, out side of the
 official Fedora release, then we could have support for your widget in a
 build with Sugar 0.86 (or even existing 0.84 using your set of rpms if it
 was considered essential for some specific content set).

 *** by push I mean creating/porting some Flash Activities (other than
 demonstrators - BTW if the eatboom swf really can't be fixed, I'd be happy
 to re-code the game from scratch, would only take me a day or so at most,
 that would be a fallback position if you just wanted a known working Flash
 sample for other developers).

 Regards,
 --Gary


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


Re: [Sugar-devel] Language control panel broken: Chinese + Russian displayed

2009-07-20 Thread Edward Cherlin
On Sat, Jul 18, 2009 at 2:58 AM, Tomeu Vizosoto...@sugarlabs.org wrote:
 On Sat, Jul 18, 2009 at 01:54, Edward Cherlinecher...@gmail.com wrote:
 There are serious bugs in language switching in My Settings (the Sugar
 Control Panel).

 Would be better to track each of these issues in individual tickets at
 dev.sugarlabs.org.

I filed four separate bugs on Language setting issues.

#1080   My Settings: Language setting does not always take
#1081   Mixed languages in Sugar UI 
#1082   Control Panel/Language: Add button not available in English
#1083   Control Panel/Language: Cannot set to current selection on
multiple menus.

-- 
Silent Thunder (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) is my name
And Children are my nation.
The Cosmos is my dwelling place, The Truth my destination.
http://earthtreasury.org/worknet (Edward Mokurai Cherlin)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] proper use of self.set_canvas function

2009-07-20 Thread sumit singh
Hi Jim,

Thanx a lot for your reply. Well, right now I am planning to do that by
using a gtk.notebook without tabs and borders, though I would be firstly
testing how it would look.

The idea you suggests seems to be good and I had a look at the screen shots,
they really look nice. In case the notebook thing doesn't give me the
desired looks, will be switching over to this idea.

Regards,
SUMIT

On Mon, Jul 20, 2009 at 5:21 AM, Jim Simmons nices...@gmail.com wrote:

 Sumit,

 I don't see anything wrong with what you are proposing.  Another
 option you have, not necessarily better, is to define a VBox holding
 the two different views of your Activity: the one where the game is
 played and the one where you set up options.  By hiding one and
 showing the other you can switch from one view to the other.  I do
 something like this in all three of my Activities (Read Etexts, View
 Slides, Get Internet Archive Books) where I divide the screen
 vertically in half for some functions.  See the screenshots on ASLO to
 see what I'm talking about.  I like how this works and looks.  Your
 mileage may vary.

 James Simmons

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


[Sugar-devel] help about the get_preview function of activity.Activity class to take screenshots

2009-07-20 Thread sumit singh
Hi everyone,

Can anyone please guide me about the proper use of the get_preview function
of the activity.Activity class of sugar. I had a look at its api, it seems
to be returning a dictionary sort of thing which is called as the png image.
What I want to do is to save this image somewhere in the datastore and show
this image later to the user in my activity. So, what I want to ask is to
how to load this information in the form of an image later on
programatically. Can we load it using the gtk.image widget and what is the
right procedure to save this information.

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


Re: [Sugar-devel] help about the get_preview function of activity.Activity class to take screenshots

2009-07-20 Thread Martin Sevior
Hi Sumit,

I just fixed the example code in the pyabiword module of abiword to
give an example
of how this works.

The important line in this example is:

 i.props.pixbuf = abi.render_page_to_image(1)

The converts page number 1 to a GdkPixbuf. Once you have a GdkPixbuf,
in this case in
a Gtk.Image you can convert it to whatever format you wish.

From the PyGtk reference manual http://www.pygtk.org/docs/pygtk/
 you convert  this to an image with:

http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--save

So if you wanted the GdkPixbuf directly you would do:

PagePixbuf = abi.render_page_to_image(1)
PagePixbuf.save(filename,png)

Where filename is the name of the file you wish to store to.

Cheers!

Martin

PS. here is test.py which shows the feature in action (thanks for the
patch tomeu!)

--
#!/usr/bin/python

import sys
import pygtk
pygtk.require('2.0')
import gtk
import abiword

window = gtk.Window()
window.set_default_size(640, 480)
window.connect('delete-event', gtk.main_quit)

box = gtk.VBox()
window.add(box)
box.show()

abi = abiword.Canvas()
box.add(abi)
abi.show()

window.show()

b = gtk.Button('render page')
box.add(b)
b.show()

i = gtk.Image()
box.add(i)
i.show()

def _clicked_cb(widget, abi, i):
i.props.pixbuf = abi.render_page_to_image(1)

b.connect('clicked', lambda widget: _clicked_cb(widget, abi, i))

gtk.main()


On Mon, Jul 20, 2009 at 10:43 PM, sumit singhsumit.co...@gmail.com wrote:
 Hi everyone,

 Can anyone please guide me about the proper use of the get_preview function
 of the activity.Activity class of sugar. I had a look at its api, it seems
 to be returning a dictionary sort of thing which is called as the png image.
 What I want to do is to save this image somewhere in the datastore and show
 this image later to the user in my activity. So, what I want to ask is to
 how to load this information in the form of an image later on
 programatically. Can we load it using the gtk.image widget and what is the
 right procedure to save this information.

 Regards,
 sumit

 ___
 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] proper use of self.set_canvas function

2009-07-20 Thread Tomeu Vizoso
On Mon, Jul 20, 2009 at 14:31, sumit singhsumit.co...@gmail.com wrote:
 Hi Jim,

 Thanx a lot for your reply. Well, right now I am planning to do that by
 using a gtk.notebook without tabs and borders, though I would be firstly
 testing how it would look.

 The idea you suggests seems to be good and I had a look at the screen shots,
 they really look nice. In case the notebook thing doesn't give me the
 desired looks, will be switching over to this idea.

I think Jim's suggestion is good, I would say you should use whatever
is easier to you.

Regards,

Tomeu

 Regards,
 SUMIT

 On Mon, Jul 20, 2009 at 5:21 AM, Jim Simmons nices...@gmail.com wrote:

 Sumit,

 I don't see anything wrong with what you are proposing.  Another
 option you have, not necessarily better, is to define a VBox holding
 the two different views of your Activity: the one where the game is
 played and the one where you set up options.  By hiding one and
 showing the other you can switch from one view to the other.  I do
 something like this in all three of my Activities (Read Etexts, View
 Slides, Get Internet Archive Books) where I divide the screen
 vertically in half for some functions.  See the screenshots on ASLO to
 see what I'm talking about.  I like how this works and looks.  Your
 mileage may vary.

 James Simmons


 ___
 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


[Sugar-devel] Test the POSSE Education Fedora Remix today!

2009-07-20 Thread Sebastian Dziallas
=== Test the POSSE Education Fedora Remix today! ===

Have you ever wanted to contribute - or get others to contribute - to an 
open source education project, but never found the time to set up and 
get started? We've got a ready-to-go contributors' (not just code!) 
environment for you.

The Fedora Education SIG (http://fedoraproject.org/wiki/Education_SIG) 
announces today in cooperation with POSSE 
(http://teachingopensource.org/index.php/POSSE_2009), a Red Hat 
sponsored summer program to introduce professors to the open source way 
of development, the release of the POSSE Education remix. The remix will 
be deployed immediately to the professors at POSSE and has been 
developed with the purpose of creating a ready-to-go development 
environment for contributing to educational projects inside, but also 
outside of the Fedora ecosystem in mind. It contains development 
environments, tools, documentation, and getting-started resources for 
contributing to a number of projects including Fedora, Mozilla, Sugar 
Labs and KDE Education and can be used by individuals or by teachers, 
students, and classrooms that want to contribute to open source projects 
as part of their course effort.

The download is directly available, together with the SHA-1 checksum, 
over HTTP from here:

http://alt.fedoraproject.org/pub/alt/remixes/POSSE/POSSE-Education-1.iso

391a0170e09e68142cbe2c95b62b2b0c6fa628d5  POSSE-Education-1.iso

Being based on the latest Fedora release, this remix provides users with 
a stable environment with supplemental features, such as:

* an easy starting point into educational open source projects by 
providing pre-selected bookmarks and related IRC channels

* the Sugar Platform (http://www.sugarlabs.org), as seen on the OLPC
- as of 2009/07/15, all required dependencies for building 
sugar-jhbuild, a way of pulling and running the latest sugar bits, are 
included

* a number of educational applications, such as the KDE Education 
Packages (http://edu.kde.org) or software for numerical operations
- a Moodle session (http://www.moodle.org) to showcase an open source 
learning management system

* a whole development environment including gcc, python and more, as 
well as Fedora's packaging tools
- the Eclipse environment with plugins for Python and RPM, but also 
LaTeX and documentation purposes

A getting started guide is also available and contains instructions for 
various applications and communities: 
https://fedorahosted.org/education/wiki/GetStarted

If you are interested in getting in touch with the developers, other 
users or would just like to submit feedback, please join our mailing 
list here: http://www.redhat.com/mailman/listinfo/fedora-education-list. 
If you are interested in using this for your own development or in your 
classroom, or have an open source education project you'd like to see 
included in the next version, please let us know and we'll get you started.

If you report bugs in bugzilla, please make sure to make them depend on 
our tracker: http://bugzilla.redhat.com/show_bug.cgi?id=EducationTracker

Thanks,
Sebastian Dziallas for the Education SIG
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] running surf on the XO

2009-07-20 Thread Bryan Berry
Christoph, 

u will have to load the packages pywebkitgtk and
webkitgtk in order to run surf

per this email

http://lists.sugarlabs.org/archive/sugar-devel/2009-June/015402.html



-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org

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


Re: [Sugar-devel] Physics activity (Was: Release v3 tonight?)

2009-07-20 Thread Gary C Martin
Hi Asaf,

On 20 Jul 2009, at 06:16, Asaf Paris Mandoki wrote:

 Hi,
 Thanks for the feedback. The save/load functionality is ready and I'll
 be committing soon to elements.

:-)

 Brian: What is the status of the library handling? I'll have to update
 elements after I commit to enable the new functions and commit

 BTW, the pickling function I added to elements was almost copy n'
 paste from the pybox2d testbed. I'm new to python but I think there is
 something that is not finished or maybe it wasn't cleaned up about the
 additional_vars in the pickle_load function. I'm not sure if that
 argument should be removed.

When I'm doing my testing on your commits, I'll try and take a look  
and see.

 I also have other modification suggestions that I wanted to run by you
 before creating the tickets.

 1. It IS possible to pin/link objects to the background (It just needs
 a 2 line hack). Should we enable this feature?

By background, I'm assuming you mean the current solid ground. I tried  
to link some contraptions to the ground to act as foundations, though  
just pinning them to the background is a fine work around. Happy to  
see the feature enabled if it seems safe to you, it might enable some  
more possibilities if we add the option of different world  
environments (solid ground only, no ground, closed box), e.g. in a  
closed box environment kids might want to link objects hanging from  
the ceiling.

 2. Modify the polygon tool icon. I suggest changing it for an
 irregular polygon. The icon gives the idea of a different behavior.

Sure, seems like a good change (assign ticket to me if you want).

 3. Modify the grab tool icon. Maybe put a hand shape. The current icon
 is not really descriptive.

Sure, seems like a good change (assign ticket to me if you want).

 4. Make the Play/Stop button more conspicuous, maybe change its  
 color(s).

Not so hot on this one :-) It breaks the Sugar design guidelines  
(colour represents user identity). Now I know Walter has quite  
seriously gone and broken these guidelines with some of his  
technicolor tool icons in TurtleArt... The shock, the horror... But  
not sure we should continue that slide in Sugar guideline standards ;-)

Pro: Yes, black and white for Stop, and colour for Play is quite  
visually effective.

Con: Once we start to creep into colour tool icons they'll start  
appearing all over the place and the collaboration colour == identity  
metaphor will start to break down. The high contrast silhouette of  
icon shapes is a strong component and differentiator of the Sugar UI  
design.

The current 'Play' and 'Stop' icons are from the standard Sugar  
artwork set, perhaps we should just improve them. I was never  
completely keen on both their silhouette shapes being round, or  
perhaps it would be enough for the fill/stroke to be inverted between  
stop  play shapes?

Eben: maybe there is some design middle ground for having some tool  
icon colour in the HIG? Perhaps with a strict specification, say like  
a single colour (different brightness allowed) may be used in addition  
to white  transparent, but only for toggle or radio buttons to  
indicate important active vs inactive states? But I'm not convinced.  
It feels like an erosion of a strong design principle.

Regards,
--Gary

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


Re: [Sugar-devel] running surf on the XO

2009-07-20 Thread Bryan Berry
there is actually a bit more to it

sudo yum install pywebkitgtk WebKit-gtk gnome-python2-gconf

from NOTES in the surf bundle

On Mon, 2009-07-20 at 21:12 +0545, Bryan Berry wrote:
 Christoph, 
 
 u will have to load the packages pywebkitgtk and
 webkitgtk in order to run surf
 
 per this email
 
 http://lists.sugarlabs.org/archive/sugar-devel/2009-June/015402.html
 
 
 
-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org

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


[Sugar-devel] Correct use of leading underscores in Python?

2009-07-20 Thread Jim Simmons
I don't want to start a religious war here, but I could use some
guidance.  In writing my Activities I have often copied and pasted
bits of code from other Activities.  For instance, the toolbars from
Read and Speak.  As a result of this I have code in which leading
underscores are used in both variable names and method names, with no
particular rhyme or reason for it.  I want my code to follow good
practices, but the only thing I've found which talks about leading
underscores in Python is the PEP 8 style guide, which says:

In addition, the following special forms using leading or trailing
underscores are recognized (these can generally be combined with any
case convention):

- _single_leading_underscore: weak internal use indicator.  E.g.
from M import * does not import objects whose name starts with an
underscore.

and also

Use one leading underscore only for non-public methods and instance variables.

None of the leading underscores in my code seem to be for these reasons.

So when do you use leading underscores to name something?  Or do you
ever use them?

Thanks,

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


Re: [Sugar-devel] Correct use of leading underscores in Python?

2009-07-20 Thread Tomeu Vizoso
On Mon, Jul 20, 2009 at 17:59, Jim Simmonsnices...@gmail.com wrote:
 I don't want to start a religious war here, but I could use some
 guidance.  In writing my Activities I have often copied and pasted
 bits of code from other Activities.  For instance, the toolbars from
 Read and Speak.  As a result of this I have code in which leading
 underscores are used in both variable names and method names, with no
 particular rhyme or reason for it.  I want my code to follow good
 practices, but the only thing I've found which talks about leading
 underscores in Python is the PEP 8 style guide, which says:

 In addition, the following special forms using leading or trailing
 underscores are recognized (these can generally be combined with any
 case convention):

 - _single_leading_underscore: weak internal use indicator.  E.g.
 from M import * does not import objects whose name starts with an
 underscore.

 and also

 Use one leading underscore only for non-public methods and instance 
 variables.

 None of the leading underscores in my code seem to be for these reasons.

 So when do you use leading underscores to name something?  Or do you
 ever use them?

All code in Sucrose has to follow these rules, if they don't, they are
in violation of the law. But modules out of Sucrose follow their own
rules.

In more practical terms, when you code a class, by using a leading
underscore or not you are defining its public API. And if you use
another class and use methods or variables with a leading underscore,
you are using private API that is more bound to be broken in
subsequent releases.

Also, by defining what is public and what is private, you are making a
clear distinction between the what and the how, which helps greatly in
readability and general maintainability.

Regards,

Tomeu

 Thanks,

 James Simmons
 ___
 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


[Sugar-devel] Physics activity Play/Stop

2009-07-20 Thread Frederick Grose
On Mon, Jul 20, 2009 at 11:33 AM, Gary C Martin g...@garycmartin.comwrote:

 Hi Asaf,

 On 20 Jul 2009, at 06:16, Asaf Paris Mandoki wrote:
 ...

  4. Make the Play/Stop button more conspicuous, maybe change its
  color(s).

 Not so hot on this one :-) It breaks the Sugar design guidelines
 (colour represents user identity). Now I know Walter has quite
 seriously gone and broken these guidelines with some of his
 technicolor tool icons in TurtleArt... The shock, the horror... But
 not sure we should continue that slide in Sugar guideline standards ;-)

 Pro: Yes, black and white for Stop, and colour for Play is quite
 visually effective.

 Con: Once we start to creep into colour tool icons they'll start
 appearing all over the place and the collaboration colour == identity
 metaphor will start to break down. The high contrast silhouette of
 icon shapes is a strong component and differentiator of the Sugar UI
 design.

 The current 'Play' and 'Stop' icons are from the standard Sugar
 artwork set, perhaps we should just improve them. I was never
 completely keen on both their silhouette shapes being round, or
 perhaps it would be enough for the fill/stroke to be inverted between
 stop  play shapes?

 Eben: maybe there is some design middle ground for having some tool
 icon colour in the HIG? Perhaps with a strict specification, say like
 a single colour (different brightness allowed) may be used in addition
 to white  transparent, but only for toggle or radio buttons to
 indicate important active vs inactive states? But I'm not convinced.
 It feels like an erosion of a strong design principle.


Perhaps, anticipating future collaboration of Physics models, the Play/Stop
toggle could bear the color of the invoker.  This would provide some
additional information on who started or stopped the model.

(The toggles are labeled Start/Stop.  Play fits the graphic better;
Pause--with the player control graphics--may be appropriate and distinguish
it from the Activity Stop button label.)
 --Fred
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Correct use of leading underscores in Python?

2009-07-20 Thread Jim Simmons
Tomeu,

Your answer makes sense.  I'm creating another release of Read Etexts
and I'll try to rename everything consistent with those principles as
part of that, and eventually will do the same for my other Activities.

Thanks,

James Simmons

On Mon, Jul 20, 2009 at 11:23 AM, Tomeu Vizosoto...@sugarlabs.org wrote:
 On Mon, Jul 20, 2009 at 17:59, Jim Simmonsnices...@gmail.com wrote:
 I don't want to start a religious war here, but I could use some
 guidance.  In writing my Activities I have often copied and pasted
 bits of code from other Activities.  For instance, the toolbars from
 Read and Speak.  As a result of this I have code in which leading
 underscores are used in both variable names and method names, with no
 particular rhyme or reason for it.  I want my code to follow good
 practices, but the only thing I've found which talks about leading
 underscores in Python is the PEP 8 style guide, which says:

 In addition, the following special forms using leading or trailing
 underscores are recognized (these can generally be combined with any
 case convention):

 - _single_leading_underscore: weak internal use indicator.  E.g.
 from M import * does not import objects whose name starts with an
 underscore.

 and also

 Use one leading underscore only for non-public methods and instance 
 variables.

 None of the leading underscores in my code seem to be for these reasons.

 So when do you use leading underscores to name something?  Or do you
 ever use them?

 All code in Sucrose has to follow these rules, if they don't, they are
 in violation of the law. But modules out of Sucrose follow their own
 rules.

 In more practical terms, when you code a class, by using a leading
 underscore or not you are defining its public API. And if you use
 another class and use methods or variables with a leading underscore,
 you are using private API that is more bound to be broken in
 subsequent releases.

 Also, by defining what is public and what is private, you are making a
 clear distinction between the what and the how, which helps greatly in
 readability and general maintainability.

 Regards,

 Tomeu

 Thanks,

 James Simmons
 ___
 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] proper use of self.set_canvas function

2009-07-20 Thread sumit singh
Hi Tomeu,

First of all thanx a lot for all the help you have provided. Yes, I think
Jim's idea is good. Thanx Jim again. However, right now I am going with a
notebook, I tried to implement it and it seems to be working fine and the
looks are just like those with a hbox. .

Regards,
sumit

On Mon, Jul 20, 2009 at 7:23 PM, Tomeu Vizoso to...@sugarlabs.org wrote:

 On Mon, Jul 20, 2009 at 14:31, sumit singhsumit.co...@gmail.com wrote:
  Hi Jim,
 
  Thanx a lot for your reply. Well, right now I am planning to do that by
  using a gtk.notebook without tabs and borders, though I would be firstly
  testing how it would look.
 
  The idea you suggests seems to be good and I had a look at the screen
 shots,
  they really look nice. In case the notebook thing doesn't give me the
  desired looks, will be switching over to this idea.

 I think Jim's suggestion is good, I would say you should use whatever
 is easier to you.

 Regards,

 Tomeu

  Regards,
  SUMIT

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


[Sugar-devel] [RELEASE] Turtle Art-56

2009-07-20 Thread Sugar Labs Activities
Url:
http://activities.sugarlabs.org/addon/4027

Release notes:
http://activities.sugarlabs.org/addon/4027#release-notes

Reviewer comments:
Trusted activity

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-bundle-updater code review

2009-07-20 Thread David Farning
The sugar bundle updater is ready for another round of code review.
For this round I am mostly interested in making sure that the code is
following current Glucose standard.
http://git.sugarlabs.org/projects/sugar-update-control/repos/aslo-clone

Notes for this release:
Separated out server specific routines in to 'back-ends' to allow
greater modularity and flexibility. (microformat is still broken as of
this release)
Adopted code to current glucose coding standards.
Replaced bundle relate dependencies on bitfrost with bundle_registry.
Shifted from 'Activity' updater to 'bundle' updater to build on the
maturing library bundles.

In process:
Build in automatic server fallback logic - I want to clean up the
current program clarity before adding a layer of complexity
Add group updates back - I want to under stand more about aslo
collections in order to make make the group and collection code paths
compatible.

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


Re: [Sugar-devel] Correct use of leading underscores in Python?

2009-07-20 Thread Martin Dengler
On Mon, Jul 20, 2009 at 10:59:05AM -0500, Jim Simmons wrote:
 I don't want to start a religious war here, but I could use some
 guidance.  In writing my Activities I have often copied and pasted
 bits of code from other Activities.  For instance, the toolbars from
 Read and Speak.  As a result of this I have code in which leading
 underscores are used in both variable names and method names, with no
 particular rhyme or reason for it.  I want my code to follow good
 practices, but the only thing I've found which talks about leading
 underscores in Python is the PEP 8 style guide, which says:
 
 In addition, the following special forms using leading or trailing
 underscores are recognized (these can generally be combined with any
 case convention):
 
 - _single_leading_underscore: weak internal use indicator.  E.g.
 from M import * does not import objects whose name starts with an
 underscore.

Did you miss the following points on double leading underscores?

- __double_leading_underscore: when naming a class attribute,
  invokes name
  mangling (inside class FooBar, __boo becomes _FooBar__boo; see
  below).

- __double_leading_and_trailing_underscore__: magic objects or
  attributes that live in user-controlled namespaces.
  E.g. __init__,
  __import__ or __file__.  Never invent such names; only use them
  as documented.

IMO: 

- one leading underscore is private (weak internal use) or, in
  the context of inheritance, like java's protected (private to a
  class and its subclasses but can be / is expected to be overridden).

- two leading underscores is extra private (strong internal use)
  or, in the context of inheritance, like java's private (private to
  a class and not visible to subclasses without good,
  you-better-know-why-you're-thumbing-your-nose-at-name-mangling
  reasons).

 So when do you use leading underscores to name something?  Or do you
 ever use them?

They're used a lot by python code.  One should almost certainly be
using them in code that's used by other code.

 Thanks,
 
 James Simmons

Martin


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


Re: [Sugar-devel] Localization of activity with ColorSelectionDialog

2009-07-20 Thread Aleksey Lim
On Mon, Jul 20, 2009 at 10:54:28AM +0300, Xenofon Papadopoulos wrote:
 Hello, I 'm using a gtk.ColorSelectionDialog in my activity, and whenever I
 run it all the text is in English, ignoring my Greek language settings.
 Apart from this, localization of my application works fine. How can I
 enforce Greek text on the ColorSelectionDialog?
 Thanks

ColorSelectionDialog is a part of gtk, so you need to install proper
i18n package.

But I guess the best option is using sugarized color picker[1]
form sugar.graphics.colorbutton module (you can find example in Write
activity[2]).

[1] http://wiki.sugarlabs.org/go/File:ColorToolButton.png
[2] 
http://git.sugarlabs.org/projects/write/repos/mainline/blobs/master/toolbar.py

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


Re: [Sugar-devel] help about the get_preview function of activity.Activity class to take screenshots

2009-07-20 Thread sumit singh
Martin and Tomeu,

Martin, thanx a lot for such a detailed answer. I have got what you want to
say. But the problem with me right now is that I think the get_preview
function is available only in the latest release of sugar 0.84 because I am
on 0.82, and my xo gives an error --  Activity module does not have an
attribute get_preview . Is it so that the function has been added after
0.82 ? If yes, then is there any way on 0.82 build to take screenshots
programatically.

There is one strange thing which I am encountering right now. Though the log
gives an error that get_preview function is not present but when I ran write
63.xo on the machine ( after replacing sugar.graphics.colorbutton with
gtk.colorButton  in toolbar.py ) , closed it and then again tried to restart
the activity from the journal , I was able to see the following preview
which I am attaching with this mail, that was what was there on my activity
screen before I closed it.

Though I am not very much sure, but this should have happened because of the
save function in activity.Activity class , here is the link-
http://api.sugarlabs.org/sugar.activity.activity-pysrc.html , which calls
the get_preview function of sugar, which is a bit contradictory, if we
consider the result of the logs. Am I wrong in the way I am understanding
this? Kindly give your comments.

Regards,
sumit.






On Mon, Jul 20, 2009 at 6:58 PM, Martin Sevior msev...@gmail.com wrote:

 Hi Sumit,

 I just fixed the example code in the pyabiword module of abiword to
 give an example
 of how this works.

 The important line in this example is:

  i.props.pixbuf = abi.render_page_to_image(1)

 The converts page number 1 to a GdkPixbuf. Once you have a GdkPixbuf,
 in this case in
 a Gtk.Image you can convert it to whatever format you wish.

 From the PyGtk reference manual http://www.pygtk.org/docs/pygtk/
  you convert  this to an image with:

 http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--save

 So if you wanted the GdkPixbuf directly you would do:

 PagePixbuf = abi.render_page_to_image(1)
 PagePixbuf.save(filename,png)

 Where filename is the name of the file you wish to store to.

 Cheers!

 Martin

 PS. here is test.py which shows the feature in action (thanks for the
 patch tomeu!)

 --
 #!/usr/bin/python

 import sys
 import pygtk
 pygtk.require('2.0')
 import gtk
 import abiword

 window = gtk.Window()
 window.set_default_size(640, 480)
 window.connect('delete-event', gtk.main_quit)

 box = gtk.VBox()
 window.add(box)
 box.show()

 abi = abiword.Canvas()
 box.add(abi)
 abi.show()

 window.show()

 b = gtk.Button('render page')
 box.add(b)
 b.show()

 i = gtk.Image()
 box.add(i)
 i.show()

 def _clicked_cb(widget, abi, i):
i.props.pixbuf = abi.render_page_to_image(1)

 b.connect('clicked', lambda widget: _clicked_cb(widget, abi, i))

 gtk.main()
 

 On Mon, Jul 20, 2009 at 10:43 PM, sumit singhsumit.co...@gmail.com
 wrote:
  Hi everyone,
 
  Can anyone please guide me about the proper use of the get_preview
 function
  of the activity.Activity class of sugar. I had a look at its api, it
 seems
  to be returning a dictionary sort of thing which is called as the png
 image.
  What I want to do is to save this image somewhere in the datastore and
 show
  this image later to the user in my activity. So, what I want to ask is to
  how to load this information in the form of an image later on
  programatically. Can we load it using the gtk.image widget and what is
 the
  right procedure to save this information.
 
  Regards,
  sumit
 
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 

attachment: preview image.png___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] need a better name for starting page of karma than MenuStage

2009-07-20 Thread Bryan Berry
what should we call menustage? it is a horrible name. it is just not
descriptive:

http://www.pustakalaya.org/external-content/static/epaath/MenuStage.html

I don't want to call it the frame because that word already has a
meaning w/in sugar.

i also don't want to call it anything w/ a religious connotation since
karma is named after Rabi _karma_charya and not for the religious
concept.

Words that come to mind are

mandala -- which literally means circle in Nepali but sometimes has a
religious connotation (ugh)
dhoka -- this means gate in Nepali. I like dhoka but everyone outside
of Nepal will mispell it

I  like mandala the best so far . . .


-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org

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


[Sugar-devel] amRe: [Cs-dev] Sugar on a Stick - and OLPCsound/Csound

2009-07-20 Thread Art Hunkins
Hello, Peter et al. -

Your latest Csound5.10 patch finally made it out to updates-testing today, 
and I was able to install it on SoaS (Sugar 84) and test it out.

Unfortunately it aborts with much the same (if not exactly) as before. Log:

/usr/lib/python2.6/site-packages/sugar/util.py:25: DeprecationWarning: the 
sha module is deprecated; use the hashlib module instead

import sha

Traceback (most recent call last):

File /usr/bin/sugar-activity, line 21, in module

main.main()

File /usr/lib/python2.6/site-packages/sugar/activity/main.py, line 105, in 
main

module = __import__(module_name)

File /home/liveuser/Activities/OurMusic.activity/ourmusic.py, line 42, in 
module

import csndsugui

File /home/liveuser/Activities/OurMusic.activity/csndsugui.py, line 36, in 
module

import csnd

File /usr/lib/python2.6/site-packages/csnd.py, line 7, in module

import _csnd

ImportError: /usr/lib/libcsnd.so.5.1: undefined symbol: csoundGetInputBuffer



Observations: /usr/lib/ contains libcsound.so.5.1 and 5.2, but only 
libcsnd.so.5.1. (I've no idea if this is significant or not.) I note that 
Sugar 82 - designed for 5.08 - (at least on my OLPC) contains none of these 
files.

TamTamMini plays fine on both 82 and 84; of course it only plays samples.

TamTamSynthLab seems to work fine with 82 (no errors), but not in 84 - where 
the log shows a multitude of .so files incompatible with Csound5.10 (stated 
as 2.0 and 1.6??). And, following that, an even larger list of illegal 
opcodes and errors.

If I were to guess something, it would be this: is perhaps libcsnd.so.5.2 
required for Csound5.10?

Needless to say, I'd sure like this to work. Thanks, as always, for any and 
all insights.

Art Hunkins

- Original Message - 
From: Peter Robinson pbrobin...@gmail.com
To: Art Hunkins abhun...@uncg.edu
Cc: sugar-devel@lists.sugarlabs.org; csound-de...@lists.sourceforge.net
Sent: Thursday, July 16, 2009 7:43 AM
Subject: Re: [Sugar-devel] [Cs-dev] Sugar on a Stick - and OLPCsound/Csound


 Hi All,

 I've tested and applied the patch to F11 and pushed it out as a
 updates-testing. Please test.
 https://admin.fedoraproject.org/updates/csound-5.10.1-9.fc11

 Or if your too impatient to wait for the updates-testing push you can
 grab the rpms from koji directly
 http://koji.fedoraproject.org/koji/buildinfo?buildID=114648

 Peter

 On Mon, Jul 13, 2009 at 4:03 PM, Art Hunkinsabhun...@uncg.edu wrote:
 Aleksey,

 Thanks for undertaking this task.

 Please let me know when the revised build of Csound5.10 is available for
 update on SoaS. I'm eager to be assured that it solves the compatibility
 issue with python 2.6.

 Art Hunkins

 - Original Message -
 From: Aleksey Lim alsr...@member.fsf.org
 To: Art Hunkins abhun...@uncg.edu
 Cc: Michael Gogins michael.gog...@gmail.com;
 sugar-devel@lists.sugarlabs.org
 Sent: Monday, July 13, 2009 12:02 AM
 Subject: Re: [Sugar-devel] [Cs-dev] Sugar on a Stick - and 
 OLPCsound/Csound


 On Sun, Jul 12, 2009 at 03:19:31PM -0400, Art Hunkins wrote:
 Mike Gogins, a Csound developer, has taken care of the Scons issue with
 Csound5.10, as discussed below.

 I'd be overjoyed if one of you Sugar developers could take it from 
 there
 so
 that we can have SoaS with a Csound that works with python2.6.

 I can build rpm for soas env. but I'm waiting for fixing my problems 
 with
 ISP
 so, I can't do it in nearest few days.

 Just an option, using Mandriva of Suse ;)

 --
 Aleksey

 ___
 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 

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


[Sugar-devel] Planning for Weds - Tux Paint, Conozco Uruguay, Memorize with Speak

2009-07-20 Thread Caroline Meeks
Hi,
I'm doing lesson planning for Weds, the 3rd graders. They are the ones who
would test out these three activites.

I want to check in on the current status I think it is:


   1. Tux Paint - Waiting for it to save to the Journal before we let the
   kids use it
   2. Conozco Uruguay - Waiting for a version that fits different sized
   screens
   3. Memorize with Speak - crashes when you try to use Speak.

thanks,
Caroline
-- 
Caroline Meeks
Solution Grove
carol...@solutiongrove.com

617-500-3488 - Office
505-213-3268 - Fax
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] activity.info hosts

2009-07-20 Thread Christoph Derndorfer
Hi all,

I was wondering whether there were any plans to make use of the hosts
variable in the activity.info files to determine whether an activity runs on
the specific Sugar installation.

With 0.86 being on the horizont, 0.84 being used on SoaS, 0.82 being widely
used among the G1G1 community and some deployments and many deployment still
using pre-0.82 software I think the issue of activity compatibility deserves
some serious attention. Otherwise this has the potential to create _a lot
of_ confusion and frustration further down the road.

Not sure what the original plans wrt the technical implemention of this
feature were but I would assume the harder part of solving this problem is
spreading the word among activity developers to update their .xo bundles
accordingly.

Cheers,
Christoph

-- 
Christoph Derndorfer
co-editor, olpcnews
url: www.olpcnews.com
e-mail: christ...@olpcnews.com
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel