Re: [sugar] Sugar on Ubuntu Intrepid broken

2008-11-27 Thread Erik Blankinship
Perhaps address how Activity authors might need to handle / work
around the different distro specifics on one page, unless the goal is
to have different activity releases per distro.


On 11/27/08, Walter Bender [EMAIL PROTECTED] wrote:
 I think the distro-specific issues should be delegated to the
 individual distro pages. The Supported Systems page is a bit of a
 tangle right now. Anyone have time to do a reorg?

 -walter

 On Thu, Nov 27, 2008 at 4:09 AM, Morgan Collett
 [EMAIL PROTECTED] wrote:
 On Thu, Nov 27, 2008 at 02:06, Edward Cherlin [EMAIL PROTECTED] wrote:
 On Wed, Nov 26, 2008 at 2:33 PM, Luke Faraone [EMAIL PROTECTED] wrote:
 On Wed, Nov 26, 2008 at 17:07, Edward Cherlin [EMAIL PROTECTED]
 wrote:

 [EMAIL PROTECTED]:~$ sugar-emulator
 Traceback (most recent call last):
  File /usr/bin/sugar-emulator, line 22, in module
from emulator import main
  File /usr/share/sugar/shell/emulator.py, line 31, in module
from sugar import env
 ImportError: No module named sugar

 Edward, this is not a Sugar problem, please ask about it on the
 sugar-ubuntu
 mailing list.

 We need a Wiki page with a detailed statement of which bugs and
 support questions go on which lists. I think that the current setup
 works fine for the developers working in each of the projects
 involved, but is hopeless for others, especially newcomers.

 I agree. I'm not sure where such a page should go - on the supported
 systems page? On the page for each distro?

 The plan for Ubuntu is that you should log bugs in the Ubuntu
 bugtracker, https://launchpad.net - for example,
 https://bugs.launchpad.net/ubuntu/+source/sugar for Sugar itself.
 Please log your issue there so we can track it.

 In any case, how did you install sugar, exactly? It works fine for me on
 a
 fresh intrepid install.

 I had Sugar installed, and I upgraded to Intrepid. There was one
 dependency error that required me to do a manual package installation,
 replacing sugar-datastore with python-olpc-datastore, IIRC.

 That is a known issue which still needs fixing, ubuntu-sugarteam...

 Regards
 Morgan
 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar




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

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Announce: Screencast activity.

2008-10-17 Thread Erik Blankinship
We wrote a screencasting library a while back.  It might be useful to
whoever shepherds this type of library to compare implementations. Here is
what the sample activity does with the library:

   - Click to start recording a screencast.
   - Type something witty that you want recorded.
   - Click to stop recording.
   - Quit the activity.
   - In your journal will be a small ogg file with your screencast.
   - Optional audio narration.  Not tightly coupled with screen events --
   this could be improved.
   - Designed as library for other activities -- should be plug and play.
   Bring on the connect-4 machinima!


-- Forwarded message --
From: Erik Blankinship [EMAIL PROTECTED]
Date: Feb 5, 2008 6:13 PM
Subject: screencasting
To: [EMAIL PROTECTED]



Screencast 2 is available:
http://mediamods.com/public-svn/camera-activity/tags/xo/Screencast-2.xo

and as browsable source:
http://mediamods.com/public-svn/camera-activity/tags/screencast-2/
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Journal Object Picker in Read

2008-10-08 Thread Erik Blankinship
 If we could limit the preset filter to a list of mime types, I think
 we would benefit from the simplicity. Can we do that? In which cases
 is this not enough?

Filtering on mime types would be great.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Feedback on Measure (was Re: Another pass through some basic Activity test results)

2008-09-29 Thread Erik Blankinship
 Do you need to do that for each window? Why don't you just listen for
 that signal in just the main activity window and stop everything when
 gtk.gdk.VISIBILITY_FULLY_OBSCURED and resume when otherwise?



Full screen modes in Record completely obscure the main activity window.

We don't just listen for visibility events on the video windows because
sometimes these are fully obscured (when transcoding, for example).

Therefore we listen on both the main activity window and the video windows,
and in consultation with the activity's current state (fullscreen, normal,
transcoding), decide if Record is the current activity.

I've never fully understood the rationale for why the sugar api does not
alert activities as to when they are active or not, thereby saving all
activity authors these hassles.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Another pass through some basic Activity test results

2008-09-29 Thread Erik Blankinship

 In Sugar, there's always one and only one active activity. You can see
 which it is by looking at the icon below the XO in the favorites view
 or by looking at the selected activity button in the top frame. This
 is the activity that will be brought to the front when you go to the
 Activity zoom level.

 I'm guessing Measure uses its active activity status to decide if it
 should update itself or not, but from earlier emails I think the
 desired behavior is rather to stop updating while the activity window
 is not visible. For this, the activity author can use the information
 that the window manager (or is it X?) provides to each top level
 window, in pygtk:


 http://pygtk.org/docs/pygtk/class-gtkwidget.html#signal-gtkwidget--visibility-notify-event

 Just listen for that signal and check the value of event.state, it can
 be one of gtk.gdk.VISIBILITY_FULLY_OBSCURED,
 gtk.gdk.VISIBILITY_PARTIAL or gtk.gdk.VISIBILITY_UNOBSCURED. You will
 want to stop updating the screen when fully obscured and update it
 otherwise.

 Faisal, could you please update the almanac with this info?


The basics of this idea are in the almanac:

http://wiki.laptop.org/go/Sugar_Almanac#How_do_I_know_when_my_activity_is_.22active.22_or_not.3F
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Feedback on Measure (was Re: Another pass through some basic Activity test results)

2008-09-29 Thread Erik Blankinship

 Is there any particular reason why Record does not use a single window?



Record's GUI overlays widgets on top of video windows.

This is how we create the picture in a picture effect (using XV in a
window) and also how we add the fullscreen toggle button.  GTK doesn't play
well with overlapping widgets -- gtk.Fixed() doesn't guarantee Z-order.  So
we use a stack of gtk.Windows without decoration.

Unfortunately, when we put xv video into a widget (e.g. gtk.DrawingArea with
a gstreamer xvimagesink) into a gtk.Fixed, that widget's video always
displays on top of other widgets, regardless of its z-order.

