File tree 3 files changed +17
-11
lines changed
3 files changed +17
-11
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,11 +6,17 @@ Overview
6
6
* room status (for SpaceAPI etc.)
7
7
* extended information about our hackspace
8
8
* audio announcement system via long polling
9
- * LED ticker via long polling (still to come)
9
+ * LED ticker via long polling
10
10
* Mate-O-Meter (still to come)
11
11
* MUC (xmpp) status
12
12
* Wiki status (just redirects)
13
13
14
+ Dependencies
15
+ ============
16
+
17
+ * flask
18
+ * [ ledticker.py] ( https://github.com/hickerspace/ledticker/blob/master/ledticker.py )
19
+
14
20
Notes
15
21
=====
16
22
* Enable WSGIPassAuthorization to pass through authorisation headers:
Original file line number Diff line number Diff line change 2
2
from logger import log
3
3
import os
4
4
import time
5
+ import ledticker
5
6
from conf import *
6
7
7
8
"""
@@ -37,11 +38,16 @@ def serveAnnouncement():
37
38
possible, because of the inability to create port forwardings.
38
39
"""
39
40
def longPolling ():
40
- # ledticker check belongs here
41
- while not os .path .exists (API_PATH + '/' + ESPEAK_FILE ):
41
+ ticker = ledticker .LedTicker (API_PATH + "/data/ledticker.txt" )
42
+
43
+ while not os .path .exists (API_PATH + '/' + ESPEAK_FILE ) and ticker .items_available () == 0 :
42
44
time .sleep (1 )
43
45
44
- if os .path .exists (API_PATH + '/' + ESPEAK_FILE ):
46
+ if ticker .items_available () != 0 :
47
+ # return new ticker messages if available
48
+ return ticker .get_output ()
49
+
50
+ elif os .path .exists (API_PATH + '/' + ESPEAK_FILE ):
51
+ # return new announcements (as mp3s) if available
45
52
return serveAnnouncement ()
46
53
47
- # ..and here
You can’t perform that action at this time.
0 commit comments