blob: 094038295e2a8b445426edd1735f0a3a9bff5ffe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
##
# other modules
import sub_process
import sys
import aosd
import ConfigParser
# our modules
import func_module
# =================================
class msg(func_module.FuncModule):
version = "0.0.1"
api_version = "0.0.1"
description = "Display messages"
def display (self,flags):
"""
parse the msg for display.
"""
try:
text,config_section=flags.split("|")
if config_section == '':
config_section="default"
except:
text=flags
config_section="default"
cmd = sub_process.Popen("/usr/LH/bin/msg_client.py --msg \"%s\" " % flags,stdout=sub_process.PIPE,shell=True)
data = cmd.communicate()[0]
cmd = sub_process.Popen("/usr/bin/echo -e \"%s\" | /usr/bin/wall" % text, stdout=sub_process.PIPE,shell=True)
data = cmd.communicate()[0]
return ("Message delivered")
|