Changes between Version 12 and Version 13 of Submitting/Python
- Timestamp:
- 12/29/14 14:09:05 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Submitting/Python
v12 v13 3 3 = Submitting Python Code = 4 4 5 When submitting Python code to GRASS SVN repository, please take care of following rules: 5 When submitting Python code to GRASS SVN repository, please take care of following rules: 6 6 7 == File structure == 7 8 … … 102 103 {{{ 103 104 #!python 104 grass.run_command('g.region', rast ='myrast')105 # not this: 106 grass.run_command( 'g.region', rast ='myrast' )105 grass.run_command('g.region', raster='myrast') 106 # not this: 107 grass.run_command( 'g.region', raster='myrast' ) 107 108 }}} 108 109 … … 111 112 {{{ 112 113 #!python 113 grass.run_command('g.region', rast ='myrast')114 # not this: 115 grass.run_command( 'g.region', rast = 'myrast' )114 grass.run_command('g.region', raster='myrast') 115 # not this: 116 grass.run_command( 'g.region', raster = 'myrast' ) 116 117 }}} 117 118 … … 158 159 grass.use_temp_region() 159 160 # now you can safely modify the region 160 grass.run_command('g.region', rast ='input')161 grass.run_command('g.region', raster='input') 161 162 # and when you are done: 162 163 grass.del_temp_region() … … 186 187 187 188 === Overwrite maps === 189 188 190 Do not use `overwrite=True` when calling a module from a Python script, 189 191 if to overwrite or not should be automatically detected based on calling of the script with `--o` or without.