It was recommended at one point to create a new version of gtk.Fixed that
guarantees z-order, but the use of gtk.Window was well underway and works.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Feedback on Measure (was Re: Another pass through some basic Activity test results)

2008-09-28 Thread Erik Blankinship
 On Sun, Sep 28, 2008 at 6:02 AM, Gary C Martin [EMAIL PROTECTED]
wrote:
  On 26 Sep 2008, at 19:31, Arjun Sarwal wrote:
 
  2008/9/26 Gary C Martin [EMAIL PROTECTED]:
 
  Here's a set of basic Activity test results for build 8.2-763, hope
the
  ASCI
  art doesn't get too mangled by the list server (need to view with a
fixed
   Measure-20 . . - . x x x . x Doesn't sleep when Activity is in
the
background (eats 75% cpu). Can't
seem
  to
record anything. Keep error when
 
  -- When Measure is in background and some other Activity comes in
  foreground, then Measure releases sound device - you can record sound
  using any other program/application. In this state Measure also
  doesn't hog CPU.
 
  Just testing with Measure-21 and 8.2-765, yes I see this now. However
  switching to any of the Neighborhood/Group/Home views does not seem
count as
  putting Measure into the background, it still consumes the cpu and
claims
  the sound input device. I'm guessing this is a Sugar behaviour? Is this
a
  bug or a feature (feels like a Sugar bug that would make the UI sluggish
for
  no go reason)?

 See #7856. Seems like a Sugar related issue to me. I had borrowed the
 code and concept from Record activity, which now apparently uses some
 other method to determine switch of view/context/activity.( I think
 they detect whether one of the main gtk widgets is the topmost or not
 etc. not sure) I should try exploring that. Any help on this would be
 great.

Record listens for visibility-notify-event:

self.playOggWindow.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
self.playOggWindow.connect(visibility-notify-event, self._visibleNotifyCb)

Because Record has many different windows, we listen on each window and run
through a series of checks on the callback to determine if it is the active
activity anymore.

Be sure to look out for #5500 when trying to get access to a resource like
the camera or microphone.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] which fedora for sugar?

2008-09-20 Thread Erik Blankinship
I recently reformatted my drive.

What is the suggested fedora system for sugar development?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Map activity not working on joyride-2385

2008-09-10 Thread Erik Blankinship
Wow -- glad to hear that Map is being used.  It was developed on 703, so it
is not surprising that it needs some tailoring.  If you've any insight into
what needs to be changed, please let us know so we can make a new release.

Another note regarding the map activity -- it mixes web, javascript,  sugar
components, and would also benefit from the hulahop changes being discussed
for the gmail activity.

Erik

On Thu, Sep 4, 2008 at 12:13 AM, Mikus Grinbergs [EMAIL PROTECTED] wrote:

 Tried Map-1 in Joyride 2386.  There is some sort of an
 incompatibility within the map.activity code regarding rainbow --
 the activity was looking in the wrong 'isolation' gecko directory
 for its data.

 Had to disable rainbow in order to launch map.

 mikus


 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [Activities] Panorama activity

2008-09-10 Thread Erik Blankinship
It would be great to incorporate more recording methods into Record.  We've
plans to also incorporate stop-motion and time-lapse into record also.  It
could become a behemoth of an activity though...  perhaps it might benefit
from being broken into different components (a.k.a. tamtamization)?

As for Record's UI, it uses windows to allow for its custom fullscreen mode
and for embedding widgets over video (seen, for example, in the
picture-in-picture modes and the info button).


On Fri, Sep 5, 2008 at 10:26 AM, Nirav Patel [EMAIL PROTECTED] wrote:

 I don't know about integrating it into Record, but the other issues
 are fairly easy to resolve.  I wrote a Python module over the summer
 to interface v4l2 cameras that returns Pygame surfaces.  Capturing
 images is near instant (~20ms for 640x480 RGB).  Autogain and
 autowhitebalance can be disabled using v4l2 camera controls.  There is
 support in my module for the hflip and vflip controls, but adding
 additional controls is trivial.

 Alternately, we could just use a little utility in C to access any
 v4l2 camera control.  Since the module I wrote is for Pygame and is
 eventually going to be cross platform, adding v4l2 specific stuff to
 it is probably not the greatest idea.

 It may just be better to skip sticking it in Record and make a
 standalone activity, since Record seems to have plenty of issues on
 its own without a big new feature.  There wouldn't be much code
 duplication if Panorama doesn't use gstreamer anyway.

 Nirav

 On Fri, Sep 5, 2008 at 9:26 AM, Benjamin M. Schwartz
 [EMAIL PROTECTED] wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Christoph Derndorfer wrote:
  | Sweet, I totally missed that!
  |
  | Is anyone actively working on integrating that functionality into
 'record'
  | or making it available as a seperate activity?
  |
  | Christoph
  |
 
  See http://lists.laptop.org/pipermail/sugar/2008-February/004307.html
 
  The Panorama Activity is snot quite barely functional.  It might be best
  to roll this functionality into Record, and Erik Blankinship has
 expressed
  some interest in that.  However, Record's UI is very unusual, and I am
 not
  about to attempt integration with it myself.  Also, as you can see in the
  examples, this process is only likely to work well once the camera's
  automatic white balance and gain control are deactivated.  The only way I
  know how to do that is to run in Bayer mode.  Bayer mode was introduced
 in
  a recent gstreamer, but gstreamer was recently downgraded, which leaves
 me
  without a known reliable way to access Bayer mode.
 
  - --Ben
 
  P.S.  For Bayer mode info, see
  http://lists.laptop.org/pipermail/devel/2008-February/011029.html
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v2.0.9 (GNU/Linux)
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
  iEYEARECAAYFAkjBM3oACgkQUJT6e6HFtqRowgCfUlngIFr+Gl3jxKRYZAXBNl/x
  2hEAnAnoDrrvcd+vIHO68aJthULDKAQC
  =cvG0
  -END PGP SIGNATURE-
 
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://lists.laptop.org/listinfo/devel

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [OLPC library] big images, resized images, SVG files

2008-09-04 Thread Erik Blankinship

 Nirav, a GSoC intern, worked on some amazing image recognition tools for
 the XO's camera, in sugar.  I wonder if anything that he worked on would be
 applicable?


If the speed and performance are the metrics, image processing might not be
the best option.

Perhaps every viewable component can implement a toSVG method, returning
an Element?

