def pump_run(self, pump_port, switch): '''block the UI to avoid "segmentation fault"''' print "activating pump", pump_port Gdk.threads_enter() # needed to avoid Segmentation fault error switch.set_active(True) Gdk.threads_leave() # needed to avoid Segmentation fault error '''run the pump''' pumps.control_pumps(pump_port,self.pump_length) '''block the UI again to avoid "segmentation fault"''' Gdk.threads_enter() # needed to avoid Segmentation fault error print "deactivating pump", pump_port print "" switch.set_active(False) Gdk.threads_leave() # needed to avoid Segmentation fault error return
def on_PUMP2_BUTTON_clicked(self, data=None): print "pump2 is activating for ", self.pump_length, " seconds" pumps.control_pumps(self.port_pump2,self.pump_length) return