def setUp(self): super(TestDialogController, self).setUp() self.pending_tasks = [] self.timer_tasks = [] self.stub_camera = stub_android.StubCamera() self.camera_factory = stub_android.CameraFactory(self.stub_camera) self.savedInstanceState = {} self.activityA = stub_android.StubActivity() self.activityA.delegate_instance = \ camera_controller.CameraController(self.activityA, self.pending_tasks, self.timer_tasks, self.camera_factory) self.activityB = stub_android.StubActivity() self.activityB.delegate_instance = \ camera_controller.CameraController(self.activityB, self.pending_tasks, self.timer_tasks, self.camera_factory)
def add_entities(): gs.camera_controller = camera_controller.CameraController() gs.action_display = action_display.ActionDisplay() gs.register_entity(gs.camera_controller) gs.register_entity(gs.action_display) gs.register_entity(window_control_entity.WindowControlEntity())
def __init__(self): config.Config.instance().set_app_pointer(self) self.logger = log.create_logger('', log.LOG_FILE) self.logger.info("Starting 3DPrinterOS client. Version %s_%s" % (version.version, version.build)) self.logger.info('Operating system: ' + platform.system() + ' ' + platform.release()) signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) self.detected_printers = [] self.network_printers = [] self.printer_interfaces = [] self.virtual_printer_enabled = False self.network_detect_flag = False self.stop_flag = False self.closing_status = [] self.rights_checker_waiter = rights.RightsCheckerWaiter(self) self.conveyor_kill_waiter = makerware_utils.ConveyorKillWaiter(self) self.network_connection_checker = http_client.NetworkConnectionChecker( self) self.init_interface() self.rights_checker_waiter.wait() self.conveyor_kill_waiter.wait() self.network_connection_checker.wait() self.updater = updater.Updater() self.user_login = user_login.UserLogin(self) self.user_login.wait() if self.user_login.user_token and hasattr(self.user_login, "profiles"): config.Config.instance().set_profiles(self.user_login.profiles) self.virtual_printer_enabled = config.get_settings( )['virtual_printer']['enabled'] self.tray_controller = tray_controller.TrayController() self.camera_controller = camera_controller.CameraController(self.user_login.user_token,\ self.user_login.http_client.mac) self.cloud_sync_controller = cloud_sync_controller.CloudSyncController( ) else: self.logger.error( "Can't retrieve user login or printer profiles. Exiting...") self.quit()
def __init__(self): self.set_reboot_flag(False) self.logger = log.create_logger("app", log.LOG_FILE) self.logger.info("Starting 3DPrinterOS client. Version %s_%s" % (version.version, version.build)) self.logger.info('Operating system: ' + platform.system() + ' ' + platform.release()) self.time_stamp() signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) self.detected_printers = [] self.printer_interfaces = [] self.stop_flag = False self.updater = updater.Updater() self.rights_checker_and_waiter = rights.RightsCheckerAndWaiter(self) self.user_login = user_login.UserLogin(self) self.init_interface() self.rights_checker_and_waiter.wait() if self.user_login.wait_for_login(): config.Config.instance().set_profiles(self.user_login.profiles) if config.get_settings()["camera"]["enabled"]: self.camera_controller = camera_controller.CameraController() self.cloud_sync_controller = cloud_sync_controller.CloudSyncController( )