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

Martin Abente martin.abente.lahaye at gmail.com
Tue Aug 21 14:53:44 EDT 2012


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120821/c04d997f/attachment.html>


More information about the Sugar-devel mailing list