Browse Source

Add common exit methods

Alois Mahdal 10 years ago
parent
commit
2ad6835182
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      include/gmon.py

+ 7
- 0
include/gmon.py View File

@@ -103,5 +103,12 @@ class App:
103 103
         path = os.environ.get("GMON_PLUGINS", path)
104 104
         self.pluginpath = path
105 105
 
106
+    def die(self, msg, rv=9):
107
+        sys.stderr.write(msg + "\n")
108
+        self.exit(rv)
109
+
110
+    def exit(self, rv=0):
111
+        sys.exit(rv)
112
+
106 113
     def run(self):
107 114
         print self.subcommand.get_output()