def main(): """ Main function for console execution """ # Parse arguments file_name, depth, backup, debug_level = parse_command_line_args() # Create Log Handler stream_sequence_logs(sys.stdout, debug_level) # Load sequence engine = SequenceEngine() try: engine.load(file_name, depth, backup) except Exception as exc: print(exc) return # Wait for input try: res = raw_input("Press 'r' to run, any other key to abort: ") except KeyboardInterrupt: res = 'a' if res.lower() == 'r': print("RUN") engine.start() boolean = False while not boolean: try: boolean = engine.wait(1) except KeyboardInterrupt: print("USER STOP") engine.interrupt() print("FINISHED")
def closeEvent(self, event): """ Override closeEvent to handle secial cases """ if not self.reset(): event.ignore() # Main execution if __name__ == '__main__': # Imports to test the widget import sequence from sequence.core.engine import stream_sequence_logs # Create the widget stream_sequence_logs(sys.stdout) app = QtGui.QApplication(sys.argv) def print_in_console(msg, end): print(msg) ui = ControlWidget(log_signal=print_in_console) path = os.path.join( os.path.dirname(sequence.__file__), os.pardir, "examples", "BranchTest.xml") ui.set_path(path) ui.enable() ui.show() # Run the widget sys.exit(app.exec_())
#### Close Event #### def closeEvent(self, event): """ Override closeEvent to handle secial cases """ if not self.reset(): event.ignore() # Main execution if __name__ == '__main__': # Imports to test the widget import sequence from sequence.core.engine import stream_sequence_logs # Create the widget stream_sequence_logs(sys.stdout) app = QtGui.QApplication(sys.argv) def print_in_console(msg, end): print(msg) ui = ControlWidget(log_signal=print_in_console) path = os.path.join(os.path.dirname(sequence.__file__), os.pardir, "examples", "BranchTest.xml") ui.set_path(path) ui.enable() ui.show() # Run the widget sys.exit(app.exec_())