18 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
19 |
|
|
20 |
|
|
21 |
|
import os |
22 |
from Xlib import X |
from Xlib import X |
23 |
from Xlib.protocol import event |
from Xlib.protocol import event |
24 |
from circus import module |
from circus import module |
25 |
|
|
26 |
class MyModule(module.Module): |
class MyModule(module.Module): |
27 |
"""A description of your module should be placed here""" |
"""A module for executing system commands""" |
28 |
|
|
29 |
my_actions = {"exec" : "execute"} |
my_actions = {"exec" : "execute"} |
30 |
|
|
39 |
def handle_event(self, event): |
def handle_event(self, event): |
40 |
pass |
pass |
41 |
|
|
42 |
def execute(self, *cmd): |
def execute(self, prog, *args): |
43 |
print "Execute the command" |
print "Execute the command" |
44 |
|
pid = os.fork() |
45 |
|
if not pid: |
46 |
|
os.execvp(prog, (prog,) + args) |