import pprint
import urllib
import urllib2

from .utils import Backend

class UrllibBackend(Backend):
    def send(self, url, data):
        request = urllib2.Request(url, data=urllib.urlencode(data))

        urllib2.urlopen(request)

class RequestsBackend(Backend):
    def __init__(self):
        # Lazily import to avoid dependency
        import requests

        self.session = requests.Session()

    def send(self, url, data):
        result = self.session.post(url, data=data, verify=False).json()

        if not result['ok']:
            raise ValueError(result['error'])

class ConsoleBackend(Backend):
    def send(self, url, data):
        print "I: Slack message:"
        pprint.pprint(data, indent=4)
        print "-" * 79

class DisabledBackend(Backend):
    def send(self, url, data):
        pass

@@ -138,18 +138,24 @@
     
-request = 
+urllib2.urlopen(
 urll
@@ -203,41 +203,8 @@
 ta))
-%0A%0A        urllib2.urlopen(request
 )%0A%0Ac

Can inline this