(However, if you are grabbing a screenshot of the Record activity, then
Nirav's code might be fun to embed!)
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Using threads in an Activity

2008-07-20 Thread Erik Blankinship
Here is some code which runs multiple threads successfully on an xo.  Look
for ServerThread:

http://mediamods.com/public-svn/map-activity/Map.activity/map.py

On Sat, Jul 19, 2008 at 10:26 PM, Shikhar [EMAIL PROTECTED] wrote:

 Hi,

 I am trying to use threads in my activity.  However, the UI locks up
 while the thread runs. Actually, it is somewhat strange what happens:
 the thread is already initialized and running, waiting on a Queue for a
 work request. After I make a request, this is when the UI locks up
 (although the request completes)

 I have tried both gtk.gdk.threads_init() and gobject.threads_init() in
 my activity initialization before I call super

 What am I missing?

 Hope not being very inane...

 Thanks,

 Shikhar http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Sugar Almanac Update - Using Pango, Internationalization

2008-07-17 Thread Erik Blankinship
I've also written up an updated set of steps to internationalize your
 activity based on the instructions at
 http://wiki.laptop.org/go/Python_i18n and my own experience getting text
 to translate.


I think Faisal's url is:

http://wiki.laptop.org/go/Internationalization_in_Sugar
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Show the actual icon when dragging activities in the favorites view.

2008-06-23 Thread Erik Blankinship
Here are some utils we've used in the past:

http://mediamods.com/public-svn/camera-activity/tags/54/_camera.c

On Mon, Jun 23, 2008 at 8:25 AM, Tomeu Vizoso [EMAIL PROTECTED] wrote:

 Me too :/

 I have implemented this following the links in Previous discussions
 in http://live.gnome.org/GtkCairoIntegration .

 Tomeu

 On Mon, Jun 23, 2008 at 2:19 PM, Marco Pesenti Gritti
 [EMAIL PROTECTED] wrote:
  I thought there was better ways to build a pixbuf from a cairo surface
  then fetching in from the X server?
 
  Marco
 
  On Mon, Jun 23, 2008 at 1:35 PM, Tomeu Vizoso [EMAIL PROTECTED]
 wrote:
  Hi,
 
  any simpler and/or more efficient way to do this is very welcome.
 
  Thanks,
 
  Tomeu
 
  ___
  Sugar mailing list
  Sugar@lists.laptop.org
  http://lists.laptop.org/listinfo/sugar
 
 
 
 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] pixolate

2008-06-02 Thread Erik Blankinship
Here's a sketch for a new sugar activity.  Here's how it would work:

One XO shares an image or image feed with other XOs.  The other XOs serve as
puzzle pieces.

http://mediamods.com/~erikb/pixolate/

*directions:
CLICK to give focus. Then UP ARROW  DOWN ARROW to add  remove xos to the
mesh. Press SHIFT to switch orientation.*
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Capturing all mouse events

2008-05-30 Thread Erik Blankinship
This is what we did in Record to remove extra buttons when a child hasn't
moved the mouse in a while... (
http://mediamods.com/public-svn/camera-activity/tags/54/ui.py)  But this has
a very low sample rate:

This code might benefit from improvements.  Suggestions?

def resetWidgetFadeTimer( self ):
#only show the clutter when the mouse moves
self.mx = -1
self.my = -1
self.hideWidgetsTimer = time.time()
if (self.hiddenWidgets):
self.showWidgets()
self.hiddenWidgets = False

#remove, then add
self.doMouseListener( False )
if (self.HIDE_WIDGET_TIMEOUT_ID != 0):
gobject.source_remove( self.HIDE_WIDGET_TIMEOUT_ID )

self.HIDE_WIDGET_TIMEOUT_ID = gobject.timeout_add( 500,
self._mouseMightaMovedCb )


def doMouseListener( self, listen ):
if (listen):
self.resetWidgetFadeTimer()
else:
if (self.HIDE_WIDGET_TIMEOUT_ID != None):
if (self.HIDE_WIDGET_TIMEOUT_ID != 0):
gobject.source_remove( 
self.HIDE_WIDGET_TIMEOUT_ID )



def _mouseMightaMovedCb( self ):
x, y = self.ca.get_pointer()
passedTime = 0

if (x != self.mx or y != self.my):
self.hideWidgetsTimer = time.time()
if (self.hiddenWidgets):
self.showWidgets()
self.hiddenWidgets = False
else:
passedTime = time.time() - self.hideWidgetsTimer

if (self.ca.m.RECORDING):
self.hideWidgetsTimer = time.time()
passedTime = 0

if (passedTime = 3):
if (not self.hiddenWidgets):
if (self.mouseInWidget(x,y)):
self.hideWidgetsTimer = time.time()
elif (self.RECD_INFO_ON):
self.hideWidgetsTimer = time.time()
elif (self.UPDATE_TIMER_ID != 0):
self.hideWidgetsTimer = time.time()
else:
self.hideWidgets()
self.hiddenWidgets = True

self.mx = x
self.my = y
return True




On Fri, May 30, 2008 at 9:38 PM, Benjamin M. Schwartz 
[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Does anyone know how to capture all mouse events?  I am trying to get all
 mouse button up/down events, and maybe even all motion events.  I have
 tried using gdk to listen to all events on the root window, but it doesn't
 seem to capture mouse events.

 It seems like the right way might be to use Xlib, or to hook into the
 window manager, or the X driver, or just listen to /dev/input/mouse0.  I
 don't know much about any of these.  What would you do?

 - --Ben
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkhArB8ACgkQUJT6e6HFtqSRSQCfatqMr9Ksdn204nEtaH89dV8r
 kp8AnAxkPIq/bqnUJENnBze/GFMSgkXt
 =IdMQ
 -END PGP SIGNATURE-
 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] filtering result of an object chooser

2008-03-03 Thread Erik Blankinship
On 2/29/08, Erik Blankinship [EMAIL PROTECTED] wrote:

 Is there a way to filter the mime types of the objects presented with an
 object chooser (e.g., only png)?  Here is some sample code I am using:

 import gtk
 import shutil
 from sugar.graphics.objectchooser import ObjectChooser

 class FilePicker:

 def __init__(self):
 pass

 def show(self):
 title = None
 parent = None
 file = None
 chooser = ObjectChooser(title, parent, gtk.DIALOG_MODAL |
 gtk.DIALOG_DESTROY_WITH_PARENT)
 try:
 result = chooser.run()
 if result == gtk.RESPONSE_ACCEPT:
 jobject = chooser.get_selected_object()
 if jobject and jobject.file_path:
 ext = os.path.splitext(jobject.file_path)[1]
 f, new_temp = tempfile.mkstemp(ext)
 del f

 global _temp_files_to_clean
 _temp_files_to_clean.append(new_temp)
 shutil.copy(jobject.file_path, new_temp)

 file = new_temp
 finally:
 chooser.destroy()
 del chooser

 return file



Unfortunately, this code (and the identical code in the Browse activity)
when run in jhbuild always returns this path: .

Is this expected behavior?  Is this problem unique to jhbuild?  Is there
something I should to differently?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] filtering result of an object chooser

