def main(): """Create an App and start the main loop.""" app = application.App() app.main_loop() """ clean up when main loop exits """ pg.quit() sys.exit()
def visualization(self): #Level is usued to keep track of which location we are currently on """ level 1 --> loc_1, so on and so forth """ level = 0 Selected_loc = generate(self.Chosen_locs, self.raw, self.c_f, level, Top=None) #Get all the partnumber from the selected_loc App = application.App(self.raw, self.c_f, Selected_loc, self.loc_1, self.loc_2, self.loc_3, self.loc_4, self.loc_5, level, Top=None, title='Root', parent=None) App.exec_()
def getapp(): print('getapp starts') app = application.App() yield app app.shutdown() print('getapp ends')
def buttonClicked(raw, c_f, top_loc, next_loc_dic, loc_2, loc_3, loc_4, loc_5, level, Top, title, parent, stop): if level > 4: mkmsg('Reaching the end') # App.exec_() #Need to maintain the Top as always the loc_1 print(top_loc) title = top_loc #Now we know that it's in the absolute top location if next_loc_dic == loc_2: Top = top_loc top_dic = generate(next_loc_dic[top_loc], raw, c_f, level, Top) print(len(next_loc_dic[top_loc])) #Close the previous application stop() App = application.App(raw, c_f, top_dic, next_loc_dic, loc_2, loc_3, loc_4, loc_5, level, Top, title, parent, stop) App.exec_()
pygame.init() # Create and register sensors. They start receiving messages as soon as they are registered # Image sensor image_sensor = imagesensor.ImageSensor(configuration) image_sensor.register(configuration.topic.camera.compressed) # Forward distance sensor forward_distance_sensor = distancesensor.DistanceSensor( configuration.sensor.distance.forward) forward_distance_sensor.register( configuration.sensor.distance.forward.topic) # Backward distance sensor backward_distance_sensor = distancesensor.DistanceSensor( configuration.sensor.distance.backward) backward_distance_sensor.register( configuration.sensor.distance.backward.topic) # Create and register the controller controller = controller.HybridController(configuration) controller.register() # Initialize this application as an ROS node, otherwise we can not communicate with the ROS system rospy.init_node(configuration.ros.node.name, anonymous=True) # Instantiate the pygame app app = application.App(configuration, image_sensor, controller, forward_distance_sensor, backward_distance_sensor) app.on_execute()
''' Conversor de layout para os arquivos de dados gerados para o SIAPC/PAD do TCE/RS Este conversor de layout lê os dados constantes nos arquivos gerados no layout de importação pelo SIAPC/PAD e os trasnforma em outros formatos. Este arquivo é o módulo principal que chama o módulo Controller. Este software é distribuído sob a licença MIT. ''' import sys import os import gui import application if __name__ == '__main__': GUI = gui.Window() CONVERSOR = application.App(GUI) CONVERSOR.run()
def app(): print('app starts') myapp = application.App() return myapp
def test_add_user_bar(): app = application.App() app.add_user("Bar") assert app.get_user() == 'Bar'
def test_add_user_foo(): app = application.App() app.add_user("Foo") assert app.get_user() == 'Foo'
""" Main script for the serial terminal application """ import application as app #creating the application APP = app.App() if __name__ == "__main__": #launching the user interface APP.launch()