Remove py2 support
Change-Id: Ieeaeb3b8efcae004e94aea6c1d2703c9782a8650 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21320 Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
@ -28,7 +28,7 @@ SPACE = b' '
|
||||
def encode_msg_frame(action, specifier=None, data=None):
|
||||
""" encode a msg_tripel into an msg_frame, ready to be sent
|
||||
|
||||
action (and optional specifier) are unicode strings,
|
||||
action (and optional specifier) are str strings,
|
||||
data may be an json-yfied python object"""
|
||||
action = action.encode('utf-8')
|
||||
if specifier is None:
|
||||
@ -54,7 +54,7 @@ def get_msg(_bytes):
|
||||
|
||||
|
||||
def decode_msg(msg):
|
||||
"""decode the (binary) msg into a (unicode) msg_tripel"""
|
||||
"""decode the (binary) msg into a (str) msg_tripel"""
|
||||
# check for leading/trailing CR and remove it
|
||||
res = msg.split(b' ', 2)
|
||||
action = res[0].decode('utf-8')
|
||||
|
@ -19,11 +19,11 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
"""provides tcp interface to the SECoP Server"""
|
||||
from __future__ import division, print_function
|
||||
|
||||
import collections
|
||||
import socket
|
||||
import sys
|
||||
import socket
|
||||
import collections
|
||||
import socketserver
|
||||
|
||||
from secop.datatypes import StringType, IntRange, BoolType
|
||||
from secop.errors import SECoPError
|
||||
@ -34,17 +34,10 @@ from secop.protocol.interface import decode_msg, encode_msg_frame, get_msg
|
||||
from secop.protocol.messages import ERRORPREFIX, \
|
||||
HELPREPLY, HELPREQUEST, HelpMessage
|
||||
|
||||
try:
|
||||
import socketserver # py3
|
||||
except ImportError:
|
||||
import SocketServer as socketserver # py2
|
||||
|
||||
|
||||
|
||||
DEF_PORT = 10767
|
||||
MESSAGE_READ_SIZE = 1024
|
||||
|
||||
|
||||
CR = b'\r'
|
||||
SPACE = b' '
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
# *****************************************************************************
|
||||
"""provide a zmq server"""
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
# tbd.
|
||||
|
||||
|
Reference in New Issue
Block a user