[GRASS-SVN] r59191 - grass/trunk/lib/python/pygrass/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 4 01:41:22 PST 2014


Author: zarch
Date: 2014-03-04 01:41:21 -0800 (Tue, 04 Mar 2014)
New Revision: 59191

Modified:
   grass/trunk/lib/python/pygrass/raster/history.py
Log:
Fix history line and length methods

Modified: grass/trunk/lib/python/pygrass/raster/history.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/history.py	2014-03-03 21:48:23 UTC (rev 59190)
+++ grass/trunk/lib/python/pygrass/raster/history.py	2014-03-04 09:41:21 UTC (rev 59191)
@@ -62,6 +62,9 @@
         """Rast_free_history"""
         pass
 
+    def __len__(self):
+        return self.length()
+
     #----------------------------------------------------------------------
     #libraster.HIST_CREATOR
     def _get_creator(self):
@@ -213,12 +216,12 @@
 
     def length(self):
         """Rast_history_length"""
-        libraster.Rast_history_length(self.c_hist)
+        return libraster.Rast_history_length(self.c_hist)
 
     def line(self, line):
         """Rast_history_line"""
-        libraster.Rast_history_line(self.c_hist,
-                                    ctypes.c_int(line))
+        return libraster.Rast_history_line(self.c_hist,
+                                           ctypes.c_int(line))
 
     def read(self):
         """Rast_read_history. ::



More information about the grass-commit mailing list