2008-02-29 Thread Erik Blankinship
Is there a way to filter the mime types of the objects presented with an
object chooser (e.g., only png)?  Here is some sample code I am using:

import gtk
import shutil
from sugar.graphics.objectchooser import ObjectChooser

class FilePicker:

def __init__(self):
pass

def show(self):
title = None
parent = None
file = None
chooser = ObjectChooser(title, parent, gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT)
try:
result = chooser.run()
if result == gtk.RESPONSE_ACCEPT:
jobject = chooser.get_selected_object()
if jobject and jobject.file_path:
ext = os.path.splitext(jobject.file_path)[1]
f, new_temp = tempfile.mkstemp(ext)
del f

global _temp_files_to_clean
_temp_files_to_clean.append(new_temp)
shutil.copy(jobject.file_path, new_temp)

file = new_temp
finally:
chooser.destroy()
del chooser

return file
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] wpa2 personal

2008-02-28 Thread Erik Blankinship
How do I find and connect to wpa2-personal access points?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] wpa2 personal

2008-02-28 Thread Erik Blankinship
Update.1 691
Q2D13

On 2/28/08, Erik Blankinship [EMAIL PROTECTED] wrote:

 How do I find and connect to wpa2-personal access points?

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] how to take a screenshot?

2008-02-05 Thread Erik Blankinship
Can someone suggest how to take a screenshot from within a sugar activity?

Thanks!
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] internationalization problem

2008-01-04 Thread Erik Blankinship
Trying to run Record in Spanish is causing a problem.  I will outline the
steps which create this problem.  Hopefully someone can clarify where the
bug is.

In Constants.py, we define the following string:

#TRANS: photo by photographer, e.g., Photo by Mary
istrBy = _(%(1)s by %(2)s)

Which was picked up when we ran python genpot to create Record.pot.

A translator kindly translated Record.pot into Spanish to create es.po:

#. TRANS: photo by photographer, e.g., Photo by Mary
#: constants.py:99
#, python-format
msgid %(1)s by %(2)s
msgstr %(1)s por %(2)s

Then, we created Record-49.xo by running python setup.py dev and python
setup.py dist in the sugar shell.  This creates and populates the locale
directory with lots of files.

Then we install the program on an xo and run it.

Then we take a picture, and that process tries to assign metadata to a
datastory entry, but crashes with this stack trace:

-- 371 recd.title = Constants.istrBy % {1:stringType, 2:str(
recd.recorderName)}
recd.title = None
global Constants.istrBy = '%(1) por %(2)'
stringType = 'Foto'
global str = undefined
recd.recorderName = u'dude face'
...
type 'exceptions.ValueError': unsupported format character 'p' (0x70) at
index 5

What is strange is the line Constants.istrBy = '%(1) por %(2)'

This string appears to have lost its s at the end of the (1) and the (2)
(which we can see were included in the es.po file above).  I am not sure how
this would have happened, but it does seem to make some sense of the error
(the p character being the first thing interpreted after where an s was
expected.

Any ideas on where we're doing something wrong?  Thanks.

Erik
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] internationalization problem

2008-01-04 Thread Erik Blankinship
Sometimes translators have to include variables in their translations.

Most po files have their source strings set up using just %s as the variable
name.

 test = hi there %s
 test % 'erik'
'hi there erik'


However, the order of those variables might be different in different
languages.  That is why we set up our strings like this:

 test2 = hi there %(1)s and %(2)s
 test2 % {1:erik, 2:michael}
'hi there erik and michael'

The translators successfully copied these variable place holders into their
strings.  That was not a problem for the translators.

The problem is that the variable names in their .po files don't come through
the process of making a .xo package.  %(1)s becomes %(1).  This causes
gettext to break.

We just tested using %s for all of our strings, and that works.  We can
quickly revert to that (hoping the phrases we asked to be translated didn't
require resequencing of variables).

It seems that there might be a bug in the process that is generating the
locale information from the po files.


On 1/4/08, Walter Bender [EMAIL PROTECTED] wrote:

 the problem is that your asking the translator to not just translate
 strings, but also your python code. that won't work.

 -walter

 On Jan 4, 2008 4:45 PM, Erik Blankinship [EMAIL PROTECTED] wrote:
  Trying to run Record in Spanish is causing a problem.  I will outline
 the
  steps which create this problem.  Hopefully someone can clarify where
 the
  bug is.
 
  In Constants.py, we define the following string:
 
   #TRANS: photo by photographer, e.g., Photo by Mary
  istrBy = _(%(1)s by %(2)s)
 
  Which was picked up when we ran python genpot to create Record.pot.
 
  A translator kindly translated Record.pot into Spanish to create es.po:
 
  #. TRANS: photo by photographer, e.g., Photo by Mary
  #: constants.py:99
  #, python-format
  msgid %(1)s by %(2)s
  msgstr %(1)s por %(2)s
 
  Then, we created Record-49.xo by running python setup.py dev and python
  setup.py dist in the sugar shell.  This creates and populates the locale
  directory with lots of files.
 
  Then we install the program on an xo and run it.
 
  Then we take a picture, and that process tries to assign metadata to a
  datastory entry, but crashes with this stack trace:
 
  -- 371 recd.title = Constants.istrBy % {1:stringType,
  2:str(recd.recorderName)}
  recd.title = None
  global Constants.istrBy = '%(1) por %(2)'
   stringType = 'Foto'
  global str = undefined
   recd.recorderName = u'dude face'
  ...
   type 'exceptions.ValueError': unsupported format character 'p' (0x70)
 at
  index 5
 
  What is strange is the line Constants.istrBy = '%(1) por %(2)'
 
  This string appears to have lost its s at the end of the (1) and the
 (2)
  (which we can see were included in the es.po file above).  I am not sure
 how
  this would have happened, but it does seem to make some sense of the
 error
  (the p character being the first thing interpreted after where an s was
  expected.
 
  Any ideas on where we're doing something wrong?  Thanks.
 
  Erik
  ___
  Sugar mailing list
  Sugar@lists.laptop.org
  http://lists.laptop.org/listinfo/sugar
 
 



 --
 Walter Bender
 One Laptop per Child
 http://laptop.org

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] internationalization problem

