10000 Fix merge conflicts · charlax/twilio-python@adab479 · GitHub
[go: up one dir, main page]

Skip to content

Commit adab479

Browse files
committed
Fix merge conflicts
2 parents 51425e3 + 1b4e6a4 commit adab479

20 files changed

+235
-84
lines changed

docs/api/twiml.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.. autoclass:: twilio.twiml.Response
88
:members:
99

10+
1011
Primary Verbs
1112
~~~~~~~~~~~~~
1213

@@ -25,6 +26,7 @@ Primary Verbs
2526
.. autoclass:: twilio.twiml.Record
2627
:members:
2728

29+
2830
Secondary Verbs
2931
~~~~~~~~~~~~~~~
3032

@@ -49,6 +51,7 @@ Secondary Verbs
4951
.. autoclass:: twilio.twiml.Leave
5052
:members:
5153

54+
5255
Nouns
5356
~~~~~~
5457

@@ -63,3 +66,4 @@ Nouns
6366

6467
.. autoclass:: twilio.twiml.Queue
6568
:members:
69+

docs/faq.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Frequently Asked Questions
55
Hopefully you can find an answer here to one of your questions. If not, please
66
contact `help@twilio.com <mailto:help@twilio.com>`_.
77

8+
89
ImportError messages
910
--------------------
1011

@@ -15,13 +16,13 @@ If you get an error that looks like this:
1516
Traceback (most recent call last):
1617
File "twilio.py", line 1, in <module>
1718
from twilio.rest import TwilioRestClient
18-
File "/Users/kevin/code/twilio-python/docs/twilio.py", line 1, in <module>
19+
File "/.../twilio-python/docs/twilio.py", line 1, in <module>
1920
from twilio.rest import TwilioRestClient
2021
ImportError: No module named rest
2122
22-
Check to make sure that you don't have a file named ``twilio.py``; Python will try to
23-
load the Twilio library from your ``twilio.py`` file instead of from the Twilio
24-
library.
23+
Check to make sure that you don't have a file named ``twilio.py``;
24+
Python will try to load the Twilio library from your ``twilio.py`` file
25+
instead of from the Twilio library.
2526

2627
If you get an error that looks like this:
2728

@@ -49,8 +50,8 @@ grep pip`` (works with Bash on \*nix machines). There can also be more than one
4950
version of Python, especially if you have Macports or homebrew.
5051

5152
You also may be using an outdated version of the twilio-python library, which
52-
did not use a ``twilio.rest.TwilioRestClient`` object. Check which version of the
53-
twilio library you have installed by running this command:
53+
did not use a ``twilio.rest.TwilioRestClient`` object. Check which version of
54+
the twilio library you have installed by running this command:
5455

5556
.. code-block:: bash
5657
@@ -66,6 +67,7 @@ version, you can upgrade with this command:
6667
Note that if you have code that uses the older version of the library, it may
6768
break when you upgrade your site.
6869

70+
6971
Formatting phone numbers
7072
------------------------
7173

@@ -99,7 +101,7 @@ Then you can convert user input to phone numbers like this:
99101
# Phone number may F438 already be in E.164 format.
100102
parse_type = None
101103
else:
102-
# If no country code information is present, assume it's a US number
104+
# If no country code information present, assume it's a US number
103105
parse_type = "US"
104106
105107
phone_representation = phonenumbers.parse(raw_phone, parse_type)
@@ -108,4 +110,3 @@ Then you can convert user input to phone numbers like this:
108110
109111
print convert_to_e164('212 555 1234') # prints +12125551234
110112
111-

docs/getting-started.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Getting started with the Twilio API couldn't be easier. Create a Twilio REST
66
client to get started. For example, the following code makes a call using the
77
Twilio REST API.
88

9+
910
Make a Call
1011
===============
1112

