Eben Eliason | 1 Oct 22:14
Picon

Keyboard Shortcuts

I've started a new page on the wiki for documenting standard and
agreed upon keyboard shortcuts, both for Sugar and for use within
various activities.  It's mostly empty right now.  I'll try to fill in
some of the gaps, but I'd be grateful to have developers contribute to
it as well.

We should come up with a way to handle controversial or "unconfirmed"
shortcuts as well.  Perhaps these can be italicized in the table for
differentiation and then referenced in the talk pages for discussion
and resolution.

- Eben

PS.  I included the cheat codes for startup here as well.  Perhaps
we'll want to remove the cheat codes page completely, in favor of this
listing, or at least be sure they remain in sync.
Eben Eliason | 1 Oct 23:54
Picon

Re: Keyboard Shortcuts

Sorry, forgot to include the link:

http://wiki.laptop.org/go/Keyboard_Shortcuts

On 10/1/07, Eben Eliason <eben.eliason <at> gmail.com> wrote:
> I've started a new page on the wiki for documenting standard and
> agreed upon keyboard shortcuts, both for Sugar and for use within
> various activities.  It's mostly empty right now.  I'll try to fill in
> some of the gaps, but I'd be grateful to have developers contribute to
> it as well.
>
> We should come up with a way to handle controversial or "unconfirmed"
> shortcuts as well.  Perhaps these can be italicized in the table for
> differentiation and then referenced in the talk pages for discussion
> and resolution.
>
> - Eben
>
> PS.  I included the cheat codes for startup here as well.  Perhaps
> we'll want to remove the cheat codes page completely, in favor of this
> listing, or at least be sure they remain in sync.
>
Erik Blankinship | 2 Oct 23:37
Favicon
Gravatar

Re: Data Transport between nodes


The code for the hello mesh is in

http://dev.laptop.org/git?p=projects/hellomesh;a=summary


How would you change the HelloMesh example to send binary data or an object?  Could you post a diff?  That would be useful for a reference.  Thanks!


_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Picon

Re: Data Transport between nodes


Erik Blankinship wrote:
> How would you change the HelloMesh example to send binary data or an
> object?  Could you post a diff?  That would be useful for a reference. 
> Thanks!

This is a dangerous suggestion, but you may want to look at the source code for
my Acoustic Measure activity:
http://dev.laptop.org/git?p=projects/acoustic-measure-activity;a=summary

My code is directly based on HelloMesh, but I needed to send binary data over
the Tube.  The answer to your question specifically is basically one word:
base64.  Python has a base64 module providing b64encode and b64decode functions.
 I used these to send arbitrary bytes over the Tube, which only supports utf8.

--Ben
Simon McVittie | 3 Oct 12:24
Picon

Re: Data Transport between nodes

On Tue, 02 Oct 2007 at 17:43:41 -0400, Benjamin M. Schwartz wrote:
>  I used these to send arbitrary bytes over the Tube, which only supports utf8.

This isn't actually true. If a D-Bus method is declared with signature 's'
(string) it only supports unicode or UTF-8 str objects. If no signature is
declared but you use a str argument, dbus-python will guess that you
wanted signature 's' and the string has to be UTF-8.

However, if your method is declared with signature 'ay' (byte array) you
can pass arbitrary binary data. You probably want to put
byte_arrays=True in the @method decorator, so the method will get its
input as a dbus.ByteArray (a subclass of str) rather than as a
dbus.Array of dbus.Bytes (subclasses of: a list of ints).

If your data has some other internal structure, other D-Bus types may be
more appropriate (e.g. you might want a list of floats, which in D-Bus
terminology would be an array of double, signature 'ad').

Similar notes apply to signals. See
http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html for more
information.
Erik Blankinship | 3 Oct 15:15
Favicon
Gravatar

Re: Data Transport between nodes

On 10/3/07, Simon McVittie <simon.mcvittie <at> collabora.co.uk> wrote:

On Tue, 02 Oct 2007 at 17:43:41 -0400, Benjamin M. Schwartz wrote:
>  I used these to send arbitrary bytes over the Tube, which only supports utf8.

This isn't actually true. If a D-Bus method is declared with signature 's'
(string) it only supports unicode or UTF-8 str objects. If no signature is
declared but you use a str argument, dbus-python will guess that you
wanted signature 's' and the string has to be UTF-8.

However, if your method is declared with signature 'ay' (byte array) you
can pass arbitrary binary data. You probably want to put
byte_arrays=True in the <at> method decorator, so the method will get its
input as a dbus.ByteArray (a subclass of str) rather than as a
dbus.Array of dbus.Bytes (subclasses of: a list of ints).

I hope this is a simple question: what is the preferred way to convert a file into a ByteArray for use with dBus?

_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Simon McVittie | 3 Oct 20:36
Picon

Re: Deprecated methods in Tubes API are about to go away

This change has been committed. One thing I forgot to mention is that
Gabble now echoes broadcast messages (usually meaning signals) back to the
sender as well as delivering them to the other participants, and at some
point Salut will have get same change; this makes Tubes behave more like the
real dbus-daemon. If you're doing something cunning with signals in an
activity, please make sure this won't break it.

	Simon
Erik Blankinship | 4 Oct 23:37
Favicon
Gravatar

files over tubes

It is not clear to me how I would send a large pdf file using tubes.  (Currently the "read" activity does not use tubes).

Can someone familiar with tubes provide example code?

_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Picon

Re: files over tubes


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?

--Ben
Erik Blankinship | 5 Oct 01:44
Favicon
Gravatar

Re: files over tubes


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 <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar

Gmane