[Sugar-devel] [PATCH sugar] Example objects support

Gonzalo Odiard gonzalo at laptop.org
Tue Aug 21 15:00:54 EDT 2012


Maybe the ObjectChooser can look by default at a fixed directory (as
"examples")
but have a optional parameter to solve this particular cases.

It's true etoys (or scratch) have his own particular directories,
but also use his particular methods to access it.

Gonzalo

On Tue, Aug 21, 2012 at 3:53 PM, Martin Abente <
martin.abente.lahaye at gmail.com> wrote:

> Hello Bert!
>
> Thanks for taking your time looking at this.
>
> What I tried, or I am trying, to do is to make this feature available as
> easy as we can, so even deployments could add their own examples with very
> little technical knowledge requirements. That why I try this convention
> (magical) idea.
>
> I would really appreciate if you could bring you ideas to the design
> thread. :) Because the design of this feature seems to be changing there.
>
>
> On Tue, Aug 21, 2012 at 2:36 PM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>
>>
>> On 2012-08-21, at 15:38, Sascha Silbe wrote:
>>
>> > Martin Abente Lahaye <martin.abente.lahaye at gmail.com> writes:
>> >
>> >> +    def _add_activity_example(self, home_activity):
>> >> +        examples_path = os.path.join(home_activity.get_bundle_path(),
>> >> +                                    'examples')
>> >> +
>> >> +        if not os.path.exists(examples_path):
>> >> +            return
>> >
>> > If you add a guard against home_activity.get_bundle_path() returning
>> > None, you can drop the special-casing for the Journal activity.
>>
>>
>> I like the general idea very much. However, instead of a magic directory
>> name, couldn't the activity.info file have a new entry giving the
>> examples path?
>>
>> This could be encapsulated in a function
>> home_activity.get_examples_path().
>>
>> The advantage of this would be that activities could specify a directory
>> (relative to the bundle directory) that fits their structure better than
>> having to put the examples into a fixed location in the bundle. In very
>> special cases they could even give an absolute path, e.g. Etoys examples
>> are in /usr/share/etoys/ExampleEtoys ...
>>
>> - Bert -
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120821/931983e3/attachment.html>


More information about the Sugar-devel mailing list