2008-01-04 Thread Erik Blankinship
I have found the bug.  I thought I was working with a Spanish laptop, but I
now see it is a Brazilian laptop.  The Spanish translator included the ss
and the Brazilian translator did not.  It all looked like Latin based
languages to me, and therefore I could not tell the difference :-)

I will go thought the other .po files and ensure they have the right
variables.

Thanks everyone.

On 1/4/08, Erik Blankinship [EMAIL PROTECTED] wrote:

 Sometimes translators have to include variables in their translations.

 Most po files have their source strings set up using just %s as the
 variable name.

  test = hi there %s
  test % 'erik'
 'hi there erik'


 However, the order of those variables might be different in different
 languages.  That is why we set up our strings like this:

  test2 = hi there %(1)s and %(2)s
  test2 % {1:erik, 2:michael}
 'hi there erik and michael'

 The translators successfully copied these variable place holders into
 their strings.  That was not a problem for the translators.

 The problem is that the variable names in their .po files don't come
 through the process of making a .xo package.  %(1)s becomes %(1).  This
 causes gettext to break.

 We just tested using %s for all of our strings, and that works.  We can
 quickly revert to that (hoping the phrases we asked to be translated didn't
 require resequencing of variables).

 It seems that there might be a bug in the process that is generating the
 locale information from the po files.


 On 1/4/08, Walter Bender [EMAIL PROTECTED] wrote:
 
  the problem is that your asking the translator to not just translate
  strings, but also your python code. that won't work.
 
  -walter
 
  On Jan 4, 2008 4:45 PM, Erik Blankinship  [EMAIL PROTECTED] wrote:
   Trying to run Record in Spanish is causing a problem.  I will outline
  the
   steps which create this problem.  Hopefully someone can clarify where
  the
   bug is.
  
   In Constants.py, we define the following string:
  
#TRANS: photo by photographer, e.g., Photo by Mary
   istrBy = _(%(1)s by %(2)s)
  
   Which was picked up when we ran python genpot to create Record.pot.
  
   A translator kindly translated Record.pot into Spanish to create es.po
  :
  
   #. TRANS: photo by photographer, e.g., Photo by Mary
   #: constants.py:99
   #, python-format
   msgid %(1)s by %(2)s
   msgstr %(1)s por %(2)s
  
   Then, we created Record-49.xo by running python setup.py dev and
  python
   setup.py dist in the sugar shell.  This creates and populates the
  locale
   directory with lots of files.
  
   Then we install the program on an xo and run it.
  
   Then we take a picture, and that process tries to assign metadata to a
   datastory entry, but crashes with this stack trace:
  
   -- 371 recd.title = Constants.istrBy % {1:stringType,
   2:str(recd.recorderName)}
   recd.title = None
   global Constants.istrBy = '%(1) por %(2)'
stringType = 'Foto'
   global str = undefined
recd.recorderName = u'dude face'
   ...
type 'exceptions.ValueError': unsupported format character 'p'
  (0x70) at
   index 5
  
   What is strange is the line Constants.istrBy = '%(1) por %(2)'
  
   This string appears to have lost its s at the end of the (1) and the
  (2)
   (which we can see were included in the es.po file above).  I am not
  sure how
   this would have happened, but it does seem to make some sense of the
  error
   (the p character being the first thing interpreted after where an s
  was
   expected.
  
   Any ideas on where we're doing something wrong?  Thanks.
  
   Erik
   ___
   Sugar mailing list
   Sugar@lists.laptop.org
   http://lists.laptop.org/listinfo/sugar
  
  
 
 
 
  --
  Walter Bender
  One Laptop per Child
  http://laptop.org
 


___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] joyride smoke test results?

2007-12-10 Thread Erik Blankinship
On 10 Dec 2007 14:48:05 -0500, Alexander M. Latham 
[EMAIL PROTECTED] wrote:

 --- Erik Blankinship wrote:
 Is there a wiki page where release notes / smoke test notes on joyride are
 posted?  There used to be such a page before JoyRiding.

 Also, it looks like the automated release notes have stopped again.
 --- end of quote ---

 Smoke Test notes and/or any other notes from testing (usually bugs that
 make a build a waste of time to try out) should be posted here:
 http://wiki.laptop.org/go/Test_Group_Release_Notes



Great -- I've updated the page.

http://wiki.laptop.org/go/Test_Group_Release_Notes#Joyride_Builds
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] joyride smoke test results?

2007-12-10 Thread Erik Blankinship
A related question not yet answered on that wiki page:  What is the last
known joyride that, for the most part, worked?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] joyride smoke test results?

2007-12-10 Thread Erik Blankinship
 Wiki notes notwithstanding, 1395 is working for me.

 Note that I did a clean install (square-key with usb autoreinstallation).


Just tried that on a b3 and same problem -- activities don't launch (other
than Journal).
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] activity's access to usb and sd card paths?

2007-12-09 Thread Erik Blankinship
I would like to provide the option to save large media files to external
storage devices.

Is there any security or rainbow restriction from writing to
/media/connectedDevice?  Is there a better path to use than that?

Is there anything activity authors should consider about how the Journal
treats these media?

Thanks
Erik
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] doc import export

2007-11-21 Thread Erik Blankinship
Perhaps a naive question, but could Write come bundled with importers and
exporters for the .doc file format?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] pango on xo question

2007-11-08 Thread Erik Blankinship
I have a pango cairo question.

Can someone help me to understand why my variable todisk can be False in
sugar-jhbuild, but has to be True on an xo?  It would be nice to avoid
writing to disk on the xo.  Thanks.

def createCountdownPng( self, num ):
todisk = True

