Skip to content

Instantly share code, notes, and snippets.

View hodgestar's full-sized avatar
🐢

Simon Cross hodgestar

🐢
View GitHub Profile
@hodgestar
hodgestar / wrapping.py
Created October 17, 2011 06:23
Wrapping large blocks of text in which whitespace is important
class WikipediaTestCase(TestCase):
def setUp(self):
self.sample_xml = ("""<?xml version="1.0"?>
<SearchSuggestion xmlns="http://opensearch.org/searchsuggest2"
version="2.0">
<Query xml:space="preserve">africa</Query>
<Section>
<Item>
<Text xml:space="preserve">Africa</Text>
<Description xml:space="preserve">Africa is the world's"""
@hodgestar
hodgestar / redis-error
Created October 28, 2011 09:22
Redis error log
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Starting a CropPriceWorker worker with config: {'transport_name': 'integrat', 'worker_name': 'ussd_crop_prices', 'api_url': 'http://127.0.0.1:8000/api/v1'}
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Started the publisher
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Staring IntegratInboundDynamicConsumer with {'exchange_name': 'vumi', 'queue_name': 'integrat.inbound', 'routing_key': 'integrat.inbound', 'durable': True, 'exchange_type': 'direct'}
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Consumer starting...
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Staring IntegratEventDynamicConsumer with {'exchange_name': 'vumi', 'queue_name': 'integrat.event', 'routing_key': 'integrat.event', 'durable': True, 'exchange_type': 'direct'}
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Unhandled error in Deferred:
2011-10-28 09:19:59+0000 [WorkerAMQClient,client] Unhandled Error
Traceback (most recent call last):
File "/vol/var/pr
@hodgestar
hodgestar / vas2nets-subservice-override
Created November 21, 2011 13:24
Vas2nets subservice override fix
diff --git a/vumi/transports/vas2nets/vas2nets.py b/vumi/transports/vas2nets/vas2nets.py
index 06ef000..6ba1c03 100644
--- a/vumi/transports/vas2nets/vas2nets.py
+++ b/vumi/transports/vas2nets/vas2nets.py
@@ -252,8 +252,9 @@ class Vas2NetsTransport(Transport):
'provider': message['transport_metadata']['network_id'],
'tariff': message['transport_metadata'].get('tariff', 0),
'text': validate_characters(message['content']),
- 'subservice': message['transport_metadata'].get(
- 'keyword', self.config['subservice']),
@hodgestar
hodgestar / gist:1442491
Created December 7, 2011 11:34
Telnet test fix
diff --git a/vumi/transports/telnet/tests/test_telnet.py b/vumi/transports/telnet/tests/test_telnet.py
index e5a72d0..4e407fc 100644
--- a/vumi/transports/telnet/tests/test_telnet.py
+++ b/vumi/transports/telnet/tests/test_telnet.py
@@ -35,6 +35,7 @@ class TelnetServerTransportTestCase(TransportTestCase):
super(TelnetServerTransportTestCase, self).setUp()
self.worker = yield self.get_transport({'telnet_port': 0})
self.client = yield self.make_client()
+ yield self.wait_for_client_start()
@hodgestar
hodgestar / transport_metadata.rst
Created January 23, 2012 22:15
Vumi transport_metadata overview

An enumeration of current transport metadata.

HttpRpcTransport based Transports

Unless otherwise noted, these only support outbound messages that are replies to a previous message and only one reply per message.

api.oldapi

@hodgestar
hodgestar / dispatcher-doc-fixes
Created April 5, 2012 09:38
Dispatcher doc fixes
diff --git a/docs/dispatchers.rst b/docs/dispatchers.rst
index fb87be6..50ad0d1 100644
--- a/docs/dispatchers.rst
+++ b/docs/dispatchers.rst
@@ -17,11 +17,14 @@ Examples of use cases for dispatchers:
* A single application that sends and receives both SMSes and XMPP
messages.
-* A single SMPP transports that sends and receives SMSes on behalf of
+* A single application that sends and receives SMSes in multiple
;; fly-make-mode for Python
;; pycheck is in ~/bin
(when (load "flymake" t)
(defun flymake-python-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
[ui]
merge=internal:merge
[pager]
pager = less -R
[extensions]
mq =
fetch =
rebase =
[ui]
merge=internal:merge
[pager]
pager = less -R
[extensions]
mq =
fetch =
rebase =
[ui]
merge=internal:merge
[pager]
pager = less -R
[extensions]
mq =
fetch =
rebase =