added setup script

This commit is contained in:
Stefan Kögl 2014-03-07 16:04:39 +01:00
parent 931544572d
commit 2a72572026
3 changed files with 150 additions and 57 deletions

35
sensors2osc/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject

View File

@ -21,21 +21,6 @@ except ImportError as e:
from chaosc.osc_lib import *
parser = argparse.ArgumentParser(prog='psychose_actor')
parser.add_argument("-H", '--chaosc_host', required=True,
type=str, help='host of chaosc instance to control')
parser.add_argument("-p", '--chaosc_port', required=True,
type=int, help='port of chaosc instance to control')
args = parser.parse_args(sys.argv[1:])
connections = list()
osc_sock = socket.socket(2, 2, 17)
osc_sock.connect((args.chaosc_host, args.chaosc_port))
class Forwarder(object):
def __init__(self, actor, platform, device):
self.actor = actor
@ -102,7 +87,23 @@ class Pulse2OSC(Forwarder):
osc_sock.sendall(osc_message.encode_osc())
naming = {
def main():
parser = argparse.ArgumentParser(prog='psychose_actor')
parser.add_argument("-H", '--chaosc_host', required=True,
type=str, help='host of chaosc instance to control')
parser.add_argument("-p", '--chaosc_port', required=True,
type=int, help='port of chaosc instance to control')
args = parser.parse_args(sys.argv[1:])
connections = list()
osc_sock = socket.socket(2, 2, 17)
osc_sock.connect((args.chaosc_host, args.chaosc_port))
naming = {
"/dev/ttyUSB0" : ["merle", "ehealth"],
"/dev/ttyUSB1" : ["merle", "ekg"],
"/dev/ttyUSB2" : ["merle", "pulse"],
@ -114,14 +115,14 @@ naming = {
"/dev/ttyUSB8" : ["uwe", "pulse"]
}
naming = {
naming = {
"/tmp/tty2" : ["merle", "ehealth"],
"/tmp/tty4" : ["merle", "pulse"]
}
used_devices = dict()
used_devices = dict()
while 1:
while 1:
for device, description in naming.iteritems():
if os.path.exists(device):
if device not in used_devices:

57
sensors2osc/setup.py Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from scripts.version import get_git_version
import sys
from setuptools import find_packages, setup
if sys.version_info >= (3,):
extras['use_2to3'] = True
setup(
name='sensors2osc',
version="0.1",
packages=find_packages(exclude=["scripts",]),
include_package_data = True,
package_data = {
"chaosc" : ["config/*",]},
exclude_package_data = {'': ['.gitignore']},
install_requires=[
"pyserial",],
# installing unzipped
zip_safe = False,
# predefined extension points, e.g. for plugins
entry_points = """
[console_scripts]
sensors2osc = sensors2osc.main:main
""",
# pypi metadata
author = "Stefan Kögl",
# FIXME: add author email
author_email = "",
description = "osc filtering application level gateway",
# FIXME: add long_description
long_description = """
""",
# FIXME: add license
license = "LGPL",
# FIXME: add keywords
keywords = "",
# FIXME: add download url
url = "",
test_suite='tests'
)