|
a/web/scweb.py |
|
b/web/scweb.py |
1 |
import subprocess
|
1 |
import subprocess
|
2 |
import sys
|
2 |
import sys
|
3 |
import bottle
|
3 |
import bottle
|
4 |
import re
|
4 |
import re
|
|
|
5 |
import time
|
5 |
|
6 |
|
6 |
@bottle.route('/static/:path#.+#')
|
7 |
@bottle.route('/static/:path#.+#')
|
7 |
def server_static(path):
|
8 |
def server_static(path):
|
8 |
return bottle.static_file(path, root='./static')
|
9 |
return bottle.static_file(path, root='./static')
|
9 |
|
10 |
|
10 |
@bottle.route('/')
|
11 |
@bottle.route('/')
|
11 |
@bottle.view('main')
|
12 |
@bottle.view('main')
|
12 |
def top():
|
13 |
def top():
|
13 |
devnull = open('/dev/null', 'w')
|
14 |
devnull = open('/dev/null', 'w')
|
14 |
#cmd = subprocess.Popen(['scctl', '-S'], stderr = devnull, stdout = devnull)
|
15 |
cmd = subprocess.Popen(['scctl', '-S'], stderr = devnull, stdout = devnull)
|
15 |
cmd = subprocess.Popen(['scctl', '-S'])
|
16 |
# Sleep a wee bit to give a chance to the server to initialize
|
|
|
17 |
time.sleep(1)
|
16 |
return dict(title='')
|
18 |
return dict(title='')
|
17 |
|
19 |
|
18 |
@bottle.route('/list')
|
20 |
@bottle.route('/list')
|
19 |
@bottle.view('list')
|
21 |
@bottle.view('list')
|
20 |
def listReceivers():
|
22 |
def listReceivers():
|