Permalink
Browse files

PEP code cleanups in providers.py

  • Loading branch information...
1 parent d996f46 commit 700e180c72cddc605f5348072ce6e25e34f8e3e3 @vdboor vdboor committed Mar 17, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 micawber/providers.py
View
7 micawber/providers.py
@@ -3,7 +3,6 @@
import re
import socket
import urllib2
-import sys
from urllib import urlencode
try:
import simplejson as json
@@ -72,6 +71,7 @@ def handle_response(self, response, url):
def make_key(*args, **kwargs):
return hashlib.md5(pickle.dumps((args, kwargs))).hexdigest()
+
def url_cache(fn):
def inner(self, url, **params):
if self.cache:
@@ -84,6 +84,7 @@ def inner(self, url, **params):
return fn(self, url, **params)
return inner
+
class ProviderRegistry(object):
def __init__(self, cache=None):
self._registry = {}
@@ -114,9 +115,9 @@ def request(self, url, **params):
def bootstrap_basic(cache=None):
# complements of oembed.com#section7
pr = ProviderRegistry(cache)
-
+
# b
- pr.register('http://blip.tv/\S+', Provider('http://blip.tv/oembed'))
+ pr.register('http://blip.tv/\S+', Provider('http://blip.tv/oembed'))
# c
pr.register('http://chirb.it/\S+', Provider('http://chirb.it/oembed.json'))

0 comments on commit 700e180

Please sign in to comment.