Skip to content

Instantly share code, notes, and snippets.

/-

Created August 7, 2013 13:43
Show Gist options
  • Save anonymous/6174162 to your computer and use it in GitHub Desktop.
Save anonymous/6174162 to your computer and use it in GitHub Desktop.
diff --git a/go/vumitools/api.py b/go/vumitools/api.py
index bbeea11..2cada49 100644
--- a/go/vumitools/api.py
+++ b/go/vumitools/api.py
@@ -140,6 +140,10 @@ class VumiUserApi(object):
if conversation:
returnValue(self.wrap_conversation(conversation))
+ def get_conversation(self, conversation_key):
+ return self.conversation_store.get_conversation_by_key(
+ conversation_key)
+
def get_router(self, router_key):
return self.router_store.get_router_by_key(router_key)
@@ -201,9 +205,7 @@ class VumiUserApi(object):
channels = []
endpoints = yield self.list_endpoints()
for tag in endpoints:
- tagpool_meta = yield self.api.tpm.get_metadata(tag[0])
- channel = yield self.channel_store.get_channel_by_tag(
- tag, tagpool_meta)
+ channel = yield self.get_channel(tag)
channels.append(channel)
returnValue(channels)
diff --git a/go/vumitools/app_worker.py b/go/vumitools/app_worker.py
index 0e00837..7fb3a9c 100644
--- a/go/vumitools/app_worker.py
+++ b/go/vumitools/app_worker.py
@@ -6,7 +6,6 @@ from vumi import log
from vumi.worker import BaseWorker
from vumi.application import ApplicationWorker
from vumi.blinkenlights.metrics import MetricManager, Metric, MAX
-from vumi.message import TransportEvent
from vumi.config import IConfigData, ConfigText, ConfigDict
from go.vumitools.api import VumiApiCommand, VumiApi, VumiApiEvent
diff --git a/go/vumitools/router/definition.py b/go/vumitools/router/definition.py
index 19db47d..194b04b 100644
--- a/go/vumitools/router/definition.py
+++ b/go/vumitools/router/definition.py
@@ -1,5 +1,3 @@
-
-
class RouterDefinitionBase(object):
"""Definition of router lifecycle and possible actions.
"""
@@ -10,6 +8,10 @@ class RouterDefinitionBase(object):
extra_static_inbound_endpoints = ()
extra_static_outbound_endpoints = ()
+ # set to an sub-class of go.api.go_api.action_dispatcher
+ # .RouterActionDispatcher to provide API methods
+ api_dispatcher_cls = None
+
def __init__(self, router=None):
self.router = router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment