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

Unified Diff: third_party/gsutil/third_party/protorpc/demos/hello/server/services.py

Issue 1377933002: [catapult] - Copy Telemetry's gsutilz over to third_party. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Rename to gsutil. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/gsutil/third_party/protorpc/demos/hello/server/services.py
diff --git a/third_party/pipeline/pipeline/handlers.py b/third_party/gsutil/third_party/protorpc/demos/hello/server/services.py
similarity index 52%
copy from third_party/pipeline/pipeline/handlers.py
copy to third_party/gsutil/third_party/protorpc/demos/hello/server/services.py
index dfa248cfb90eea106045f133d61cf81e39cb4c3e..9ab3a7e3c462f408d696b47a78734dbf863c3c46 100755
--- a/third_party/pipeline/pipeline/handlers.py
+++ b/third_party/gsutil/third_party/protorpc/demos/hello/server/services.py
@@ -13,24 +13,35 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+#
+
+import appengine_config
+
+from protorpc import messages
+from protorpc import remote
+from protorpc.webapp import service_handlers
+
+
+class HelloRequest(messages.Message):
+
+ my_name = messages.StringField(1, required=True)
-"""Web request dispatcher for the Google App Engine Pipeline API.
-In a separate file from the core pipeline module to break circular dependencies.
-"""
+class HelloResponse(messages.Message):
-from google.appengine.ext import webapp
-from google.appengine.ext.webapp import util as webapp_util
+ hello = messages.StringField(1, required=True)
-import pipeline
+class HelloService(remote.Service):
-_APP = webapp.WSGIApplication(pipeline.create_handlers_map(), debug=True)
+ @remote.method(HelloRequest, HelloResponse)
+ def hello(self, request):
+ return HelloResponse(hello='Hello there, %s!' % request.my_name)
-def _main():
- webapp_util.run_wsgi_app(_APP)
+def main():
+ service_handlers.run_services([('/hello', HelloService)])
if __name__ == '__main__':
- _main()
+ main()

Powered by Google App Engine
This is Rietveld 408576698