On 2012-08-21, at 15:38, Sascha Silbe wrote:

> Martin Abente Lahaye <[email protected]> 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
[email protected]
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to