DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
DEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev
DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 check
-DEB_DEPENDS += libboost-all-dev libffi-dev python-ply libmbedtls-dev
+DEB_DEPENDS += libboost-all-dev libffi-dev python3-ply libmbedtls-dev
DEB_DEPENDS += cmake ninja-build uuid-dev
ifeq ($(OS_VERSION_ID),14.04)
DEB_DEPENDS += openjdk-8-jdk-headless
RPM_DEPENDS += dnf-utils
RPM_DEPENDS += subunit subunit-devel
RPM_DEPENDS += compat-openssl10-devel
- RPM_DEPENDS += python2-devel python2-ply
+ RPM_DEPENDS += python2-devel python34-ply
RPM_DEPENDS += python2-virtualenv
RPM_DEPENDS += mbedtls-devel
RPM_DEPENDS += cmake
else
RPM_DEPENDS += yum-utils
RPM_DEPENDS += openssl-devel
- RPM_DEPENDS += python-devel python-ply
+ RPM_DEPENDS += python-devel python34-ply
RPM_DEPENDS += python-virtualenv
RPM_DEPENDS += devtoolset-7
RPM_DEPENDS += cmake3
SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
SUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
-RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python-ply
+RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
RPM_SUSE_DEVEL_DEPS = glibc-devel-static java-1_8_0-openjdk-devel libnuma-devel
RPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel mbedtls-devel libuuid-devel
ifeq ($(OS_ID),opensuse)
ifeq ($(SUSE_NAME),Tumbleweed)
RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0 libboost_thread1_68_0-devel-1.68.0 gcc
- RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
+ RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
ifeq ($(SUSE_ID),15.0)
RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0 libboost_thread1_68_0-devel-1.68.0 gcc6
- RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
+ RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
else
RPM_SUSE_DEVEL_DEPS += libboost_headers1_68_0-devel-1.68.0 gcc6
RPM_SUSE_PYTHON_DEPS += python-virtualenv
ifeq ($(OS_ID),opensuse-leap)
ifeq ($(SUSE_ID),15.0)
RPM_SUSE_DEVEL_DEPS = libboost_headers-devel libboost_thread-devel gcc6
- RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
+ RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
endif
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import ply.lex as lex
class Service():
- def __init__(self, caller, reply, events=[], stream=False):
+ def __init__(self, caller, reply, events=None, stream=False):
self.caller = caller
self.reply = reply
self.stream = stream
- self.events = events
+ self.events = [] if events is None else events
class Typedef():
else:
a = { 'type': alias.fieldtype }
self.alias = a
- self.crc = binascii.crc32(str(alias)) & 0xffffffff
- global_crc = binascii.crc32(str(alias), global_crc)
+ self.crc = binascii.crc32(str(alias).encode()) & 0xffffffff
+ global_crc = binascii.crc32(str(alias).encode(), global_crc)
global_type_add(name)
def __repr__(self):
if sys.version[0] == '2':
cliparser.add_argument('--input', type=argparse.FileType('r'),
default=sys.stdin)
+ cliparser.add_argument('--output', nargs='?',
+ type=argparse.FileType('w'),
+ default=sys.stdout)
+
else:
cliparser.add_argument('--input',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
- cliparser.add_argument('--output', nargs='?', type=argparse.FileType('w'),
- default=sys.stdout)
+ cliparser.add_argument('--output', nargs='?',
+ type=argparse.FileType('w', encoding='UTF-8'),
+ default=sys.stdout)
cliparser.add_argument('output_module', nargs='?', default='C')
cliparser.add_argument('--debug', action='store_true')