scripting.py: added some aliases in BaseScript
authormartinko <gamato@users.sf.net>
Tue, 23 Aug 2011 16:15:46 +0000 (18:15 +0200)
committermartinko <gamato@users.sf.net>
Tue, 23 Aug 2011 16:15:46 +0000 (18:15 +0200)
stat_add -> stat_put
stat_inc -> stat_increase

python/skytools/scripting.py

index 471bbd650b5135f6a4aea560e2d2a538fca9fdc0..3ed1e3d9c3caae954354978a6078e7a58a363492 100644 (file)
@@ -456,10 +456,6 @@ class BaseScript(object):
             sys.exit(1)
         self.last_sigint = t
 
-    def stat_add(self, key, value):
-        """Old, deprecated function."""
-        self.stat_put(key, value)
-
     def stat_put(self, key, value):
         """Sets a stat value."""
         self.stat_dict[key] = value
@@ -599,6 +595,10 @@ class BaseScript(object):
         signal.signal(signal.SIGHUP, self.hook_sighup)
         signal.signal(signal.SIGINT, self.hook_sigint)
 
+    # define some aliases (short-cuts / backward compatibility cruft)
+    stat_add = stat_put                 # Old, deprecated function.
+    stat_inc = stat_increase
+
 ##
 ##  DBScript
 ##