Пример #1
0
 def revert_overrides_agents(self):
     if not hasattr(self, 'snapshot_agents'):
         return
     else:
         r = applications.get_agent_registry()
         r.reset(self.snapshot_agents)
         base.get_registry().reset(self.snapshot_restorators)
         del(self.snapshot_agents)
         del(self.snapshot_restorators)
Пример #2
0
    def override_agent(self, agent_type, factory, application=feat):
        r = applications.get_agent_registry()
        if not hasattr(self, 'snapshot_agents'):
            self.snapshot_agents = r.get_snapshot()
            self.snapshot_restorators = base.get_registry().get_snapshot()

        application.register_agent(agent_type)(factory)