From 5eeaaedded730ab97b456f39db0e8661772c289f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 28 Feb 2021 21:07:36 +0100 Subject: [PATCH] hack to support valid_network_netmask --- src/rougail/tiramisureflector.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 483387c22..bb1ad6fae 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -267,7 +267,8 @@ class Common: params = [f'{option_name}'] if hasattr(param, 'suffix'): param_type = 'ParamDynOption' - params.extend([f"'{param.suffix}'", f'{param.family.reflector_name}']) + family = param.family.reflector_object.get() + params.extend([f"'{param.suffix}'", f'{family}']) else: param_type = 'ParamOption' if not param.propertyerror: @@ -328,14 +329,22 @@ class Variable(Common): kwargs = [] # has parameters function = child.name + new_args = [] if hasattr(child, 'param'): for param in child.param: value = self.populate_param(param) if not hasattr(param, 'name'): - args.append(str(value)) +# args.append(str(value)) + new_args.append(str(value)) else: kwargs.append(f"'{param.name}': " + value) - ret = f'Calculation(func.{function}, Params((' + ', '.join(args) + ')' +# ret = f'Calculation(func.{function}, Params((' + ', '.join(args) + ')' + if function == 'valid_network_netmask': + new_args.extend(args) + else: + args.extend(new_args) + new_args = args + ret = f'Calculation(func.{function}, Params((' + ', '.join(new_args) + ')' if kwargs: ret += ', kwargs={' + ', '.join(kwargs) + '}' ret += ')'