Permalink
Browse files

prepare package for publishing

  • Loading branch information...
u-abramchuk committed Sep 5, 2015
1 parent b3ef667 commit 879d6e903f8db74e52affcacfe52632c1aaf7ce8
Showing with 87 additions and 3 deletions.
  1. +4 −1 .gitignore
  2. +53 −0 DESCRIPTION.rst
  3. +1 −1 LICENSE.md
  4. +29 −0 setup.py
  5. +0 −1 signalr/transports/_ws_transport.py
@@ -1,2 +1,5 @@
*.pyc
.idea
.idea/**
dist/**
signalr_client.egg-info/**
build/**
@@ -0,0 +1,53 @@
signalr-client-py
=================
Python client proxy for `SignalR <http://signalr.net/>`_.
Requirements
------------
Install the following prerequisites using `pip`:
* `gevent`
* `sseclient`
* `websocket-client`
The `gevent` package in turn requires Python headers.
In Debian based distributions (such as Ubuntu and Raspbian) they are called `python-dev`.
Compatibility
-------------
Only compatible with Python 2, not Python 3.
Usage
-----
Here is sample usage::
#create a connection
connection = Connection(url, session)
#start a connection
connection.start()
#add a handler to process notifications to the connection
connection.handlers += lambda data: print 'Connection: new notification.', data
#get chat hub
chat_hub = connection.hub('chat')
#create new chat message handler
def message_received(message):
print 'Hub: New message.', message
#receive new chat messages from the hub
chat_hub.client.on('message_received', message_received)
#send a new message to the hub
chat_hub.server.invoke('send_message', 'Hello!')
#do not receive new messages
chat_hub.client.off('message_received', message_received)
#close the connection
connection.close()
@@ -1,4 +1,4 @@
Copyright (c) Targetprocess, Inc. All rights reserved.
Copyright (c) Taucraft Limited. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
@@ -0,0 +1,29 @@
import io
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
with io.open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='signalr-client',
version='0.0.1',
description='Simple SignalR client for Python',
long_description=long_description,
url='https://github.com/TargetProcess/signalr-client-py',
author='Taucraft Limited',
author_email='info@taucraft.com',
license='Apache',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7'
],
keywords='signalr',
packages=find_packages(),
install_requires=['gevent', 'websocket-client', 'sseclient', 'requests']
)
@@ -2,7 +2,6 @@
import urlparse
from websocket import create_connection
from ._transport import Transport

0 comments on commit 879d6e9

Please sign in to comment.