@@ -19,10 +20,11 @@ Make a Call
1920
2021
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
2122
call = client.calls.create(to="9991231234", from_="9991231234",
22-
url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
23+
url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
2324
print call.length
2425
print call.sid
2526
27+
2628
Send an SMS
2729
================
2830

@@ -34,9 +36,11 @@ Send an SMS
3436
token = "YYYYYYYYYYYYYYYYYY"
3537
client = TwilioRestClient(account, token)
3638
37-
message = client.sms.messages.create(to="+12316851234", from_="+15555555555",
39+
message = client.sms.messages.create(to="+12316851234",
40+
from_="+15555555555",
3841
body="Hello there!")
3942
43+
4044
Generating TwiML
4145
=================
4246

@@ -55,7 +59,10 @@ to easily create such responses.
5559
.. code-block:: xml
5660
5761
<?xml version="1.0" encoding="utf-8"?>
58-
<Response><Play loop="5">https://api.twilio.com/cowbell.mp3</Play><Response>
62+
<Response>
63+
<Play loop="5">https://api.twilio.com/cowbell.mp3</Play>
64+
<Response>
65+
5966
6067
Digging Deeper
6168
========================

docs/index.rst

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Twilio Python Helper Library
33
=============================
44

5-
Make requests to Twilio's `REST API <http://www.twilio.com/docs/api/twiml/>`_ and create `TwiML <http://www.twilio.com/docs/api/twiml/>`_ without a hassle. And you thought Twilio couldn't get any easier.
6-
75
.. _installation:
86

97
Installation
@@ -23,28 +21,40 @@ line:
2321
2422
$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
2523
26-
Or, install the library by `downloading the source <https://github.com/twilio/twilio-python/zipball/master>`_, installing :data:`setuptools`, navigating in the Terminal to the folder containing the **twilio-python** library, and then running:
24+
Or, install the library by downloading
25+
`the source <https://github.com/twilio/twilio-python/zipball/master>`_,
26+
installing :data:`setuptools`,
27+
navigating in the Terminal to the folder containing the **twilio-python**
28+
library, and then running:
2729

2830
.. code-block:: bash
2931
3032
$ python setup.py install
3133
34+
3235
Getting Started
3336
================
3437

35-
The :doc:`/getting-started` will get you up and running in a few quick minutes. This guide assumes you understand the core concepts of Twilio. If you've never used Twilio before, don't fret! Just read `about how Twilio works <http://www.twilio.com/api/>`_ and then jump in.
38+
The :doc:`/getting-started` will get you up and running in a few quick minutes.
39+
This guide assumes you understand the core concepts of Twilio.
40+
If you've never used Twilio before, don't fret! Just read
41+
`about how Twilio works <http://www.twilio.com/api/>`_ and then jump in!
42+
3643

3744
.. _user-guide:
3845

3946
User Guide
4047
==================
4148

42-
Functionality is split over three different sub-packages within **twilio-python**. Below are in-depth guides to specific portions of the library.
49+
Functionality is split over three different sub-packages within
50+
**twilio-python**. Below are in-depth guides to specific portions of the
51+
library.
52+
4353

4454
REST API
4555
----------
4656

47-
Query the Twilio REST API to create phone calls, send SMS messages and so much more
57+
Query the Twilio REST API to create phone calls, send SMS messages and more!
4858

4959
.. toctree::
5060
:maxdepth: 1
@@ -61,6 +71,8 @@ Query the Twilio REST API to create phone calls, send SMS messages and so much m
6171
usage/transcriptions
6272
usage/caller-ids
6373
usage/queues
74+
75+
6476
TwiML
6577
---------
6678

@@ -71,6 +83,7 @@ Generates valid TwiML for controlling and manipulating phone calls.
7183

7284
usage/twiml
7385

86+
7487
Utilities
7588
----------
7689

< F438 button class="Button Button--iconOnly Button--invisible ExpandableHunkHeaderDiffLine-module__expand-button-line--wZKjF ExpandableHunkHeaderDiffLine-module__expand-button-unified--Eae6C" aria-label="Expand file from line 89 to line 95" data-direction="all" aria-hidden="true" tabindex="-1">
@@ -82,13 +95,15 @@ Small functions useful for validating requests are coming from Twilio
8295
usage/validation
8396
usage/token-generation
8497

98+
8599
Upgrade Plan
86100
==================
87101

88102
`twilio-python` 3.0 introduced backwards-incompatible changes to the API. See
89103
the :doc:`/upgrade-guide` for step-by-step instructions for migrating to 3.0.
90104
In many cases, the same methods are still offered, just in different locations.
91105

106+
92107
API Reference
93108
==================
94109

@@ -100,6 +115,7 @@ so only use when you really need to dive deep into the library.
100115

101116
api
102117

118+
103119
Frequently Asked Questions
104120
==========================
105121

@@ -111,17 +127,22 @@ phone numbers.
111127

112128
faq
113129

130+
114131
Support and Development
115132
==========================
116-
All development occurs over on `Github <https://github.com/twilio/twilio-python>`_. To checkout the source,
133+
All development occurs over on
134+
`Github <https://github.com/twilio/twilio-python>`_. To checkout the source,
117135

118136
.. code-block:: bash
119137
120138
$ git clone git@github.com:twilio/twilio-python.git
121139
122140
123-
Report bugs using the Github `issue tracker <https://github.com/twilio/twilio-python/issues>`_.
141+
Report bugs using the Github
142+
`issue tracker <https://github.com/twilio/twilio-python/issues>`_.
124143

125-
If you have questions that aren't answered by this documentation, ask the `#twilio IRC channel <irc://irc.freenode.net/#twilio>`_
144+
If you have questions that aren't answered by this documentation,
145+
ask the `#twilio IRC channel <irc://irc.freenode.net/#twilio>`_
126146

127147
See the :doc:`/changelog` for version history.
148+

docs/upgrade-guide.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
Upgrade Guide
33
==============
44

5-
Porting your application from **twilio-python** 2.0 to 3.0 is straightforward. All the same methods are still offered. Only their location has changed.
5+
Porting your application from **twilio-python** 2.0 to 3.0 is straightforward.
6+
All the same methods are still offered. Only their location has changed.
7+
68

79
Making API Requests
810
====================
911

10-
:class:`twilio.Account` has been moved to :class:`twilio.rest.TwilioRestClient`. The rest client offers a greatly improved API; however, the old :meth:`request` method still exists (in a deprecated state). We suggest you migrate your code to use the new API.
12+
:class:`twilio.Account` has been moved to
13+
:class:`twilio.rest.TwilioRestClient`.
14+
The rest client offers a greatly improved API;
15+
however, the old :meth:`request` method still exists (in a deprecated state).
16+
We suggest you migrate your code to use the new API.
1117

1218
Here is how you would place an outgoing call with the older version.
1319

@@ -29,15 +35,16 @@ Here is how you would place an outgoing call with the older version.
2935
account = twilio.Account(ACCOUNT_SID, ACCOUNT_TOKEN)
3036
3137
d = {
32-
'From' : CALLER_ID,
33-
'To' : '415-555-1212',
34-
'Url' : 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient',
38+
'From': CALLER_ID,
39+
'To': '415-555-1212',
40+
'Url': 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient',
3541
}
3642
37-
print account.request('/%s/Accounts/%s/Calls' % \
43+
print account.request('/%s/Accounts/%s/Calls' %
3844
(API_VERSION, ACCOUNT_SID), 'POST', d)
3945
40-
The same code, updated to work with the new version (albeit using deprecated methods).
46+
The same code, updated to work with the new version
47+
(albeit using deprecated methods).
4148

4249
.. code-block:: python
4350
@@ -51,12 +58,12 @@ The same code, updated to work with the new version (albeit using deprecated met
5158
client = TwilioRestClient(ACCOUNT_SID, ACCOUNT_TOKEN)
5259
5360
d = {
54-
'From' : CALLER_ID,
55-
'To' : '415-555-1212',
56-
'Url' : 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient',
61+
'From': CALLER_ID,
62+
'To': '415-555-1212',
63+
'Url': 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient',
5764
}
5865
59-
print client.request('/%s/Accounts/%s/Calls' % \
66+
print client.request('/%s/Accounts/%s/Calls' %
6067
(API_VERSION, ACCOUNT_SID), 'POST', d)
6168
6269
A final version using the new interface.
@@ -70,7 +77,7 @@ A final version using the new interface.
7077
7178
client = TwilioRestClient(ACCOUNT_SID, ACCOUNT_TOKEN)
7279
call = client.calls.create(from_='NNNNNNNNNN', to='415-555-1212',
73-
url='http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient')
80+
url='http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient')
7481
7582
print call
7683

docs/usage/accounts.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
Accounts
55
===========
66

7-
Managing Twilio accounts is straightforward. Update your own account information or create and manage multiple subaccounts.
7+
Managing Twilio accounts is straightforward.
8+
Update your own account information or create and manage multiple subaccounts.
89

9-
For more information, see the `Account REST Resource <http://www.twilio.com/docs/api/rest/account>`_ documentation.
10+
For more information, see the
11+
`Account REST Resource <http://www.twilio.com/docs/api/rest/account>`_
12+
documentation.
1013

1114

1215
Updating Account Information
1316
----------------------------
1417

15-
Use the :meth:`Account.update` to modify one of your accounts. Right now the only valid attribute is `FriendlyName`.
18+
Use the :meth:`Account.update` to modify one of your accounts.
19+
Right now the only valid attribute is `FriendlyName`.
1620

1721
.. code-block:: python
1822
@@ -26,6 +30,7 @@ Use the :meth:`Account.update` to modify one of your accounts. Right now the onl
2630
account = client.accounts.get(ACCOUNT_SID)
2731
account.update(friendly_name="My Awesome Account")
2832
33+
2934
Creating Subaccounts
3035
----------------------
3136

@@ -42,6 +47,7 @@ Subaccounts are easy to make.
4247
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
4348
subaccount = client.accounts.create(name="My Awesome SubAccount")
4449
50+
4551
Managing Subaccounts
4652
-------------------------
4753

docs/usage/applications.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
Applications
55
=================
66

7-
An application inside of Twilio is just a set of URLs and other configuration data that tells Twilio how to behave when one of your Twilio numbers receives a call or SMS message.
7+
An application inside of Twilio is just a set of URLs and other configuration
8+
data that tells Twilio how to behave when one of your Twilio numbers receives
9+
a call or SMS message.
10+
11+
For more information, see the `Application REST Resource
12+
<http://www.twilio.com/docs/api/rest/applications>`_ documentation.
813

9-
For more information, see the `Application REST Resource <http://www.twilio.com/docs/api/rest/applications>`_ documentation.
1014

1115
Listing Your Applications
1216
--------------------------
@@ -43,6 +47,7 @@ You can filter applications by FriendlyName
4347
for app in client.applications.list(friendly_name="FOO"):
4448
print app.sid
4549
50+
4651
Creating an Application
4752
-------------------------
4853

@@ -93,3 +98,4 @@ Deleting an Application
9398
app_sid = 'AP123' # the app you'd like to delete
9499
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
95100
client.applications.delete(app_sid)
101+

0 commit comments

Comments
 (0)
0