Пример #1
0
 def get_interpreter(self) -> Interpreter:
     """ Use the activity key to determine which symbols are added
     to the formula interpreter.
     """
     interpreter = Interpreter()
     act = ActivityParameter.get_or_none(database=self.key[0],
                                         code=self.key[1])
     if act:
         interpreter.symtable.update(
             ActivityParameter.static(act.group, full=True))
     else:
         print("No parameter found for {}, creating one on formula save".
               format(self.key))
         interpreter.symtable.update(ProjectParameter.static())
         interpreter.symtable.update(DatabaseParameter.static(self.key[0]))
     return interpreter
Пример #2
0
 def get_interpreter(self) -> Interpreter:
     interpreter = Interpreter()
     group = self.get_current_group()
     interpreter.symtable.update(ActivityParameter.static(group, full=True))
     return interpreter