w = 55
h = w
if (todisk):
cimg = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h)
ctx = cairo.Context(cimg)
else:
pixmap = gtk.gdk.Pixmap(None, w, h, 24)
ctx = pixmap.cairo_create()
ctx.rectangle(0, 0, w, h)
ctx.set_source_rgb(0, 0, 0)
ctx.fill()
x = 0
y = 4
ctx.translate(x,y)
ctx.set_source_surface (self.__class__.recCircleCairo, 0, 0) #a
cairo surface
ctx.paint()
ctx.translate(-x,-y)

ctx.set_source_rgb(255, 255, 255)
pctx = pangocairo.CairoContext(ctx)
play = pctx.create_layout()
font = pango.FontDescription(sans 30)
play.set_font_description(font)
play.set_text( +str(num) )
dim = play.get_pixel_extents()
ctx.translate( -dim[0][0], -dim[0][1] )
xoff = (w-dim[0][2])/2
yoff = (h-dim[0][3])/2
ctx.translate( xoff, yoff )
ctx.translate( -3, 0 )
pctx.show_layout(play)

img = gtk.Image()
if (todisk):
path = os.path.join(Instance.tmpPath, str(num)+.png)
path = utils.getUniqueFilepath(path, 0)
cimg.write_to_png(path)
numPixbuf = gtk.gdk.pixbuf_new_from_file(path)
img.set_from_pixbuf( numPixbuf )
else:
img.set_from_pixmap(pixmap, None)

self.__class__.countdownImgs[int(num)] = img
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] joyride logs

2007-11-07 Thread Erik Blankinship
What is the secret to turning on reliable logs in Joyride?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Localized number formatting

2007-11-05 Thread Erik Blankinship
Hi Ben

Did you make any progress with this?

Thanks
Erik

On 10/28/07, Benjamin M. Schwartz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 It appears that the right way to do localized number formatting in Python
 is
 locale.format().  Has anyone successfully used this function in an
 activity?  I
 can't seem to make it work.

 Also, what is the correct way to tell a sugar-jhbuild instance that it
 should
 pretend to be in Peru, or wherever?

 - --Ben
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFHJSpDUJT6e6HFtqQRAidGAJ4g+0iN+WWsvng/ub2lAV3Tj9nTrgCfTLat
 u8UKrLcx52ouxqbWVDH0PGQ=
 =rn8w
 -END PGP SIGNATURE-
 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] how to make a grayscale image?

2007-11-01 Thread Erik Blankinship
thanks everyone!

import gtk

def grayScalePixBuf( pb, copy ):
arr = pb.get_pixels_array()
if (copy):
arr = arr.copy()
for row in arr:
for pxl in row:
y = 0.3*pxl[0][0]+0.59*pxl[1][0]+0.11*pxl[2][0]
pxl[0][0] = y
pxl[1][0] = y
pxl[2][0] = y
return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(),
pb.get_bits_per_sample())

pb = gtk.gdk.pixbuf_new_from_file(cat.jpg)
pb = grayScalePixBuf(pb, True)
pb.save( grayCat.png, png, {} )


On 11/1/07, Benjamin M. Schwartz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Erik Blankinship wrote:
  Anyone know of an easy technique for turning a pixbuf or cairo context
  into grayscale?

 I can't tell what you mean.  Do you mean to take a snapshot of an existing
 pixbuf, convert that snapshot to grayscale, and display the snapshot over
 the
 existing pixbuf?  If so, the easiest way I know of is
 gtk.gdk.Pixbuf.get_pixels_array and gtk.gdk.pixbuf_new_from_array[1].  These
 methods allow you to do math on the pixels as a Numeric Python array, and
 then
 make a new Pixbuf from the resulting array.

 1.

 http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--get-pixels-array
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFHKmkCUJT6e6HFtqQRAgrjAJ47VHqmT9j7xVAyNzgKXdgDTxQWMQCffJ6k
 D26RDImuualfzAdlJNaP4k0=
 =Oc7S
 -END PGP SIGNATURE-

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Bitfrost compliance for Update.1

2007-11-01 Thread Erik Blankinship
 1. File-path compliance means that you must ensure your activity does not
 write to any path outside of that contained in the environment variable
 SUGAR_ACTIVITY_ROOT;


Will this path be unique per instance?
Can we create subdirectories within /tmp?
Will data there be persistent between sessions?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] ip4-address buddy property - still needed?

2007-10-30 Thread Erik Blankinship
While I welcome the new activities and think it is great to integrate them
into sugar, can we reconsider completely doing away with the dev console?
It is /very/ useful to have the console open on an xo while the activity you
are debugging is running behind it.

Can't you have both the old console and the new activities?



On 10/30/07, Eduardo Silva [EMAIL PROTECTED] wrote:

 Please check: http://wiki.laptop.org/go/Developer_Environment

 On 10/30/07, Marco Pesenti Gritti [EMAIL PROTECTED] wrote:
  On 10/30/07, Sjoerd Simons [EMAIL PROTECTED] wrote:
   On Fri, Oct 26, 2007 at 01:18:17PM -0400, Michail Bletsas wrote:
At this point in time, having as much debug info available in the
developer console without having to remember which command-line tool
provides what, is crucial for collecting problem reports from
 non-expert
users and I would request that the IPv4 information remains where it
 is.
  
   Apparently the developer console is going away. Or at least it's not
 part of
   the latest joyride builds. So you can't collect your info anymore this
 way.
 
  It's on the build actually but it's not working. It will be replaced
  shortly by a couple of activities. (Log and Analyze).
 
  Marco
  ___
  Devel mailing list
  [EMAIL PROTECTED]
  http://lists.laptop.org/listinfo/devel
 
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://lists.laptop.org/listinfo/devel

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] New joyride build 173

2007-10-30 Thread Erik Blankinship
I apologize if I missed the announcement on how activities get into the
various new builds.

In the past, we would assign trac tickets to J5.

What do we do now?

On 10/30/07, Build Announcer Script [EMAIL PROTECTED] wrote:


 http://xs-dev.laptop.org/~cscott/olpc/streams/joyride/build173/devel_jffs2/

  Analyze-2.xo
  Log-2.xo
  Terminal-1.xo
  Terminal-2.xo
  Write-48.xo
  Write-49.xo

 --- Analyze-2 ---
* New X Server Interface

 --- Log-2 ---
