Re: [Sugar-devel] Sugar-devel Digest, Vol 63, Issue 73

2014-01-22 Thread Manuel QuiƱones
2014/1/22 Tony Anderson tony_ander...@usa.net:
 Hi,

 The original sugar-launch intended to provide this capability. It requires
 only
 a few lines of code.

 parser.add_option(-o,--object_id,action=store_true,dest=object_id,
   help=resume activity with object)
 parser.add_option(-u,--object_uri,action=store_true,dest=object_uri,
   help=path to file)

 adds the -o and -u option. In practice, I use the -o option.

 if options.object_id:
 cmd_args.append(-o)
 cmd_args.append(args[1])
 if options.object_uri:
 cmd_args.append(-u)
 cmd_args.append(args[1])

 added after the if options.debug sets the option at launch.

Thanks for the information Tony.  This matches Martin Abente's patch.

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


Re: [Sugar-devel] Sugar-devel Digest, Vol 63, Issue 73

2014-01-21 Thread Tony Anderson

Hi,

The original sugar-launch intended to provide this capability. It 
requires only

a few lines of code.

parser.add_option(-o,--object_id,action=store_true,dest=object_id,
  help=resume activity with object)
parser.add_option(-u,--object_uri,action=store_true,dest=object_uri,
  help=path to file)

adds the -o and -u option. In practice, I use the -o option.

if options.object_id:
cmd_args.append(-o)
cmd_args.append(args[1])
if options.object_uri:
cmd_args.append(-u)
cmd_args.append(args[1])

added after the if options.debug sets the option at launch.

Tony

On 01/22/2014 01:08 AM, sugar-devel-requ...@lists.sugarlabs.org wrote:

Send Sugar-devel mailing list submissions to
sugar-devel@lists.sugarlabs.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sugarlabs.org/listinfo/sugar-devel
or, via email, send a message with subject or body 'help' to
sugar-devel-requ...@lists.sugarlabs.org

You can reach the person managing the list at
sugar-devel-ow...@lists.sugarlabs.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of Sugar-devel digest...


Today's Topics:

1. Feature proposal: ability to start an activity from  inside
   another (Manuel Qui?ones)
2. Re: Feature proposal: ability to start an activity from
   inside another (Martin Abente)
3. Re: Feature proposal: ability to start an activity from
   inside another (Sam Parkinson)
4. Re: Feature proposal: ability to start an activity from
   inside another (Martin Langhoff)
5. Re: Collaboration support for sugar web activities
   (Daniel Narvaez)


--

Message: 1
Date: Tue, 21 Jan 2014 15:00:21 -0200
From: Manuel Qui?ones ma...@laptop.org
To: Sugar-dev Devel sugar-devel@lists.sugarlabs.org
Subject: [Sugar-devel] Feature proposal: ability to start an activity
frominside another
Message-ID:
cappv+oauxhrwerrk+yjlab86edx6wu91wgoajpef5mrnjc+...@mail.gmail.com
Content-Type: text/plain; charset=UTF-8

This topic appears once in a while in this mailing list, and as far as
I know, each time it happens no one objects.
So, time to bring it again.

One of Sugar key principles is simplicity.
Activities are meant to be simple, and users can make interesting
things happen when they interoperate with the activities.
They do so by using the Journal and the Clipboard.

However, there are cases where you want to start an activity from
inside another, thus skipping the step through the Journal.
For example, a user wants to download and read a book.  The current steps are:
- start GetBooks activity
- search for the book
- download the book (get book)
- show book in Journal
- start Read activity from the Journal object

If activities could start other activities, the steps are simpler:
- start GetBooks activity
- search for the book
- download the book (get book)
- start Read activity

This limitation (among others) has made Ceibal find a replacement for
GetBooks and Read, their own BibliotecaSegura.

So I've been investigating a bit, and found that is preety easy to add
this feature.
In fact it is already possible.
I was able to change GetBooks to open Read after a book is downloaded.  See:
https://github.com/manuq/get-books/compare/open-activity

This is a bit hackish,
- imports a model from the shell
- the bundle_id of the activity is hardcoded

I think the more elegant option is to extend sugar-launch to something like:

 sugar-launch --object_id object_id

And reuse the code in the Journal that starts or resumes activities (misc.py).

Thoughts?




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