~ubuntu-branches/ubuntu/karmic/grass/karmic

« back to all changes in this revision

Viewing changes to swig/python/test.py

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2009-07-13 13:34:03 UTC
  • mfrom: (3.1.15 karmic)
  • Revision ID: james.westby@ubuntu.com-20090713133403-0x81m7hb1q06zu13
Tags: 6.4.0~rc5-2
* Added a grass menu item (Hamish).
* Added a grass.menu.in template with related icon.
* Added a simple x-grass wrapper to allow running grass without a pre-running
  controlling terminal. At least it works within ordinary WMs launchers.
  (closes: #503371)
* Added newlocation.dpatch patch to manage correctly new locations.
  (closes: #533738)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
 
7
7
import os, sys
8
 
import python_grass6 as g6lib
 
8
from grass.lib import grass
9
9
 
10
10
if not os.environ.has_key("GISBASE"):
11
11
    print "You must be in GRASS GIS to run this program."
14
14
rname = 'elevation.dem'
15
15
mapset = 'PERMANENT'
16
16
 
17
 
g6lib.G_gisinit('')
18
 
g6lib.G_find_cell2(rname,'')
 
17
grass.G_gisinit('')
 
18
grass.G_find_cell2(rname,'')
19
19
 
20
20
print mapset
21
21
 
22
22
print 'prints 0 if map was found'
23
23
 
24
 
print 'roads:'
25
 
print g6lib.G_raster_map_type('roads',mapset)
 
24
print 'roads raster map:'
 
25
print grass.G_raster_map_type('roads',mapset)
26
26
 
27
 
print 'elevation.dem:'
28
 
print g6lib.G_raster_map_type(rname,mapset)
 
27
print 'elevation.dem raster map:'
 
28
print grass.G_raster_map_type(rname,mapset)
29
29