| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Example python application implementing the Echo service.""" | 5 """Example python application implementing the Echo service.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 import example_service_mojom | 9 import example_service_mojom |
| 10 from mojo_application import application_delegate | 10 from mojo_application import application_delegate |
| 11 from mojo_application import service_provider_impl | 11 from mojo_application import service_provider_impl |
| 12 from mojo_application import application_runner | 12 from mojo_application import application_runner |
| 13 | 13 |
| 14 import mojo_system | 14 import mojo_system |
| 15 | 15 |
| 16 class ExampleApp(application_delegate.ApplicationDelegate): | 16 class ExampleApp(application_delegate.ApplicationDelegate): |
| 17 def OnAcceptConnection(self, service_provider, requestor_url, | 17 def OnAcceptConnection(self, service_provider, requestor_url, |
| 18 exposed_services): | 18 exposed_services, resolved_url): |
| 19 service_provider.AddService(ExampleServiceImpl) | 19 service_provider.AddService(ExampleServiceImpl) |
| 20 return True | 20 return True |
| 21 | 21 |
| 22 | 22 |
| 23 class ExampleServiceImpl(example_service_mojom.ExampleService): | 23 class ExampleServiceImpl(example_service_mojom.ExampleService): |
| 24 def Ping(self, ping_value): | 24 def Ping(self, ping_value): |
| 25 return ping_value | 25 return ping_value |
| 26 | 26 |
| 27 | 27 |
| 28 def MojoMain(app_request_handle): | 28 def MojoMain(app_request_handle): |
| 29 application_runner.RunMojoApplication(ExampleApp(), app_request_handle) | 29 application_runner.RunMojoApplication(ExampleApp(), app_request_handle) |
| OLD | NEW |