Browse Source

Rename project

Alois Mahdal 10 years ago
parent
commit
8c65f13616
8 changed files with 36 additions and 36 deletions
  1. 3
    3
      INSTALL.md
  2. 16
    16
      README
  3. 5
    5
      include/sardine.py
  4. 2
    2
      plugins/dump.py
  5. 2
    2
      plugins/echo.py
  6. 2
    2
      plugins/moc.py
  7. 2
    2
      plugins/sh.py
  8. 4
    4
      sardine

+ 3
- 3
INSTALL.md View File

1
 INSTALL
1
 INSTALL
2
 =======
2
 =======
3
 
3
 
4
-Currently gmon is in heavy development state, so there is no "official"
4
+Currently sardine is in heavy development state, so there is no "official"
5
 installaion procedure.
5
 installaion procedure.
6
 
6
 
7
-However, all that should suffice is to add *gmon/include* path to your
8
-**PYTHONPATH** and you should be able to run the *gmon/gmon* script.
7
+However, all that should suffice is to add *sardine/include* path to your
8
+**PYTHONPATH** and you should be able to run the *sardine/sardine* script.

+ 16
- 16
README View File

1
-GMON
2
-====
1
+SARDINE
2
+=======
3
 
3
 
4
 Generic plugin-based monitor, mainly for use with Xfce genmon
4
 Generic plugin-based monitor, mainly for use with Xfce genmon
5
 
5
 
9
 SYNOPSIS
9
 SYNOPSIS
10
 --------
10
 --------
11
 
11
 
12
-    gmon [options] command [args...]
12
+    sardine [options] command [args...]
13
 
13
 
14
 
14
 
15
 DESCRIPTION
15
 DESCRIPTION
16
 -----------
16
 -----------
17
 
17
 
18
-gmon is a plugin-based "pretty-printer" that allows adding own sub-commands
18
+sardine is a plugin-based "pretty-printer" that allows adding own sub-commands
19
 and use them with common interface.
19
 and use them with common interface.
20
 
20
 
21
 Typical use case is when you have a space where only limited number of characters
21
 Typical use case is when you have a space where only limited number of characters
27
 other targets better.  For example, genmon Xfce plugin is able to periodically
27
 other targets better.  For example, genmon Xfce plugin is able to periodically
28
 display output of a command in desktop panel.  Apart from displaying simple
28
 display output of a command in desktop panel.  Apart from displaying simple
29
 string, it can parse XML-like content and use it to display tooltip or an icon.
29
 string, it can parse XML-like content and use it to display tooltip or an icon.
30
-You could implement mode in your plugin for this target, and use gmon both for
30
+You could implement mode in your plugin for this target, and use sardine both for
31
 your Xfce panel and your terminal in a consistent manner.
31
 your Xfce panel and your terminal in a consistent manner.
32
 
32
 
33
 
33
 
65
 This one takes first argument as a command name and runs it as a new process,
65
 This one takes first argument as a command name and runs it as a new process,
66
 passing the rest of arguments to it untouched:
66
 passing the rest of arguments to it untouched:
67
 
67
 
68
-    $ gmon sh uname -a
68
+    $ sardine sh uname -a
69
     Linux fullmoon.brq.redhat.com 3.13.6-...
69
     Linux fullmoon.brq.redhat.com 3.13.6-...
70
-    $ gmon sh who
70
+    $ sardine sh who
71
     somebody  tty1         2014-03-28 19:...
71
     somebody  tty1         2014-03-28 19:...
72
 
72
 
73
 Note that arguments are untouched, so things like wildcards/glubs will not
73
 Note that arguments are untouched, so things like wildcards/glubs will not
74
-work (unless the shell where you type the `gmon` command expands them).
74
+work (unless the shell where you type the `sardine` command expands them).
75
 
75
 
76
 
76
 
77
 ### echo ###
77
 ### echo ###
78
 
78
 
79
 Connects the arguments and prints them:
79
 Connects the arguments and prints them:
80
 
80
 
81
-    $ gmon echo hello
81
+    $ sardine echo hello
82
     hello
82
     hello
83
-    $ gmon echo "one two"   "three"
83
+    $ sardine echo "one two"   "three"
84
     one twothree
84
     one twothree
85
 
85
 
86
 
86
 
88
 
88
 
89
 Dumps the arguments as Python sees them (using repr() builtin)
89
 Dumps the arguments as Python sees them (using repr() builtin)
90
 
90
 
91
-    $ gmon dump "one two"   "three"
91
+    $ sardine dump "one two"   "three"
92
     args = ['one two', 'three']
92
     args = ['one two', 'three']
93
-    $ gmon dump uname -a
93
+    $ sardine dump uname -a
94
     args = ['uname', '-a']
94
     args = ['uname', '-a']
95
 
95
 
96
 
96
 
100
 *plugins*
100
 *plugins*
101
   folder where plugins are stored
101
   folder where plugins are stored
102
 
102
 
103
-*/etc/gmon/config*
103
+*/etc/sardine/config*
104
   system-wide configuration file
104
   system-wide configuration file
105
 
105
 
106
-*~/.config/gmon/config*
106
+*~/.config/sardine/config*
107
   user's personal config
107
   user's personal config
108
 
108
 
109
-*~/.local/share/gmon/plugins/<plugin_name>*
109
+*~/.local/share/sardine/plugins/<plugin_name>*
110
   plugin local storage (if needed)
110
   plugin local storage (if needed)
111
 
111
 
112
 
112
 
113
 ENVIRONMENT
