|
@@ -116,4 +116,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(dtor):
|
|
|
+ decorators.append(dtor)
|
|
|
+
|
|
|
+
|
|
|
+def combined_decorator(func):
|
|
|
+ for dtor in reversed(decorators):
|
|
|
+ func = dtor(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)
|
|
|
+
|