Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting #40

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
*.un~
7 changes: 0 additions & 7 deletions ISSUES

This file was deleted.

File renamed without changes.
6 changes: 0 additions & 6 deletions MANIFEST

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

147 changes: 58 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,62 @@
# Tropo Python Module
# ciscotropowebapi

tropo - The TropoPython module. This module implements a set of classes and methods for manipulating the
Web API for the Tropo cloud communications service at http://www.tropo.com/
This module is for working with the Cisco Tropo Web API cloud communications service at http://www.tropo.com/

For more information about the Tropo Web API that is used with this module, please see:
# Description
from ciscotropowebapi import Tropo

http://www.tropo.com/docs/webapi/

As this python module is still in development, please report any bugs or issues by raising an issue here:

http://github.com/tropo/tropo-webapi-python/issues

## File

http://github.com/tropo/tropo-webapi-python/blob/master/tropo.py

## Description

Usage:

```python
from tropo import Tropo

tropo = Tropo()
tropo.say("Hello, World")
json = tropo.RenderJson()
```

You can write this JSON back to standard output to get Tropo to perform
the action. For example, on Google Appengine you might write something like:

handler.response.out.write(json)

Much of the time, a you will interact with Tropo by examining the Result
object and communicating back to Tropo via the Tropo class methods, such
as "say". In some cases, you'll want to build a class object directly such as in :

```python
choices = tropo.Choices("[5 digits]").obj

tropo.ask(choices,
say="Please enter your 5 digit zip code.",
attempts=3, bargein=True, name="zip", timeout=5, voice="dave")
...
```

## Note on Python versions

This module is for python 2.x and requires python 2.5 or higher.
There is a separate version available for python 3.x at:

https://github.com/tropo/tropo-webapi-python/tree/python3

## License
tropo = Tropo()
tropo.say("Hello, World")
json = tropo.RenderJson()
----

You can write this JSON back to standard output to get Tropo to perform
the action. For example, on Google Appengine you might write something like:

handler.response.out.write(json)

Much of the time, a you will interact with Tropo by examining the Result
object and communicating back to Tropo via the Tropo class methods, such
as "say". In some cases, you'll want to build a class object directly such as in :

choices = tropo.Choices("[5 digits]").obj

tropo.ask(choices,
say="Please enter your 5 digit zip code.",
attempts=3, bargein=True, name="zip", timeout=5, voice="dave")
...

MIT, see LICENSE.txt

## Tests
# Tests

Run testsuite by issuing:
Run testsuite by issuing:

cd test
python test.py

## Classes
```python
Ask
Call
Choices
Conference
Hangup
Message
On
Record
Redirect
Reject
Result
Say
Session
StartRecording
StopRecording
Transfer
Tropo
unittest.TestCase(__builtin__.object)
TestTropoPython

# Classes

* Ask
* Call
* Choices
* Conference
* Hangup
* Message
* On
* Record
* Redirect
* Reject
* Result
* Say
* Session
* StartRecording
* StopRecording
* Transfer
* Tropo
* unittest.TestCase(__builtin__.object)
* TestTropoPython

# Details of each class
class Ask
| Class representing the "ask" Tropo action. Builds an "ask" JSON object.
| Class constructor arg: choices, a Choices object
Expand Down Expand Up @@ -113,7 +85,7 @@ Run testsuite by issuing:
class Call
| Class representing the "call" Tropo action. Builds a "call" JSON object.
| Class constructor arg: to, a String
| Class constructor options: answerOnMedia, channel, _from, headers, name, network, recording, required, timeout
| Class constructor options: answerOnMedia, channel, from, headers, name, network, recording, required, timeout
| Convenience function: Tropo.call()
|
| (See https://www.tropo.com/docs/webapi/call.htm)
Expand Down Expand Up @@ -182,7 +154,7 @@ Run testsuite by issuing:
| Class representing the "message" Tropo action. Builds a "message" JSON object.
| Class constructor arg: say_obj, a Say object
| Class constructor arg: to, a String
| Class constructor options: answerOnMedia, channel, _from, name, network, required, timeout, voice
| Class constructor options: answerOnMedia, channel, from, name, network, required, timeout, voice
| Convenience function: Tropo.message()
|
| (See https://www.tropo.com/docs/webapi/message.htm)
Expand Down Expand Up @@ -309,7 +281,7 @@ Run testsuite by issuing:
class Say
| Class representing the "say" Tropo action. Builds a "say" JSON object.
| Class constructor arg: message, a String, or a List of Strings
| Class constructor options: attempts, bargein, choices, minConfidence, name, recognizer, required, say, timeout, voice, _as
| Class constructor options: attempts, bargein, choices, minConfidence, name, recognizer, required, say, timeout, voice
| Convenience function: Tropo.say()
|
| (See https://www.tropo.com/docs/webapi/say.htm)
Expand All @@ -328,9 +300,6 @@ Run testsuite by issuing:
class Session
| Session is the payload sent as an HTTP POST to your web application when a new session arrives.
| (See https://www.tropo.com/docs/webapi/session.htm)
|
| Because 'from' is a reserved word in Python, the session object's 'from' property is called
| fromaddress in the Python library
|
| Methods defined here:
|
Expand Down Expand Up @@ -595,7 +564,7 @@ Run testsuite by issuing:
class Transfer
| Class representing the "transfer" Tropo action. Builds a "transfer" JSON object.
| Class constructor arg: to, a String, or List
| Class constructor options: answerOnMedia, choices, _from, name, required, terminator
| Class constructor options: answerOnMedia, choices, from, name, required, terminator
| Convenience function: Tropo.transfer()
|
| (See https://www.tropo.com/docs/webapi/transfer.htm)
Expand Down Expand Up @@ -643,7 +612,7 @@ Run testsuite by issuing:
| Places a call or sends an an IM, Twitter, or SMS message. To start a call, use the Session API to tell Tropo to launch your code.
|
| Arguments: to is a String.
| Argument: **options is a set of optional keyword arguments. Use "_from" instead of "from".
| Argument: **options is a set of optional keyword arguments.
| See https://www.tropo.com/docs/webapi/call.htm
|
| conference(self, id, **options)
Expand All @@ -662,7 +631,7 @@ Run testsuite by issuing:
|
| Argument: "say_obj" is a Say object
| Argument: "to" is a String
| Argument: **options is a set of optional keyword arguments. Use "_from" instead of "from".
| Argument: **options is a set of optional keyword arguments.
| See https://www.tropo.com/docs/webapi/message.htm
|
| on(self, event, **options)
Expand Down Expand Up @@ -691,7 +660,7 @@ Run testsuite by issuing:
| When the current session is a voice channel this key will either play a message or an audio file from a URL.
| In the case of an text channel it will send the text back to the user via i nstant messaging or SMS.
| Argument: message is a string
| Argument: **options is a set of optional keyword arguments. Use "_as" instead of "as".
| Argument: **options is a set of optional keyword arguments.
| See https://www.tropo.com/docs/webapi/say.htm
|
| startRecording(self, url, **options)
Expand All @@ -707,6 +676,6 @@ Run testsuite by issuing:
| transfer(self, to, **options)
| Transfers an already answered call to another destination / phone number.
| Argument: to is a string
| Argument: **options is a set of optional keyword arguments. Use "_from" instead of "from".
| Argument: **options is a set of optional keyword arguments.
| See https://www.tropo.com/docs/webapi/transfer.htm
```

Loading