|
@@ -111,4 +111,26 @@ def rule6_decorator(f, *args, **kwargs):
|
|
|
predict_line[2] = '营养素参考值'+r[1]
|
|
|
except IndexError as e:
|
|
|
print('rule6_decorator', e)
|
|
|
- return predict_line
|
|
|
+ return predict_line
|
|
|
+
|
|
|
+
|
|
|
+decorators = []
|
|
|
+
|
|
|
+
|
|
|
+def register_decorator(decorator):
|
|
|
+ decorators.append(decorator)
|
|
|
+
|
|
|
+
|
|
|
+def combined_decorator(func):
|
|
|
+ for decorator in reversed(decorators):
|
|
|
+ func = decorator(func)
|
|
|
+ return func
|
|
|
+
|
|
|
+
|
|
|
+register_decorator(rule1_decorator)
|
|
|
+register_decorator(rule2_decorator)
|
|
|
+register_decorator(rule3_decorator)
|
|
|
+register_decorator(rule4_decorator)
|
|
|
+register_decorator(rule5_decorator)
|
|
|
+register_decorator(rule6_decorator)
|
|
|
+
|