From 318326dad6f01be2659650ef07a698685a3d97f8 Mon Sep 17 00:00:00 2001
From: "Michael D. M. Dryden" <mdryden@chem.utoronto.ca>
Date: Thu, 20 Nov 2014 16:19:00 -0500
Subject: [PATCH] Fix #20 - stop button doesn't send command.

---
 dstat-interface/dstat-interface/dstat_comm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dstat-interface/dstat-interface/dstat_comm.py b/dstat-interface/dstat-interface/dstat_comm.py
index 32f3e8d..426acfa 100644
--- a/dstat-interface/dstat-interface/dstat_comm.py
+++ b/dstat-interface/dstat-interface/dstat_comm.py
@@ -172,12 +172,15 @@ class Experiment(object):
         scan = 0
         while True:
             if self.main_pipe.poll():
-                print "abort"
                 if self.main_pipe.recv() == 'a':
                     self.serial.write('a')
                     return False
                         
             for line in self.serial:
+                if self.main_pipe.poll():
+                    if self.main_pipe.recv() == 'a':
+                        self.serial.write('a')
+                        return False
                 if line.startswith('B'):
                     self.main_pipe.send(self.data_handler(
                                  (scan, self.serial.read(size=self.databytes))))
-- 
GitLab