Changes between Version 12 and Version 13 of Submitting/Python


Ignore:
Timestamp:
Dec 29, 2014, 2:09:05 PM (9 years ago)
Author:
neteler
Comment:

rast= -> raster=

Legend:

Unmodified
Added
Removed
Modified
  • Submitting/Python

    v12 v13  
    33= Submitting Python Code =
    44
    5 When submitting Python code to GRASS SVN repository, please take care of following rules:
     5When submitting Python code to GRASS SVN repository, please take care of following rules:
     6
    67== File structure ==
    78
     
    102103{{{
    103104#!python
    104 grass.run_command('g.region', rast='myrast')
    105 # not this:
    106 grass.run_command( 'g.region', rast='myrast' )
     105grass.run_command('g.region', raster='myrast')
     106# not this:
     107grass.run_command( 'g.region', raster='myrast' )
    107108}}}
    108109
     
    111112{{{
    112113#!python
    113 grass.run_command('g.region', rast='myrast')
    114 # not this:
    115 grass.run_command( 'g.region', rast = 'myrast' )
     114grass.run_command('g.region', raster='myrast')
     115# not this:
     116grass.run_command( 'g.region', raster = 'myrast' )
    116117}}}
    117118
     
    158159grass.use_temp_region()
    159160# now you can safely modify the region
    160 grass.run_command('g.region', rast='input')
     161grass.run_command('g.region', raster='input')
    161162# and when you are done:
    162163grass.del_temp_region()
     
    186187
    187188=== Overwrite maps ===
     189
    188190Do not use `overwrite=True` when calling a module from a Python script,
    189191if to overwrite or not should be automatically detected based on calling of the script with `--o` or without.