113
 ENVIRONMENT
114
 -----------
114
 -----------
115
 
115
 
116
-`GMON_PLUGINS`
116
+`SARDINE_PLUGINS`
117
   Alternate folder for plugins
117
   Alternate folder for plugins
118
 
118
 
119
 
119
 

include/gmon.py → include/sardine.py View File

5
 import sys
5
 import sys
6
 
6
 
7
 
7
 
8
-class GmonPluginError(Exception):
8
+class SardinePluginError(Exception):
9
     pass
9
     pass
10
 
10
 
11
 
11
 
37
         method_n = "render_" + self.data.fmt
37
         method_n = "render_" + self.data.fmt
38
 
38
 
39
         def ex(__):
39
         def ex(__):
40
-            raise GmonPluginError("method not defined: " + method_n)
40
+            raise SardinePluginError("method not defined: " + method_n)
41
 
41
 
42
         render_fn = getattr(self, method_n, ex)
42
         render_fn = getattr(self, method_n, ex)
43
         return render_fn()
43
         return render_fn()
80
                 module = imp.load_module(self.name, fh, modpath,
80
                 module = imp.load_module(self.name, fh, modpath,
81
                                          (".py", "r", imp.PY_SOURCE))
81
                                          (".py", "r", imp.PY_SOURCE))
82
         except IOError:
82
         except IOError:
83
-            raise GmonPluginError(self.name)
83
+            raise SardinePluginError(self.name)
84
         self.plugin = module.Plugin(self.plugindata)
84
         self.plugin = module.Plugin(self.plugindata)
85
 
85
 
86
     def _format_output(self, raw):
86
     def _format_output(self, raw):
102
         self._set_pluginpath()
102
         self._set_pluginpath()
103
         try:
103
         try:
104
             self.subcommand = Subcommand(cmdargs, self.pluginpath)
104
             self.subcommand = Subcommand(cmdargs, self.pluginpath)
105
-        except GmonPluginError as e:
105
+        except SardinePluginError as e:
106
             self.die("no such plugin: %s" % e)
106
             self.die("no such plugin: %s" % e)
107
 
107
 
108
     def _set_pluginpath(self):
108
     def _set_pluginpath(self):
109
         mypath = os.path.dirname(os.path.realpath(sys.argv[0]))
109
         mypath = os.path.dirname(os.path.realpath(sys.argv[0]))
110
         path = mypath + "/plugins"
110
         path = mypath + "/plugins"
111
-        path = os.environ.get("GMON_PLUGINS", path)
111
+        path = os.environ.get("SARDINE_PLUGINS", path)
112
         self.pluginpath = path
112
         self.pluginpath = path
113
 
113
 
114
     def die(self, msg, rv=9):
114
     def die(self, msg, rv=9):

+ 2
- 2
plugins/dump.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
-import gmon
3
+import sardine
4
 
4
 
5
 
5
 
6
-class Plugin(gmon.BasePlugin):
6
+class Plugin(sardine.BasePlugin):
7
 
7
 
8
     def render_plain(self):
8
     def render_plain(self):
9
         out = "args = %s" % repr(self.args)
9
         out = "args = %s" % repr(self.args)

+ 2
- 2
plugins/echo.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
-import gmon
3
+import sardine
4
 
4
 
5
 
5
 
6
-class Plugin(gmon.BasePlugin):
6
+class Plugin(sardine.BasePlugin):
7
 
7
 
8
     def render_plain(self):
8
     def render_plain(self):
9
         out = "".join([str(s) for s in self.data.args])
9
         out = "".join([str(s) for s in self.data.args])

+ 2
- 2
plugins/moc.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
-import gmon
3
+import sardine
4
 
4
 
5
 import subprocess
5
 import subprocess
6
 
6
 
60
             return "(not running)"
60
             return "(not running)"
61
 
61
 
62
 
62
 
63
-class Plugin(gmon.BasePlugin):
63
+class Plugin(sardine.BasePlugin):
64
 
64
 
65
     name = "moc"
65
     name = "moc"
66
 
66
 

+ 2
- 2
plugins/sh.py View File

2
 
2
 
3
 import subprocess
3
 import subprocess
4
 
4
 
5
-import gmon
5
+import sardine
6
 
6
 
7
 
7
 
8
-class Plugin(gmon.BasePlugin):
8
+class Plugin(sardine.BasePlugin):
9
 
9
 
10
     def render_plain(self):
10
     def render_plain(self):
11
         return subprocess.check_output(self.args)
11
         return subprocess.check_output(self.args)

gmon → sardine View File

2
 
2
 
3
 """Generic mon echoer
3
 """Generic mon echoer
4
 
4
 
5
-usage: gmon [options] COMMAND [ARGS...]
5
+usage: sardine [options] COMMAND [ARGS...]
6
 
6
 
7
 Options:
7
 Options:
8
     -c, --chars CHARS specify limit in characters
8
     -c, --chars CHARS specify limit in characters
15
 """
15
 """
16
 
16
 
17
 import docopt
17
 import docopt
18
-import gmon
18
+import sardine
19
 
19
 
20
 
20
 
21
 if __name__ == '__main__':
21
 if __name__ == '__main__':
22
 
22
 
23
     args = docopt.docopt(__doc__,
23
     args = docopt.docopt(__doc__,
24
-                         version="gmon 0.1",
24
+                         version="sardine 0.1",
25
                          options_first=True)
25
                          options_first=True)
26
-    app = gmon.App(args)
26
+    app = sardine.App(args)
27
     app.run()
27
     app.run()