<div dir="ltr">Sorry for the noise, but this message's title should say 'how to distribute Processing models' instead of modules...<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 15, 2013 at 2:39 AM, Ricardo Filipe Soares Garcia da <span dir="ltr"><<a href="mailto:ricardo.garcia.silva@gmail.com" target="_blank">ricardo.garcia.silva@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi list<br><br></div>I am building a plugin for Processing (former Sextante). Besides the GeoAlgorithms,  I'd like to include some ready-made models along with the plugin.<br>



<br></div>Is this feasible? How to do it?<br><br></div>I am currently using a 'models' subdir under my plugin's code with the models.<br><br></div>It seems I should be able to register the models with processing's own ModelerAlgorithmProvider, but I am missing something<br>



<br></div><div># python code<br></div><div>alg = ModelerAlgorithm()<br></div><div>alg.openModel('path_to_model_file')<br></div><div>modeler_provider = Processing.modeler<br></div><div>modeler_provider.algs.append(alg)<br>


</div><div>Processing.updateProviders()<br>
</div><div><br></div><div>When running the above from the Python console I get no errors. But the Processing Toolbox does not show my models.<br><br></div><div>What am I missing?<br><br></div><div>Is there another way to do this? Is including models in plugins a nice way of distributing them? In this case it seems like a good thing, beacuse I want to provide some examples on how the plugin can be used.<br>


<br></div><div>Best regards<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- <br>___________________________ ___ __<br>Ricardo Garcia Silva
</div></font></span></div><div><div><div><div><div><div></div></div></div></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>___________________________ ___ __<br>Ricardo Garcia Silva
</div>