-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch
90 lines (78 loc) · 3.35 KB
/
patch
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/mpf.sh b/mpf.sh
index 6d0a9dc..5c88711 100755
--- a/mpf.sh
+++ b/mpf.sh
@@ -10,8 +10,8 @@
# This code will launch mc in a new window and require you to switch windows
# and Ctrl-C out of each
-x-terminal-emulator -e bash -c "python mc.py $@"
-python mpf.py "$@"
+#x-terminal-emulator -e bash -c "python mc.py $@"
+#python mpf.py "$@"
# The line below will launch both processes in the same terminal window
# with the output of BOTH processes going to the same window
@@ -20,5 +20,18 @@ python mpf.py "$@"
# the prompt. To use, comment out the two commands above and uncomment the
# line below.
-#python mc.py "$@" & python mpf.py "$@" && echo "Killed both processes"
+export PYTHONPATH=/home/hms/workspace-pinball/kingpyn
+export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
+
+mkdir logs
+pushd logs
+rm mc-last.log
+ln -s `ls *mc* | sort | tail -1` mc-last.log
+rm mpf-last.log
+ln -s -f `ls *mpf* | sort | tail -1` mpf-last.log
+popd
+
+python mc.py "$@" &
+sleep 5
+pypy mpf.py "$@" && echo "Killed both processes"
diff --git a/mpf/platform/openpixel.py b/mpf/platform/openpixel.py
index f9ac06f..6791c78 100644
--- a/mpf/platform/openpixel.py
+++ b/mpf/platform/openpixel.py
@@ -72,7 +72,7 @@ class OpenPixelLED(object):
self.opc_client.add_pixel(self.channel, self.led)
def color(self, color):
- self.log.debug("Setting color: %s", color)
+ #self.log.debug("Setting color: %s", color)
self.opc_client.set_pixel_color(self.channel, self.led, color)
diff --git a/mpf/system/events.py b/mpf/system/events.py
index 8dbf70f..3bdd3c4 100644
--- a/mpf/system/events.py
+++ b/mpf/system/events.py
@@ -505,10 +505,10 @@ class EventManager(object):
self.log.debug("vvvv Finished event '%s'. Type: %s. Callback: %s. "
"Args: %s", event, ev_type, callback, kwargs)
- if ev_type is 'queue' and not queue:
+ if ev_type == 'queue' and not queue:
# If this was a queue event but there were no registered handlers,
# then we need to do the callback now
- callback(**kwargs)
+ self.callback_queue.append((callback, kwargs))
elif queue and queue.is_empty():
# If we had a queue event that had handlers and a queue was created
@@ -519,7 +519,7 @@ class EventManager(object):
if queue.callback:
# if there's still a callback, that means it wasn't called yet
- queue.callback(**kwargs)
+ self.callback_queue.append((queue.callback, kwargs))
if callback and ev_type != 'queue':
# For event types other than queue, we'll handle the callback here.
diff --git a/mpf/system/light_controller.py b/mpf/system/light_controller.py
index 8e18950..80e4a7d 100755
--- a/mpf/system/light_controller.py
+++ b/mpf/system/light_controller.py
@@ -142,7 +142,10 @@ class LightController(object):
if show in self.machine.shows:
self.machine.shows[show].play(priority=priority, **kwargs)
else: # assume it's a show object?
- show.play(priority=priority, **kwargs)
+ if isinstance(show, basestring):
+ self.log.error("Missing show: {}".format(show))
+ else:
+ show.play(priority=priority, **kwargs)
try:
self.running_show_keys[kwargs['key']] = show