Skip to content
Snippets Groups Projects
Commit 2a94c543 authored by Arnaud Degroote's avatar Arnaud Degroote
Browse files

[wip/py-morse] Upgrade to 1.3

Changes since 1.2
+++++++++++++++++

- various stability fix
parent 2add9835
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,7 @@
# Created: Severin Lemaignan on Tue, 12 Apr 2011
#
VERSION= 1.2.1
PKGREVISION= 1
VERSION= 1.3
PKGNAME= ${PKGTAG.python}-morse-${VERSION}
DISTNAME= morse-${VERSION}
MASTER_SITES= ${MASTER_SITE_OPENROBOTS:=morse/}
......@@ -22,7 +21,7 @@ CMAKE_ARGS+= -DBUILD_HLA_SUPPORT=OFF
CMAKE_ARGS+= -DBUILD_MOOS_SUPPORT=OFF
CMAKE_ARGS+= -DBUILD_POCOLIBS_SUPPORT=OFF
CMAKE_ARGS+= -DBUILD_ROS_SUPPORT=OFF
CMAKE_ARGS+= -DBUILD_YARP2_SUPPORT=OFF
CMAKE_ARGS+= -DBUILD_YARP_SUPPORT=OFF
CMAKE_ARGS+= -DPYMORSE_SUPPORT=ON
CMAKE_ARGS+= -DPYTHON_INSTDIR=${PREFIX}/${PYTHON_SITELIB}
......
SHA1 (morse-1.2.1.tar.bz2) = 6f79bb0ec96ee8775f7e13c52173a9c7e4e259db
RMD160 (morse-1.2.1.tar.bz2) = 935301eafa327a4a530af539e728e9cf9b9068e0
Size (morse-1.2.1.tar.bz2) = 101571968 bytes
SHA1 (patch-aa) = f86d0bb4287cc22f8d9638701e320d61518e67d3
SHA1 (morse-1.3.tar.bz2) = 6c70fb6f567d73741c4057b9353e963734476a5d
RMD160 (morse-1.3.tar.bz2) = d199a021a7f8316f7d35c7e6ce4f3ca3ac212f3d
Size (morse-1.3.tar.bz2) = 104057512 bytes
diff --git bindings/pymorse/setup.py bindings/pymorse/setup.py
index c7e4e29..a9eed91 100644
--- bindings/pymorse/setup.py
+++ bindings/pymorse/setup.py
@@ -3,7 +3,7 @@
from distutils.core import setup
setup(name='pymorse',
- version='1.2',
+ version='1.2.2',
license='BSD 3-clauses',
description='Python bindings for the Modular OpenRobots Simulation Engine (MORSE)',
author='Séverin Lemaignan, Pierrick Koch',
diff --git bindings/pymorse/src/pymorse/pymorse.py bindings/pymorse/src/pymorse/pymorse.py
index 28f0fff..1fd6e9c 100644
--- bindings/pymorse/src/pymorse/pymorse.py
+++ bindings/pymorse/src/pymorse/pymorse.py
@@ -434,6 +434,17 @@ class ResponseCallback:
condition.notify_all()
del ResponseCallback._conditions[:] # clear list
+class PollThread(threading.Thread):
+ def __init__(self, timeout=0.01):
+ threading.Thread.__init__(self)
+ self.keep_polling = True
+ self.timeout = timeout
+ def run(self):
+ while asyncore.socket_map and self.keep_polling:
+ asyncore.poll(self.timeout, asyncore.socket_map)
+ def syncstop(self, timeout=None):
+ self.keep_polling = False
+ return self.join(timeout)
class Morse(object):
_asyncore_thread = None
@@ -449,7 +460,7 @@ class Morse(object):
self.simulator_service = Stream(host, port)
self.simulator_service_id = 0
if not Morse._asyncore_thread:
- Morse._asyncore_thread = threading.Thread( target = asyncore.loop, kwargs = {'timeout': 0.01} )
+ Morse._asyncore_thread = PollThread()
Morse._asyncore_thread.start()
logger.debug("Morse thread started")
else:
@@ -580,10 +591,9 @@ class Morse(object):
else:
logger.info('Waiting for all asynchronous requests to complete...')
self.executor.shutdown(wait = True)
- self.simulator_service.close()
# Close all other asyncore sockets (StreanJSON)
+ Morse._asyncore_thread.syncstop(TIMEOUT)
asyncore.close_all()
- Morse._asyncore_thread.join(TIMEOUT)
Morse._asyncore_thread = None # in case we want to re-create
logger.info('Done. Bye bye!')
diff --git bindings/pymorse/src/pymorse/stream.py bindings/pymorse/src/pymorse/stream.py
index 986bafd..45c62aa 100644
--- bindings/pymorse/src/pymorse/stream.py
+++ bindings/pymorse/src/pymorse/stream.py
@@ -150,7 +150,7 @@ class StreamB(asynchat.async_chat):
except TypeError:
data = first.more()
if data:
- self.producer_fifo.appendleft(data)
+ self.producer_fifo.extendleft([first, data])
continue
if isinstance(data, str) and self.use_encoding:
diff --git bindings/pymorse/test/pymorse_testing.py bindings/pymorse/test/pymorse_testing.py
index 7d132e9..0523f84 100644
--- bindings/pymorse/test/pymorse_testing.py
+++ bindings/pymorse/test/pymorse_testing.py
@@ -35,7 +35,7 @@ class PymorseTest(MorseTestCase):
motion = Waypoint()
motion.add_stream('socket')
- motion.configure_service('socket')
+ motion.add_service('socket')
robot1.append(motion)
##### Robot2
@@ -167,8 +167,5 @@ class PymorseTest(MorseTestCase):
########################## Run these tests ##########################
if __name__ == "__main__":
- import unittest
- from morse.testing.testing import MorseTestRunner
- suite = unittest.TestLoader().loadTestsFromTestCase(PymorseTest)
- sys.exit(not MorseTestRunner().run(suite).wasSuccessful())
-
+ from morse.testing.testing import main
+ main(PymorseTest)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment