Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeTux committed Oct 12, 2015
2 parents 61b1332 + 2b96802 commit 5e1170a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
language: python
python:
- "2.7"
install: "pip install -r dev_requirements.txt"
script: py.test --cov-report term-missing --cov=tolk -v tests/
- 2.6
- 2.7
install:
- pip install -r dev_requirements.txt
- pip install coveralls
script:
py.test --cov-report term-missing --cov=tolk -v tests/
after_success:
coveralls
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/AdvancedClimateSystems/Tolk.svg?branch=master)](https://travis-ci.org/AdvancedClimateSystems/Tolk)
[![Coverage Status](https://coveralls.io/repos/AdvancedClimateSystems/Tolk/badge.svg?branch=master&service=github)](https://coveralls.io/github/AdvancedClimateSystems/Tolk?branch=master)
[![Pypi Version](https://img.shields.io/pypi/v/tolk.svg)](https://pypi.python.org/pypi/Tolk/0.1.1)
# Tolk
Tolk exposes a JSON-RPC API to talk Modbus over RTU and is written in Python.

Expand Down
2 changes: 1 addition & 1 deletion scripts/modbus_tcp_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main():
log.info('Add holding registers block from register 100 to 199 on slave 1')

server.start()
log.info('TcpServer started listening at port {}.'.format(args['--port']))
log.info('TcpServer started listening at port {0}.'.format(args['--port']))

try:
while True:
Expand Down
5 changes: 4 additions & 1 deletion scripts/tolk_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def main():
server.dispatcher = dispatcher

try:
log.info('Start Tolk listening at {}.'.format(args['--socket']))
log.info('Start Tolk listening at {0}.'.format(args['--socket']))
server.serve_forever()
except KeyboardInterrupt:
log.info('Received SIGINT. Exiting')
Expand All @@ -50,3 +50,6 @@ def main():

if __name__ == '__main__':
main()

inputs: 449 en 450
output: 449 en 450
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from setuptools import setup

setup(name='Tolk',
version='0.1.2',
version='0.1.3',
author='Auke Willem Oosterhoff',
author_email='oosterhoff@baopt.nl',
description='JSON-RPC proxy for talking Modbus over RTU and TCP.',
Expand All @@ -30,6 +30,7 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Operating System :: Unix',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Embedded Systems',
],
Expand Down
6 changes: 3 additions & 3 deletions tolk/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def handle(self):
back to client.
"""
self.data = self.request.recv(1024).strip()
log.debug('<-- {}'.format(self.data))
log.debug('<-- {0}'.format(self.data))

resp = self.server.dispatcher.call(self.data)
log.debug('--> {}'.format(resp))
log.debug('--> {0}'.format(resp))

try:
self.request.sendall(resp)
Expand All @@ -56,7 +56,7 @@ def handle(self):
# terminates connection, but server still tries to send data to
# client.
if e.errno == errno.EPIPE:
log.error('[Errno {}]: Handler could not send response to '
log.error('[Errno {0}]: Handler could not send response to '
'client.'.format(errno.EPIP))

return
Expand Down

0 comments on commit 5e1170a

Please sign in to comment.