Commit e6315294 authored by Stefan Behnel's avatar Stefan Behnel

Remove special case support for block name suffix after "XYZ.proto" utility...

Remove special case support for block name suffix after "XYZ.proto" utility code title. Replaced by existing "@proto_block" option.
parent fd187736
...@@ -138,19 +138,16 @@ class UtilityCodeBase(object): ...@@ -138,19 +138,16 @@ class UtilityCodeBase(object):
if type == 'proto': if type == 'proto':
utility[0] = code utility[0] = code
elif type.startswith('proto.'):
utility[0] = code
utility[1] = type[6:]
elif type == 'impl': elif type == 'impl':
utility[2] = code utility[1] = code
else: else:
all_tags = utility[3] all_tags = utility[2]
if KEYWORDS_MUST_BE_BYTES: if KEYWORDS_MUST_BE_BYTES:
type = type.encode('ASCII') type = type.encode('ASCII')
all_tags[type] = code all_tags[type] = code
if tags: if tags:
all_tags = utility[3] all_tags = utility[2]
for name, values in tags.items(): for name, values in tags.items():
if KEYWORDS_MUST_BE_BYTES: if KEYWORDS_MUST_BE_BYTES:
name = name.encode('ASCII') name = name.encode('ASCII')
...@@ -181,7 +178,7 @@ class UtilityCodeBase(object): ...@@ -181,7 +178,7 @@ class UtilityCodeBase(object):
with closing(Utils.open_source_file(filename, encoding='UTF-8')) as f: with closing(Utils.open_source_file(filename, encoding='UTF-8')) as f:
all_lines = f.readlines() all_lines = f.readlines()
utilities = defaultdict(lambda: [None, None, None, {}]) utilities = defaultdict(lambda: [None, None, {}])
lines = [] lines = []
tags = defaultdict(set) tags = defaultdict(set)
utility = type = None utility = type = None
...@@ -255,7 +252,7 @@ class UtilityCodeBase(object): ...@@ -255,7 +252,7 @@ class UtilityCodeBase(object):
from_file = files[0] from_file = files[0]
utilities = cls.load_utilities_from_file(from_file) utilities = cls.load_utilities_from_file(from_file)
proto, proto_block, impl, tags = utilities[util_code_name] proto, impl, tags = utilities[util_code_name]
if tags: if tags:
orig_kwargs = kwargs.copy() orig_kwargs = kwargs.copy()
...@@ -279,8 +276,6 @@ class UtilityCodeBase(object): ...@@ -279,8 +276,6 @@ class UtilityCodeBase(object):
if proto is not None: if proto is not None:
kwargs['proto'] = proto kwargs['proto'] = proto
if proto_block is not None:
kwargs['proto_block'] = proto_block
if impl is not None: if impl is not None:
kwargs['impl'] = impl kwargs['impl'] = impl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment