added generic rule generation

This commit is contained in:
PatchOfScotland
2022-12-12 11:01:26 +01:00
parent ccaca5e60e
commit 4041b86343
12 changed files with 251 additions and 51 deletions

2
rules/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from rules.file_event_jupyter_notebook_rule import FileEventJupyterNotebookRule

View File

@ -5,6 +5,8 @@ from patterns.file_event_pattern import FileEventPattern
from recipes.jupyter_notebook_recipe import JupyterNotebookRecipe
class FileEventJupyterNotebookRule(BaseRule):
pattern_type = "FileEventPattern"
recipe_type = "JupyterNotebookRecipe"
def __init__(self, name: str, pattern:FileEventPattern,
recipe:JupyterNotebookRecipe):
super().__init__(name, pattern, recipe)
@ -18,3 +20,6 @@ class FileEventJupyterNotebookRule(BaseRule):
def _is_valid_recipe(self, recipe:JupyterNotebookRecipe) -> None:
check_input(recipe, JupyterNotebookRecipe)
def _set_pattern_type(self)->None:
self.pattern_type