* Drop presence and network interfaces

 --- Terminal-2 ---
* Go to home user directory
* Decrease font size

 --- Write-49 ---
   * Enable/disable the search functions based on the input (uwog)
   * Support for searching text (foddex, tiny bit of uwog)
   * Support custom keybindings (foddex)

 --
 This email was automatically generated
 Aggregated logs at http://dev.laptop.org/~bert/joyride-pkgs.html
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://lists.laptop.org/listinfo/devel

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] internationalizing numbers?

2007-10-26 Thread Erik Blankinship
On 10/26/07, Pascal Scheffers [EMAIL PROTECTED] wrote:


 Other than that, and only judging from the occasional arab, japanese,
 chinese and hebrew website I see but cannot read, most just use roman
 numerals like we do in left to right, most significant digit first.



Is there a function that can do this conversion based on which .po file is
being used?

In Java, I would use:

NumberFormat.getPercentInstance(Locale.US);


and

NumberFormat.getIntegerInstance(Locale.US);
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] internationalizing numbers?

2007-10-26 Thread Erik Blankinship
 Same goes with dates (ymd, dmy, mdy, etc) and their variations due
 to separators. Same with time.


Good point.

What is the preferred method for internationalizing dates and times, in
addition to numbers?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Joyride

2007-10-25 Thread Erik Blankinship
On 10/25/07, Bert Freudenberg [EMAIL PROTECTED] wrote:

 Could someone *please* explain and document the current process of
 getting RPMs and XO bundles into the build?


I don't have answers, but I do have clues.

https://dev.laptop.org/ticket/4441

links to

https://dev.laptop.org/ticket/4251
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] ip4-address buddy property - still needed?

2007-10-25 Thread Erik Blankinship
 We still have one set of OLPC-specific patches to Salut (the link-
 local
 collaboration backend) that has been rejected upstream, which is
 the one
 that adds support for the deprecated ip4-address buddy property.

 Is anyone still using this property? If not, can we kill it? It was
 added in Trial-2, and it was meant to be gone by Trial-3 but was
 left in
 just in case, so it really ought to disappear.
Record uses ip4-address, but we've just about completed Record Tubes (and it
is working great).
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] when is a widget actually painted?

2007-10-23 Thread Erik Blankinship
I've a gtk.Widget listening with connect_after to:

   - size-allocate
   - show
   - map
   - realize

But none of these is correctly telling me when the widget has actually
painted to the screen.  Suggestions?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] how does an activity query the name of the activity?

2007-10-22 Thread Erik Blankinship
How does an activity query the current name of the activity session?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [theora] Fwd: video encoding

2007-10-15 Thread Erik Blankinship
 I am not 100% sure multifilesrc is on the xo, but I am pretty sure we
 could get it added.  We are in need of the same component for some our
 development efforts too.


Multifilesrc isn't on the xo, as it is in gstreamer-plugins-bad, evidently
because it hasn't been updated in a while.  Any chance we can get this
element added to sugar so we can see how it works for us?

If we add it to the build, and it works, we can then create movies from
series of images you can grab at your own discretion (perhaps in the way
done by the Web activity):

def _get_screenshot(self):
window = self._browser.window
width, height = window.get_size()

screenshot = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, has_alpha=False,
bits_per_sample=8, width=width,
height=height)
screenshot.get_from_drawable(window, window.get_colormap(), 0, 0, 0,
0,
 width, height)

screenshot = screenshot.scale_simple(style.zoom(100),
 style.zoom(80),
 gtk.gdk.INTERP_BILINEAR)

buffer = self.get_buffer(screenshot)
return buffer


Then we run those through a gstreamer pipline to spit out ogg files.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] Missing dependencies when starting with jhbuild

2007-10-13 Thread Erik Blankinship
I just installed FC7 on a new machine, ran yum install git, then started the
process of installing sugar-jhbuild.

Missing dependencies:

intltoolize 0.35
darcs
gettextize
gstreamer-0.10 0.10
gstreamer-plugins-base-0.10 0.10
fribidi
enchant
theora
liboil-0.3
numpy (python module)
json (python module)
avahi (python module)
gst (python module)
avahi-client
avahi-glib
gstreamer-0.10
gstreamer-plugins-base-0.10
poppler
poppler-glib
rsvg (python module)
wnck (python module)
xephyr

I am wondering if there is an easy way to clear away the problems of yum
installing the various packages of this next step (and having to research
what the yum install name is for each package, a difficult task for even the
initiated).  Further, I think removing this step from jhbuild for new
developers would be a good idea.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] chimes, csound?

2007-10-10 Thread Erik Blankinship
On 10/6/07, Erik Blankinship [EMAIL PROTECTED] wrote:

 Where is good sample code for playing a chime or short sound in a sugar
 activity?  I suppose that c-sound might be the right tool?  Gstreamer seems
 like too much overhead.



Can someone fluent in csound point me to the code for a nice shutter click
sound?  Would be cool to use that instead of a canned wav file.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] files over tubes

2007-10-04 Thread Erik Blankinship
 Erik Blankinship wrote:
  It is not clear to me how I would send a large pdf file using tubes.

 How large? Large enough that you wouldn't want to store the whole thing in
 memory?


Yes.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] trac can't take attachments

2007-09-23 Thread Erik Blankinship
 *Trac detected an internal error:*

OperationalError: database is locked
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] multiple gtk.Windows hide() and show()

2007-09-10 Thread Erik Blankinship
 So your best bet is probably to make your own version of gtk.Fixed that
 does have a guaranteed Z-order, rather than trying to bend the wm to
 your will.



Unfortunately, when I put xv video into
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] multiple gtk.Windows hide() and show()

2007-09-10 Thread Erik Blankinship
take two...

So your best bet is probably to make your own version of gtk.Fixed that
 does have a guaranteed Z-order, rather than trying to bend the wm to
 your will.


Unfortunately, when I put xv video in a widget (a gtk.DrawingArea with a
gstreamer xvimagesink) into a gtk.Fixed, that widget's video always displays
on top of other widgets, regardless of its Z-order.

(I am remembering now that this was one of the reasons why we used a stack
of gtk.Windows in our current implementation).

Is there a way to make widgets in a gtk.Fixed display on top of an xv
widget?

Thanks
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] multiple gtk.Windows hide() and show()

