Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: examples/python/__mojo__.py

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: hate Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698