[GRASS-user] Manual to own python script

Markus Neteler neteler at osgeo.org
Mon May 16 07:56:10 EDT 2011


On Mon, May 16, 2011 Markus Neteler:
>> On Thu, May 12, 2011 at 2:17 PM, Johannes Radinger <jradinger at gmx.at>
...
>> If you use a Makefile to install it, the approach as used for the
>> existing Python
>> scripts should work. Of course your script must use the GRASS parser.
>
> But there is no makefile needed to "install" a python script. It is just necessary to copy
> the *.py into the /bin folder and the script can be called with *.py.

Sure. But then you don't get the advantage of getting the doc
autogenerated which
is done by the Makefile.

> Anyhow how would and installation with an makefile work?

Just deposit the html file into the same directory.
GRASS 6: name as "description.html"
GRASS 7: name as "<modulename>.html"

> the makefile of python scripts contain only little information,

Yes, we tried to keep it minimalistic.

>  I tried to use the r.buffer makefile and adapt it to my script:
>
> 1       MODULE_TOPDIR = ../..
> 2
> 3       PGM = r.fidimo.py
> 4
> 5       include $(MODULE_TOPDIR)/include/Make/Script.make
> 6
> 7       default: script

Perfect.


> but what now?? How is that connected to the .html file?

The magic is in $(MODULE_TOPDIR)/include/Make/Script.make if you want to
see how it works. It discovers the HTML file and generates the manual page
when running
make

> how do I have to install my script with the makefile (that is very new to me)?

I suspect that you are already done.
Please take a look at

grass70/scripts/<some-script>/

e.g.
http://trac.osgeo.org/grass/browser/grass/trunk/scripts/
or in your local copy.

Markus


More information about the grass-user mailing list