Skip to content

Commit

Permalink
Inline cbor library (#377)
Browse files Browse the repository at this point in the history
Prefer system version with C speedups, but include pure Python implementation.
  • Loading branch information
mvollrath authored and jihoonl committed Dec 16, 2018
1 parent 788c5d6 commit bd6b193
Show file tree
Hide file tree
Showing 5 changed files with 537 additions and 5 deletions.
2 changes: 0 additions & 2 deletions rosbridge_library/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<build_depend>geometry_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>python-bson</build_depend>
<build_depend>python-cbor</build_depend>

<exec_depend>rospy</exec_depend>
<exec_depend>roscpp</exec_depend>
Expand All @@ -37,7 +36,6 @@
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>python-bson</exec_depend>
<exec_depend>python-cbor</exec_depend>

<test_depend>rostest</test_depend>
<test_depend>actionlib_msgs</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
from rosbridge_library.internal.subscribers import manager
from rosbridge_library.internal.subscription_modifiers import MessageHandler
from rosbridge_library.internal.pngcompression import encode as encode_png
from cbor import dumps as encode_cbor

try:
from cbor import dumps as encode_cbor
except ImportError:
from rosbridge_library.util.cbor import dumps as encode_cbor

try:
from ujson import dumps as encode_json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

PYTHON2 = sys.version_info < (3, 0)

from cbor import Tag
try:
from cbor import Tag
except ImportError:
from rosbridge_library.util.cbor import Tag


LIST_TYPES = [list, tuple]
Expand Down
Loading

0 comments on commit bd6b193

Please sign in to comment.