from automatron.backend.plugin import PluginManager
from automatron.controller.controller import IAutomatronClientActions
from automatron.core.controller import BaseController


class BackendController(BaseController):
    def __init__(self, config_file):
        BaseController.__init__(self, config_file)
        self.plugins = None

    def prepareService(self):
        # Load plugins
        self.plugins = PluginManager(self)

    def __getattr__(self, item):
        def proxy(*args):
            self.plugins.emit(IAutomatronClientActions[item], *args)
        return proxy

from functools import partial
from automatron.backend.plugin import PluginManager
from automatron.controller.controller import IAutomatronClientActions
from automatron.core.controller import BaseController


class BackendController(BaseController):
    def __init__(self, config_file):
        BaseController.__init__(self, config_file)
        self.plugins = None

    def prepareService(self):
        # Load plugins
        self.plugins = PluginManager(self)

    def __getattr__(self, item):
        return partial(self.plugins.emit, IAutomatronClientActions[item])

Use functools.partial for client action proxy.
Use functools.partial for client action proxy.

+ from functools import partial
  from automatron.backend.plugin import PluginManager
  from automatron.controller.controller import IAutomatronClientActions
  from automatron.core.controller import BaseController
  
  
  class BackendController(BaseController):
      def __init__(self, config_file):
          BaseController.__init__(self, config_file)
          self.plugins = None
  
      def prepareService(self):
          # Load plugins
          self.plugins = PluginManager(self)
  
      def __getattr__(self, item):
-         def proxy(*args):
-             self.plugins.emit(IAutomatronClientActions[item], *args)
+         return partial(self.plugins.emit, IAutomatronClientActions[item])
-         return proxy
  
Use functools.partial for client action proxy.
## Code Before:
from automatron.backend.plugin import PluginManager
from automatron.controller.controller import IAutomatronClientActions
from automatron.core.controller import BaseController


class BackendController(BaseController):
    def __init__(self, config_file):
        BaseController.__init__(self, config_file)
        self.plugins = None

    def prepareService(self):
        # Load plugins
        self.plugins = PluginManager(self)

    def __getattr__(self, item):
        def proxy(*args):
            self.plugins.emit(IAutomatronClientActions[item], *args)
        return proxy

## Instruction:
Use functools.partial for client action proxy.
## Code After:
from functools import partial
from automatron.backend.plugin import PluginManager
from automatron.controller.controller import IAutomatronClientActions
from automatron.core.controller import BaseController


class BackendController(BaseController):
    def __init__(self, config_file):
        BaseController.__init__(self, config_file)
        self.plugins = None

    def prepareService(self):
        # Load plugins
        self.plugins = PluginManager(self)

    def __getattr__(self, item):
        return partial(self.plugins.emit, IAutomatronClientActions[item])
