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() |