From a54d0d9a36b08a49b4510c85c125a4ff295207d3 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Sat, 5 Sep 2015 12:15:56 +0200 Subject: [PATCH] fix more URI types in examples --- examples/asyncio/wamp/rpc/errors/backend.py | 8 ++++---- examples/asyncio/wamp/rpc/errors/frontend.py | 2 +- examples/asyncio/wamp/rpc/slowsquare/backend.py | 2 +- examples/twisted/wamp/pubsub/basic/backend.py | 2 +- examples/twisted/wamp/pubsub/basic/frontend.py | 2 +- examples/twisted/wamp/pubsub/options/backend.py | 2 +- examples/twisted/wamp/rpc/errors/backend.py | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/asyncio/wamp/rpc/errors/backend.py b/examples/asyncio/wamp/rpc/errors/backend.py index 90f63d92..b9d65a94 100644 --- a/examples/asyncio/wamp/rpc/errors/backend.py +++ b/examples/asyncio/wamp/rpc/errors/backend.py @@ -38,7 +38,7 @@ from autobahn.wamp.exception import ApplicationError from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner -@wamp.error("com.myapp.error1") +@wamp.error(u"com.myapp.error1") class AppError1(Exception): """ An application specific exception that is decorated with a WAMP URI, @@ -69,15 +69,15 @@ class Component(ApplicationSession): ## def checkname(name): if name in ['foo', 'bar']: - raise ApplicationError("com.myapp.error.reserved") + raise ApplicationError(u"com.myapp.error.reserved") if name.lower() != name.upper(): # forward positional arguments in exceptions - raise ApplicationError("com.myapp.error.mixed_case", name.lower(), name.upper()) + raise ApplicationError(u"com.myapp.error.mixed_case", name.lower(), name.upper()) if len(name) < 3 or len(name) > 10: # forward keyword arguments in exceptions - raise ApplicationError("com.myapp.error.invalid_length", min=3, max=10) + raise ApplicationError(u"com.myapp.error.invalid_length", min=3, max=10) yield from self.register(checkname, u'com.myapp.checkname') diff --git a/examples/asyncio/wamp/rpc/errors/frontend.py b/examples/asyncio/wamp/rpc/errors/frontend.py index db841106..07144087 100644 --- a/examples/asyncio/wamp/rpc/errors/frontend.py +++ b/examples/asyncio/wamp/rpc/errors/frontend.py @@ -38,7 +38,7 @@ from autobahn.wamp.exception import ApplicationError from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner -@wamp.error("com.myapp.error1") +@wamp.error(u"com.myapp.error1") class AppError1(Exception): """ An application specific exception that is decorated with a WAMP URI, diff --git a/examples/asyncio/wamp/rpc/slowsquare/backend.py b/examples/asyncio/wamp/rpc/slowsquare/backend.py index 3103534f..31b5b44e 100644 --- a/examples/asyncio/wamp/rpc/slowsquare/backend.py +++ b/examples/asyncio/wamp/rpc/slowsquare/backend.py @@ -53,7 +53,7 @@ class Component(ApplicationSession): return x * x yield from self.register(slowsquare, u'com.math.slowsquare') - print("Registered 'com.math.slowsquare'") + print("Registered com.math.slowsquare") if __name__ == '__main__': diff --git a/examples/twisted/wamp/pubsub/basic/backend.py b/examples/twisted/wamp/pubsub/basic/backend.py index ca5135fa..ad667f7c 100644 --- a/examples/twisted/wamp/pubsub/basic/backend.py +++ b/examples/twisted/wamp/pubsub/basic/backend.py @@ -43,7 +43,7 @@ class Component(ApplicationSession): print("session attached") counter = 0 while True: - print('backend publishing "com.myapp.topic1"', counter) + print('backend publishing com.myapp.topic1', counter) self.publish(u'com.myapp.topic1', counter) counter += 1 yield sleep(1) diff --git a/examples/twisted/wamp/pubsub/basic/frontend.py b/examples/twisted/wamp/pubsub/basic/frontend.py index 01e252d2..6c4d5588 100644 --- a/examples/twisted/wamp/pubsub/basic/frontend.py +++ b/examples/twisted/wamp/pubsub/basic/frontend.py @@ -44,7 +44,7 @@ class Component(ApplicationSession): print("session attached") self.received = 0 sub = yield self.subscribe(self.on_event, u'com.myapp.topic1') - print("Subscribed to 'com.myapp.topic1' with {}".format(sub.id)) + print("Subscribed to com.myapp.topic1 with {}".format(sub.id)) def on_event(self, i): print("Got event: {}".format(i)) diff --git a/examples/twisted/wamp/pubsub/options/backend.py b/examples/twisted/wamp/pubsub/options/backend.py index e5d993c2..35e8df5d 100644 --- a/examples/twisted/wamp/pubsub/options/backend.py +++ b/examples/twisted/wamp/pubsub/options/backend.py @@ -57,7 +57,7 @@ class Component(ApplicationSession): exclude_me=False ) publication = yield self.publish( - 'com.myapp.topic1', counter, + u'com.myapp.topic1', counter, options=pub_options, ) print("Published with publication ID {}".format(publication.id)) diff --git a/examples/twisted/wamp/rpc/errors/backend.py b/examples/twisted/wamp/rpc/errors/backend.py index 4aaaea3c..63101696 100644 --- a/examples/twisted/wamp/rpc/errors/backend.py +++ b/examples/twisted/wamp/rpc/errors/backend.py @@ -66,15 +66,15 @@ class Component(ApplicationSession): ## def checkname(name): if name in ['foo', 'bar']: - raise ApplicationError("com.myapp.error.reserved") + raise ApplicationError(u"com.myapp.error.reserved") if name.lower() != name.upper(): # forward positional arguments in exceptions - raise ApplicationError("com.myapp.error.mixed_case", name.lower(), name.upper()) + raise ApplicationError(u"com.myapp.error.mixed_case", name.lower(), name.upper()) if len(name) < 3 or len(name) > 10: # forward keyword arguments in exceptions - raise ApplicationError("com.myapp.error.invalid_length", min=3, max=10) + raise ApplicationError(u"com.myapp.error.invalid_length", min=3, max=10) yield self.register(checkname, u'com.myapp.checkname')