diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-09-28 06:31:53 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-10-05 20:06:53 +0000 |
commit | a5081a7ac3e013febda1b8b61aed1dc9cd8321ef (patch) | |
tree | 73ab900c595b3aea94e16f7d05fcce0d565016ac | |
parent | e691345d7a888ad57848c86b86211192e07d5de7 (diff) |
drop python3 dependency (VPP-1010)
Change-Id: I99c2c1d0d5b96f33efdb58dd3a2897a752e65349
Signed-off-by: Klement Sekera <ksekera@cisco.com>
-rw-r--r-- | Makefile | 8 | ||||
-rwxr-xr-x | src/vpp-api/vapi/vapi_c_gen.py | 16 | ||||
-rwxr-xr-x | src/vpp-api/vapi/vapi_cpp_gen.py | 17 | ||||
-rw-r--r-- | src/vpp-api/vapi/vapi_json_parser.py | 14 |
4 files changed, 26 insertions, 29 deletions
@@ -110,13 +110,7 @@ endif RPM_SUSE_DEPENDS = autoconf automake bison ccache chrpath distribution-release gcc6 glibc-devel-static RPM_SUSE_DEPENDS += java-1_8_0-openjdk-devel libopenssl-devel libtool make openssl-devel -RPM_SUSE_DEPENDS += python-devel python3-devel python-pip python3-pip python-rpm-macros shadow nasm libnuma-devel python3 - -ifeq ($(filter rhel centos,$(OS_ID)),$(OS_ID)) - RPM_DEPENDS += python34 -else - RPM_DEPENDS += python3 -endif +RPM_SUSE_DEPENDS += python-devel python-pip python-rpm-macros shadow nasm libnuma-devel ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),) STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py index ef6e2663..d7a7272a 100755 --- a/src/vpp-api/vapi/vapi_c_gen.py +++ b/src/vpp-api/vapi/vapi_c_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 import argparse import os @@ -15,7 +15,8 @@ class CField(Field): field_type, array_len=None, nelem_field=None): - super().__init__(field_name, field_type, array_len, nelem_field) + super(CField, self).__init__( + field_name, field_type, array_len, nelem_field) def get_c_def(self): if self.len is not None: @@ -67,7 +68,7 @@ class CField(Field): class CStruct(Struct): def __init__(self, name, fields): - super().__init__(name, fields) + super(CStruct, self).__init__(name, fields) def get_c_def(self): return "\n".join([ @@ -92,7 +93,7 @@ class CSimpleType (SimpleType): } def __init__(self, name): - super().__init__(name) + super(CSimpleType, self).__init__(name) def get_c_name(self): return self.name @@ -122,7 +123,7 @@ class CSimpleType (SimpleType): class CStructType (StructType, CStruct): def __init__(self, definition, typedict, field_class): - super().__init__(definition, typedict, field_class) + super(CStructType, self).__init__(definition, typedict, field_class) def get_c_name(self): return "vapi_type_%s" % self.name @@ -173,8 +174,9 @@ class CStructType (StructType, CStruct): class CMessage (Message): def __init__(self, logger, definition, typedict, struct_type_class, simple_type_class, field_class): - super().__init__(logger, definition, typedict, struct_type_class, - simple_type_class, field_class) + super(CMessage, self).__init__(logger, definition, typedict, + struct_type_class, simple_type_class, + field_class) self.payload_members = [ " %s" % p.get_c_def() for p in self.fields diff --git a/src/vpp-api/vapi/vapi_cpp_gen.py b/src/vpp-api/vapi/vapi_cpp_gen.py index 6e9f5d3f..3010f3e1 100755 --- a/src/vpp-api/vapi/vapi_cpp_gen.py +++ b/src/vpp-api/vapi/vapi_cpp_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 import argparse import os @@ -16,30 +16,31 @@ class CppField(CField): field_type, array_len=None, nelem_field=None): - super().__init__(field_name, field_type, array_len, nelem_field) + super(CppField, self).__init__( + field_name, field_type, array_len, nelem_field) class CppStruct(CStruct): def __init__(self, name, fields): - super().__init__(name, fields) + super(CppStruct, self).__init__(name, fields) class CppSimpleType (CSimpleType): - def __init__(self, name): - super().__init__(name) + super(CppSimpleType, self).__init__(name) class CppStructType (CStructType, CppStruct): def __init__(self, definition, typedict, field_class): - super().__init__(definition, typedict, field_class) + super(CppStructType, self).__init__(definition, typedict, field_class) class CppMessage (CMessage): def __init__(self, logger, definition, typedict, struct_type_class, simple_type_class, field_class): - super().__init__(logger, definition, typedict, struct_type_class, - simple_type_class, field_class) + super(CppMessage, self).__init__( + logger, definition, typedict, struct_type_class, + simple_type_class, field_class) def get_swap_to_be_template_instantiation(self): return "\n".join([ diff --git a/src/vpp-api/vapi/vapi_json_parser.py b/src/vpp-api/vapi/vapi_json_parser.py index 1e17c7a5..4e62720d 100644 --- a/src/vpp-api/vapi/vapi_json_parser.py +++ b/src/vpp-api/vapi/vapi_json_parser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 import json @@ -22,7 +22,7 @@ def remove_magic(what): return what -class Field: +class Field(object): def __init__( self, @@ -46,7 +46,7 @@ class Field: (self.name, self.type, self.nelem_field)) -class Type: +class Type(object): def __init__(self, name): self.name = name @@ -54,7 +54,7 @@ class Type: class SimpleType (Type): def __init__(self, name): - super().__init__(name) + super(SimpleType, self).__init__(name) def __str__(self): return self.name @@ -78,7 +78,7 @@ def get_msg_header_defs(struct_type_class, field_class, typedict): ] -class Struct: +class Struct(object): def __init__(self, name, fields): self.name = name @@ -86,7 +86,7 @@ class Struct: self.field_names = [n.name for n in self.fields] -class Message: +class Message(object): def __init__(self, logger, definition, typedict, struct_type_class, simple_type_class, field_class): @@ -217,7 +217,7 @@ class StructType (Type, Struct): return True -class JsonParser: +class JsonParser(object): def __init__(self, logger, files, simple_type_class=SimpleType, struct_type_class=StructType, field_class=Field, message_class=Message): |