Skip to content

Commit 9c7ba5e

Browse files
committed
Tidying. Additional gitignore lines. Don't need the conditional simplejson because we don't support Python 2.5.
1 parent 3369502 commit 9c7ba5e

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.pyc
2-
Embedly.egg-info/
2+
*.egg-info/
3+
.tox/
34
build/
45
dist/
56
.virtualenv

embedly/client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def get_services(self):
5353
the list of supported providers and their regexes
5454
"""
5555

56-
if self.services: return self.services
56+
if self.services:
57+
return self.services
5758

5859
url = 'http://api.embed.ly/1/services/python'
5960

@@ -66,10 +67,10 @@ def get_services(self):
6667
resp_data = json.loads(content)
6768
self.services = resp_data
6869

69-
#build the regex that we can use later.
70+
# build the regex that we can use later
7071
_regex = []
7172
for each in self.get_services():
72-
_regex.append('|'.join(each.get('regex',[])))
73+
_regex.append('|'.join(each.get('regex', [])))
7374

7475
self._regex = re.compile('|'.join(_regex))
7576

@@ -100,10 +101,10 @@ def _get(self, version, method, url_or_urls, **kwargs):
100101
raise ValueError('%s requires a url or a list of urls given: %s' %
101102
(method.title(), url_or_urls))
102103

103-
#A flag we can use instead of calling isinstance all the time.
104+
# a flag we can use instead of calling isinstance() all the time
104105
multi = isinstance(url_or_urls, list)
105106

106-
# Throw an error early for too many URLs
107+
# throw an error early for too many URLs
107108
if multi and len(url_or_urls) > 20:
108109
raise ValueError('Embedly accepts only 20 urls at a time. Url '
109110
'Count:%s' % len(url_or_urls))
@@ -112,7 +113,7 @@ def _get(self, version, method, url_or_urls, **kwargs):
112113

113114
key = kwargs.get('key', self.key)
114115

115-
#make sure that a key was set on the client or passed in.
116+
# make sure that a key was set on the client or passed in
116117
if not key:
117118
raise ValueError('Requires a key. None given: %s' % key)
118119

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33
import codecs
44
from setuptools import setup
55

6-
extra = {}
7-
86
required = ['httplib2']
97
tests_require = []
108

119
if sys.version_info[:2] < (2, 7):
1210
tests_require.append('unittest2')
1311

14-
if sys.version_info[:2] < (2, 6):
15-
required.append('simplejson')
1612

1713
def get_version():
1814
with open(os.path.join('embedly', '__init__.py')) as f:
@@ -53,6 +49,5 @@ def get_version():
5349
'Programming Language :: Python :: 2.7',
5450
'Programming Language :: Python :: 3.2',
5551
'Programming Language :: Python :: 3.3',
56-
),
57-
**extra
52+
)
5853
)

0 commit comments

Comments
 (0)