2007-08-27 Thread Erik Blankinship
Thanks for replying Dan, much appreciated.

Let me explain what I am trying to achieve: I am creating a picture in a
picture effect (using XV in a window, amongst other windows).  GTK doesn't
play well with overlapping widgets, and gtk.Fixed() doesn't guarantee
Z-order.  So I am using a stack of gtk.Windows without decoration to achieve
the desired effect, but the appearance is that everything looks like a nice
gtk layout.

On 8/27/07, Dan Winship [EMAIL PROTECTED] wrote:

 Erik Blankinship wrote:
  A UI I am working on has multiple gtk.Windows, which I would like to
  hide when they are resizing (to avoid screen flashes).
 
  The multiple gtk.Windows are set_transient() for each other, allowing me
  to stack them, and when I hide() and show(), the flicker is indeed
 gone!

 transient_for doesn't mean stack this window above this other
 window. It means (quoting from the ICCCM) this window is a pop-up on
 behalf of the named window. Swapping two windows around so that
 sometimes one of them is transient for the other and other times vice
 versa makes no sense by this definition, so there's no telling what the
 WM will do if you do that.


I don't care about recalling set_transient, I just want windows to show up
consistently in the expected order.  I am not changing what is set_transient
for what, just trying to get windows to show up again by recalling that
method.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] request for new Version: option in trac

2007-08-23 Thread Erik Blankinship
Any possibility of adding a new Version: option to the combo box in Trac?

The option would be retrogress, to describe requested changes to outdated
platforms (e.g.,bugs specific to b2 hardware).  It doesn't make sense to
close these bugs (as getting Sugar to run on many platforms is an admirable
goal), but they are not on the critical path of imminent deployments.  Also,
they're not necessarily opportunities, as they're more like repairs.

Erik
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] hiding a gtk.widget without unmapping it

2007-08-21 Thread Erik Blankinship
gtk.widget.hide() makes a widget disappear by removing it (unmapping) it.
How do i just make a widget not appear? (I want to toggle the widget's
visibility and I don't want the layout around the widgets to change).

In java, the call would be setVisible(false), and while the widget wouldn't
show up on screen, the layout manager would still leave space for it.
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] files from the datastore the school server

2007-08-16 Thread Erik Blankinship
When data is saved to the datastore, it will eventually get backed up the
school server.

When activities request backed up files from the datastore, will they be
returned as URIs or as files?  Will there be a callback when they are
downloaded and ready?  Will there be an error message when the files are not
available (e.g., no network)?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] more clipboard questions

2007-07-28 Thread Erik Blankinship
I have a problem knowing when I can remove a file in /tmp after it has been
placed on the clipboard successfully.

Responding to a key-press-event callback, I call the following:

gtk.Clipboard().set_with_data( [('text/uri-list', 0, 0)],
self._clipboardGetFuncCb, self._clipboardClearFuncCb, tempImgPath )

which, in turn, calls back:

def _clipboardGetFuncCb( self, clipboard, selection_data, info,
tempImgPath):
 tempImgUri = file:// + tempImgPath
 selection_data.set( text/uri-list, 8, tempImgUri )

def _clipboardClearFuncCb( self, clipboard, tempImgPath):
 if (tempImgPath != None):
  if (os.path.exists(tempImgPath)):
   os.remove( tempImgPath )

_clipboardGetFuncCb is called before _clipboardClearFuncCb, but the second
callback prevents any data from being placed on the clipboard (an image icon
appears, but it has no data).  If the second callback doesn't delete the
file, the copy works!  It would seem I need a callback to know when the
clipboard has completed copying the data from /tmp before deleting the file
from /tmp.

Looking into the clipboardservice.py code, it seems that a
_handle_file_completed
call can fire a file-completed... but I am not sure of the right way for
an activity to plug into that logic.  Suggestions?

Thanks.
Erik
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Multiple documents

2007-07-26 Thread Erik Blankinship

Was my question so easy that it didn't need a response?  :-)

Seriously...  how should activities save/serialize multiple files for
correct indexing/viewing in the Journal?  We need an answer yesterday.


On 7/25/07, Erik Blankinship [EMAIL PROTECTED] wrote:


I am wondering if there is an answer yet to this question from about a
month ago?

On 7/12/07, Bert Freudenberg  [EMAIL PROTECTED] wrote:

 If I understand the Sugar philosophy correctly, we won't have
 multiple documents per activity. If we want to have multiple
 documents opened at the same time, these would be multiple instances
 of the same activity.

 Is this the case?

 And if so, what would one activity instance have to do to create a
 new instance?

 - Bert -


 ___
 Sugar mailing list
 Sugar@lists.laptop.org
 http://lists.laptop.org/listinfo/sugar



___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Multiple documents

2007-07-25 Thread Erik Blankinship

I am wondering if there is an answer yet to this question from about a month
ago?

On 7/12/07, Bert Freudenberg [EMAIL PROTECTED] wrote:


If I understand the Sugar philosophy correctly, we won't have
multiple documents per activity. If we want to have multiple
documents opened at the same time, these would be multiple instances
of the same activity.

Is this the case?

And if so, what would one activity instance have to do to create a
new instance?

- Bert -


___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] clipboard questions

2007-07-21 Thread Erik Blankinship

I would like to put images taken with the camera onto the clipboard.

I am able to put images taken with the camera onto the clipboard this way:

self.clipBoard = gtk.Clipboard(display=gtk.gdk.display_get_default(),
selection=CLIPBOARD)
...
#todo: should probably listen for a CTRL+C callback, but how?
self.clipBoard.set_image( pixbuf )

My questions are:

  1. How do I listen for Control+C events to call
  self.clipBoard.set_image( pixbuf )?
  2. Is there anything else to it?  Images I put on the clipboard now do
  not have either a name or an Open menuitem.  Is there a spec somewhere for
  what metadata we should associate with clipboard data?
  3. Is there an example of using drag and drop in sugar to the
  clipboard?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] when your journal is full

2007-07-17 Thread Erik Blankinship

XO's drives getting full of photos (see #2192).

I am wondering how activity developers should handle the disk is just about
full problems.

Since the Journal will eventually handle compression / backup of activity
bits to the school server, it seems like a good place to query how much
space is available.  By chance, is there a callback for activity developers
to listen to when the disk is filling up?

Or should activity developers handle this problem another way?
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar