Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
30ae7ecb
Unverified
Commit
30ae7ecb
authored
Oct 02, 2018
by
Thanassis Tsiodras
Committed by
GitHub
Oct 02, 2018
Browse files
Merge pull request #7 from cejpmart/master
dmt/A_mappers/Stubs.py: Python3 compatibility changes, contributed by cejpmart.
parents
ec73b14e
fee17a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
dmt/A_mappers/Stubs.py
View file @
30ae7ecb
...
...
@@ -23,12 +23,16 @@ from __future__ import absolute_import
import
os
import
re
import
copy
import
sys
import
DV_Types
# pylint: disable=import-error
from
ctypes
import
(
cdll
,
c_void_p
,
c_ubyte
,
c_double
,
c_uint
,
c_longlong
,
c_bool
,
c_int
,
c_long
,
c_char
)
if
sys
.
version_info
>
(
3
,):
long
=
int
# load the *getset.so in this folder
script_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
soFileNames
=
[
...
...
@@ -102,12 +106,20 @@ class DataStream(object):
def
GetPyString
(
self
):
# print "Reading",
msg
=
""
pData
=
c_void_p
(
GetBitstreamBuffer
(
self
.
_bs
))
for
i
in
range
(
0
,
GetStreamCurrentLength
(
self
.
_bs
)):
b
=
GetBufferByte
(
pData
,
i
)
msg
+=
chr
(
b
)
# print b, ",",
if
sys
.
version_info
>
(
3
,):
msg
=
b
""
pData
=
c_void_p
(
GetBitstreamBuffer
(
self
.
_bs
))
for
i
in
range
(
0
,
GetStreamCurrentLength
(
self
.
_bs
)):
b
=
GetBufferByte
(
pData
,
i
)
msg
+=
bytes
([
b
])
# print b, ",",
else
:
msg
=
""
pData
=
c_void_p
(
GetBitstreamBuffer
(
self
.
_bs
))
for
i
in
range
(
0
,
GetStreamCurrentLength
(
self
.
_bs
)):
b
=
GetBufferByte
(
pData
,
i
)
msg
+=
chr
(
b
)
# print b, ",",
# print "EOF"
return
msg
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment