Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Fix up wikipedia to work with the new app_worker config.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Jan 8, 2014
1 parent 4881db6 commit 4800b2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions go/apps/wikipedia/vumi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

from vumi_wikipedia.wikipedia import WikipediaWorker, TimerWrapper

from go.vumitools.app_worker import GoApplicationMixin, GoWorkerConfigMixin
from go.vumitools.app_worker import (
GoApplicationMixin, GoApplicationConfigMixin)
from go.vumitools.metrics import ConversationMetric


class WikipediaConfig(WikipediaWorker.CONFIG_CLASS, GoWorkerConfigMixin):
class WikipediaConfig(WikipediaWorker.CONFIG_CLASS, GoApplicationConfigMixin):
pass


Expand Down Expand Up @@ -37,7 +38,7 @@ def fire_metric(self, config, metric_name, metric_suffix=None, value=1):
pass

def get_timer_metric(self, config, metric_name):
metric = ConversationMetric(config.get_conversation(), metric_name)
metric = ConversationMetric(config.conversation, metric_name)
# TODO: Make this less horrible.
metric.set = lambda value: metric.oneshot(self.metrics, value)
return TimerWrapper(metric)
Expand All @@ -47,7 +48,7 @@ def get_config(self, msg):

def send_sms_non_reply(self, msg, config, sms_content):
helper_metadata = {}
config.get_conversation().set_go_helper_metadata(helper_metadata)
config.conversation.set_go_helper_metadata(helper_metadata)
return self.send_to(
msg['from_addr'], sms_content, transport_type='sms',
endpoint='sms_content', helper_metadata=helper_metadata)

0 comments on commit 4800b2e

Please sign in to comment.