コード例 #1
0
ファイル: _launcher.py プロジェクト: uglide/autopilot-docs
    def _stop_application(self, app_id):
        state = {}
        state['loop'] = self._get_glib_loop()
        state['expected_app_id'] = app_id

        UbuntuAppLaunch.observer_add_app_stop(self._on_stopped, state)
        GLib.timeout_add_seconds(10.0, self._on_timeout, state)

        UbuntuAppLaunch.stop_application(app_id)
        state['loop'].run()
        UbuntuAppLaunch.observer_delete_app_stop(self._on_stopped)

        if state.get('status', None) == UpstartApplicationLauncher.Timeout:
            _logger.error(
                "Timed out waiting for Application with app_id '%s' to stop.",
                app_id)
コード例 #2
0
 def stop(self):
     UAL.stop_application(self.appid)