|
a/web/scweb.py |
|
b/web/scweb.py |
|
... |
|
... |
18 |
@bottle.route('/list')
|
18 |
@bottle.route('/list')
|
19 |
@bottle.view('list')
|
19 |
@bottle.view('list')
|
20 |
def listReceivers():
|
20 |
def listReceivers():
|
21 |
devnull = open('/dev/null', 'w')
|
21 |
devnull = open('/dev/null', 'w')
|
22 |
try:
|
22 |
try:
|
23 |
data = subprocess.check_output(['scctl', '-l', '-n'], stderr = devnull)
|
23 |
data = subprocess.check_output(['scctl', '-l'], stderr = devnull)
|
24 |
except:
|
24 |
except:
|
25 |
data = "scctl error"
|
25 |
data = "scctl error"
|
26 |
o = []
|
26 |
o = []
|
27 |
for line in data.splitlines():
|
27 |
for line in data.splitlines():
|
|
|
28 |
#print >> sys.stderr, line
|
28 |
fields = re.split('''\s+''', line);
|
29 |
fields = re.split('''\s+''', line);
|
29 |
if len(fields) == 4:
|
30 |
if len(fields) == 4:
|
30 |
status, fname, uuid, uri = fields
|
31 |
status, fname, uuid, uri = fields
|
31 |
elif len(fields) == 3:
|
32 |
elif len(fields) == 3:
|
32 |
status, fname, uuid = fields
|
33 |
status, fname, uuid = fields
|
|
... |
|
... |
53 |
subprocess.check_call(arglist, stderr = devnull)
|
54 |
subprocess.check_call(arglist, stderr = devnull)
|
54 |
except:
|
55 |
except:
|
55 |
pass
|
56 |
pass
|
56 |
|
57 |
|
57 |
try:
|
58 |
try:
|
58 |
data = subprocess.check_output(['scctl', '-l', '-n'], stderr = devnull)
|
59 |
data = subprocess.check_output(['scctl', '-l'], stderr = devnull)
|
59 |
except:
|
60 |
except:
|
60 |
data = "scctl error"
|
61 |
data = "scctl error"
|
61 |
|
62 |
|
62 |
a = []
|
63 |
a = []
|
63 |
o = []
|
64 |
o = []
|
|
... |
|
... |
85 |
subprocess.check_call(['scctl', '-x', uuid], stderr=devnull)
|
86 |
subprocess.check_call(['scctl', '-x', uuid], stderr=devnull)
|
86 |
except:
|
87 |
except:
|
87 |
pass
|
88 |
pass
|
88 |
|
89 |
|
89 |
try:
|
90 |
try:
|
90 |
data = subprocess.check_output(['scctl', '-l', '-n'], stderr = devnull)
|
91 |
data = subprocess.check_output(['scctl', '-l'], stderr = devnull)
|
91 |
except:
|
92 |
except:
|
92 |
data = "scctl error"
|
93 |
data = "scctl error"
|
93 |
|
94 |
|
94 |
a = []
|
95 |
a = []
|
95 |
for line in data.splitlines():
|
96 |
for line in data.splitlines():
|