<div dir="ltr"><div class="gmail_default" style="font-size:small">HI Victor,</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 1:12 PM, Victor Olaya <span dir="ltr"><<a href="mailto:volayaf@gmail.com" target="_blank">volayaf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">does Processing.getAlgorithm("script:helloworld") work in a normal<br>
QGIS Python console?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Yes it does.</div></div><div class="gmail_default" style="font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Just in case, the name of the script is the name of the file (without<br>
the extension)<br>
<br>
Maybe you can try <div class="gmail_default" style="font-size:small;display:inline"></div>Processing.alghelp("script") to get the name of<br>
available algorithms from the script provider<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Is alghelp() really correct? Even in the Python console, I only get errors</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">processing.alghelp("scripts")</div><div class="gmail_default">Algorithm not found</div><div class="gmail_default">Processing.alghelp("script")</div><div class="gmail_default">Traceback (most recent call last):</div><div class="gmail_default"> File "<input>", line 1, in <module></div><div class="gmail_default" style="font-size:small">AttributeError: class Processing has no attribute 'alghelp'</div><div><br></div><div><div class="gmail_default" style="font-size:small">Best wishes,</div><div class="gmail_default" style="font-size:small">Anita</div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Hope this helps<br>
<div><div class="h5"><br>
<br>
<br>
2015-11-26 11:06 GMT+01:00 Anita Graser <<a href="mailto:anitagraser@gmx.at">anitagraser@gmx.at</a>>:<br>
> Hi,<br>
><br>
> I'm trying to run Processing scripts in a stand-alone Python script. The<br>
> examples available online for calling default, e.g. QGIS algorithms, work<br>
> fine but when I try to access a script instead, it cannot be found, i.e.<br>
> getAlgorithm() returns None.<br>
><br>
> Am I missing something or is this a bug?<br>
><br>
> # Prepare the environment<br>
> import sys<br>
> from qgis.core import QgsApplication<br>
> from PyQt4.QtGui import QApplication<br>
> app = QApplication([])<br>
> QgsApplication.setPrefixPath("/usr", True)<br>
> QgsApplication.initQgis()<br>
><br>
> # Prepare processing framework<br>
> sys.path.append('/home/agraser/.qgis2/python/plugins')<br>
> from processing.core.Processing import Processing<br>
> Processing.initialize()<br>
><br>
> print Processing.getAlgorithm("qgis:creategrid") # works<br>
> print Processing.getAlgorithm("script:helloworld") # doesn't work<br>
><br>
> # Exit applications<br>
> QgsApplication.exitQgis()<br>
> QApplication.exit()<br>
><br>
><br>
> Thanks and best wishes,<br>
> Anita<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div></div>