Hello Bert!<br><br>Thanks for taking your time looking at this.<br><br>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.<br>
<br>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.<br><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 2:36 PM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On <a href="tel:2012-08-21" value="+59820120821">2012-08-21</a>, at 15:38, Sascha Silbe wrote:<br>
<br>
> Martin Abente Lahaye <<a href="mailto:martin.abente.lahaye@gmail.com">martin.abente.lahaye@gmail.com</a>> writes:<br>
><br>
</div><div class="im">>> + def _add_activity_example(self, home_activity):<br>
>> + examples_path = os.path.join(home_activity.get_bundle_path(),<br>
>> + 'examples')<br>
>> +<br>
>> + if not os.path.exists(examples_path):<br>
>> + return<br>
><br>
> If you add a guard against home_activity.get_bundle_path() returning<br>
> None, you can drop the special-casing for the Journal activity.<br>
<br>
<br>
</div>I like the general idea very much. However, instead of a magic directory name, couldn't the <a href="http://activity.info" target="_blank">activity.info</a> file have a new entry giving the examples path?<br>
<br>
This could be encapsulated in a function home_activity.get_examples_path().<br>
<br>
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 ...<br>
<br>
- Bert -<br>
<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</blockquote></div><br>