Skip to content

Commit 7b3ddff

Browse files
committed
Consistent version numbering for 0.2.5 release.
1 parent 82d3f2f commit 7b3ddff

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Changelog
33
=========
44

5+
* 0.2.5
6+
* Consistent version numbering (docs and code).
57
* 0.2.4
68
* Handle invalid JSON responses. (https://github.com/marselester)
79
* Fix to doctests to pass with current Intercom dummy API.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444

4545
# General information about the project.
4646
project = u'python-intercom'
47-
copyright = u'2012, John Keyes'
47+
copyright = u'2013, John Keyes'
4848

4949
# The version info for the project you're documenting, acts as replacement for
5050
# |version| and |release|, also used in various other places throughout the
5151
# built documents.
5252
#
5353
# The short X.Y version.
54-
version = '0.2.4'
54+
version = '0.2.5'
5555
# The full version, including alpha/beta/rc tags.
5656
release = version
5757

intercom/intercom.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# License: http://jkeyes.mit-license.org/
55
#
6-
""" intercom module
6+
""" intercom module
77
88
All of the API requests are created, and the API responses are parsed here.
99
@@ -74,7 +74,7 @@ class Intercom(object):
7474
def _call(cls, method, url, params=None):
7575
""" Construct an API request, send it to the API, and parse the response. """
7676
req_params = {}
77-
headers = { 'User-Agent': 'python-intercom/0.1', 'Accept': 'application/json' }
77+
headers = { 'User-Agent': 'python-intercom/0.2.5', 'Accept': 'application/json' }
7878
if method in ('POST', 'PUT'):
7979
headers['content-type'] = 'application/json'
8080
req_params['data'] = json.dumps(params)
@@ -83,20 +83,20 @@ def _call(cls, method, url, params=None):
8383
req_params['headers'] = headers
8484

8585
resp = requests.request(method, url, timeout=Intercom.timeout, \
86-
auth=(Intercom.app_id, Intercom.api_key),
86+
auth=(Intercom.app_id, Intercom.api_key),
8787
**req_params)
8888
return resp
8989

9090
@classmethod
9191
def _create_or_update_user(cls, method, **kwargs):
9292
""" Used by create_user and update_user. """
93-
user_dict = Intercom._call(method, Intercom.api_endpoint + 'users',
93+
user_dict = Intercom._call(method, Intercom.api_endpoint + 'users',
9494
params=kwargs)
9595
return user_dict
9696

9797
@classmethod
9898
def get_users(cls):
99-
""" Return a dict for the user represented by the specified email or user_id.
99+
""" Return a dict for the user represented by the specified email or user_id.
100100
101101
>>> result = Intercom.get_users()
102102
>>> type(result)
@@ -110,7 +110,7 @@ def get_users(cls):
110110

111111
@classmethod
112112
def get_user(cls, email=None, user_id=None):
113-
""" Return a dict for the user represented by the specified email or user_id.
113+
""" Return a dict for the user represented by the specified email or user_id.
114114
115115
>>> user = Intercom.get_user(user_id='123')
116116
>>> user['name']
@@ -123,9 +123,9 @@ def get_user(cls, email=None, user_id=None):
123123
return user_dict
124124

125125
@classmethod
126-
def create_user(cls, user_id=None, email=None, name=None, created_at=None,
126+
def create_user(cls, user_id=None, email=None, name=None, created_at=None,
127127
custom_data=None, last_seen_ip=None, last_seen_user_agent=None):
128-
""" Create a user from the available parameters.
128+
""" Create a user from the available parameters.
129129
130130
>>> from datetime import datetime
131131
>>> import time
@@ -139,14 +139,14 @@ def create_user(cls, user_id=None, email=None, name=None, created_at=None,
139139
u'smuggler'
140140
141141
"""
142-
return Intercom._create_or_update_user('POST', user_id=user_id, email=email,
143-
name=name, created_at=created_at, custom_data=custom_data,
142+
return Intercom._create_or_update_user('POST', user_id=user_id, email=email,
143+
name=name, created_at=created_at, custom_data=custom_data,
144144
last_seen_ip=last_seen_ip, last_seen_user_agent=last_seen_user_agent)
145145

146146
@classmethod
147-
def update_user(cls, user_id=None, email=None, name=None, created_at=None,
147+
def update_user(cls, user_id=None, email=None, name=None, created_at=None,
148148
custom_data=None, last_seen_ip=None, last_seen_user_agent=None):
149-
""" Update a user with the available parameters.
149+
""" Update a user with the available parameters.
150150
151151
>>> user = Intercom.get_user(user_id='123')
152152
>>> user['name']
@@ -157,31 +157,31 @@ def update_user(cls, user_id=None, email=None, name=None, created_at=None,
157157
158158
"""
159159
return Intercom._create_or_update_user('PUT', user_id=user_id, email=email,
160-
name=name, created_at=created_at, custom_data=custom_data,
160+
name=name, created_at=created_at, custom_data=custom_data,
161161
last_seen_ip=last_seen_ip, last_seen_user_agent=last_seen_user_agent)
162162

163163
@classmethod
164164
def create_impression(cls, user_id=None, email=None, user_ip=None,
165165
user_agent=None, location=None):
166-
""" Create an impression.
166+
""" Create an impression.
167167
168168
>>> result = Intercom.create_impression(email="somebody@example.com",
169169
... user_agent="MyApp/1.0", user_ip="2.3.4.5")
170170
>>> result['unread_messages']
171171
1
172172
173173
"""
174-
params = { 'email': email, 'user_id': user_id, 'user_ip': user_ip,
174+
params = { 'email': email, 'user_id': user_id, 'user_ip': user_ip,
175175
'user_agent': user_agent, 'location': location }
176-
user_dict = Intercom._call('POST', Intercom.api_endpoint + 'users/impressions',
176+
user_dict = Intercom._call('POST', Intercom.api_endpoint + 'users/impressions',
177177
params=params)
178178
return user_dict
179179

180180
@classmethod
181181
def get_message_threads(cls, user_id=None, email=None, thread_id=None):
182-
""" If a thread_id is specified, this returns a specific MessageThread
182+
""" If a thread_id is specified, this returns a specific MessageThread
183183
(if it can find one), otherwise it returns all MessageThreads for the
184-
particular user.
184+
particular user.
185185
186186
>>> message_threads = Intercom.get_message_threads(email="somebody@example.com")
187187
>>> type(message_threads)
@@ -193,15 +193,15 @@ def get_message_threads(cls, user_id=None, email=None, thread_id=None):
193193
194194
"""
195195
params = { 'email': email, 'user_id': user_id, 'thread_id': thread_id }
196-
msg_dict = Intercom._call('GET', Intercom.api_endpoint + 'users/message_threads',
197-
params=params)
196+
msg_dict = Intercom._call('GET', Intercom.api_endpoint + 'users/message_threads',
197+
params=params)
198198
return msg_dict
199199

200200
@classmethod
201201
def create_message_thread(cls, user_id=None, email=None, body=None):
202-
""" Create a MessageThread.
202+
""" Create a MessageThread.
203203
204-
>>> message_thread = Intercom.create_message_thread(email="somebody@example.com",
204+
>>> message_thread = Intercom.create_message_thread(email="somebody@example.com",
205205
... body="Uh, everything's under control. Situation normal.")
206206
>>> message_thread['thread_id']
207207
5591
@@ -212,16 +212,16 @@ def create_message_thread(cls, user_id=None, email=None, body=None):
212212
213213
"""
214214
params = { 'email': email, 'user_id': user_id, 'body': body }
215-
user_dict = Intercom._call('POST', Intercom.api_endpoint + 'users/message_threads',
216-
params=params)
215+
user_dict = Intercom._call('POST', Intercom.api_endpoint + 'users/message_threads',
216+
params=params)
217217
return user_dict
218218

219219
@classmethod
220-
def reply_message_thread(cls, user_id=None, email=None, thread_id=None,
220+
def reply_message_thread(cls, user_id=None, email=None, thread_id=None,
221221
body=None, read=None):
222222
""" Reply to the specific thread.
223223
224-
>>> message_thread = Intercom.reply_message_thread(email="somebody@example.com",
224+
>>> message_thread = Intercom.reply_message_thread(email="somebody@example.com",
225225
... thread_id=5591, body="If you're not talking to me you must be talking to someone")
226226
>>> len(message_thread)
227227
6
@@ -231,8 +231,8 @@ def reply_message_thread(cls, user_id=None, email=None, thread_id=None,
231231
2
232232
233233
"""
234-
params = { 'email': email, 'user_id': user_id, 'thread_id': thread_id,
234+
params = { 'email': email, 'user_id': user_id, 'thread_id': thread_id,
235235
'body': body, 'read': read }
236-
user_dict = Intercom._call('PUT', Intercom.api_endpoint + 'users/message_threads',
236+
user_dict = Intercom._call('PUT', Intercom.api_endpoint + 'users/message_threads',
237237
params=params)
238238
return user_dict

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from setuptools import setup
99

1010
setup(name="python-intercom",
11-
version='0.2.4',
11+
version='0.2.5',
1212
description="Intercom API wrapper",
1313
long_description=open('README').read(),
1414
author="John Keyes",

0 commit comments

Comments
 (0)