Python binding for Tox the skype replacement
Project description
PyTox
Python binding for Project Tox.
PyTox provides a Pythonic binding, i.e Object-oriented instead of C style, raise exception instead of returning error code. A simple example is as follows:
class EchoBot(Tox):
def loop(self):
while True:
self.do()
time.sleep(0.03)
def on_friend_request(self, pk, message):
print 'Friend request from %s: %s' % (pk, message)
self.add_friend_norequest(pk)
print 'Accepted.'
def on_friend_message(self, friendId, message):
name = self.get_name(friendId)
print '%s: %s' % (name, message)
print 'EchoBot: %s' % message
self.send_message(friendId, message)
As you can see callbacks are mapped into class method instead of using it the the c ways. For more details please refer to examples/echo.py.
Getting started
To get started, a Makefile is provided to run PyTox inside a docker container:
make test: This will launch tests in a container.
make run: This will launch an interactive container with PyTox installed.
make echobot: This will launch the example echobot in a container.
Examples
echo.py: A working echo bot that wait for friend requests, and than start echoing anything that friend send.
Documentation
Full API documentation can be read here.
Todo
Complete API binding (use toos/apicomplete.py to check)
Unittest for ToxAV
Contributing
Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Push to the branch (git push origin my-new-feature)
Create new Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PyTox-0.0.23.tar.gz
.
File metadata
- Download URL: PyTox-0.0.23.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bec699aaa74766b0c591773d64df39e73ef912eddc5a1db530b322267833260 |
|
MD5 | 188b8d48f2b9ac2e542f96d8c1a02ac4 |
|
BLAKE2b-256 | 0c9b426ed9cc12398055552a48b8afdd08d5ed070dbd76ac100385cfb42444fd |