def load_pip_requirements(self, files_map=None, freeze=True):
        if files_map is None:
            files_map = self.default_pip_files
        for group, requirements_txt in files_map.items():
            path = Path(requirements_txt)
            if not path.exists() and group.lower() == "all" and freeze:
                cmd = envoy.run("pip freeze")
                self[group].loads(cmd.std_out)
            elif path.exists():
                self[group].load(path)
def on_backend_added(self, sender, backend_id):
        """
        Signal callback executed when a new backend is loaded

        @param sender: not used, only here to let this function be used as a
                       callback
        @param backend_id: the id of the backend to add
        """
        # Add
        backend = self.req.get_backend(backend_id)
        if not backend:
            return
        self.add_backend(backend)
        self.refresh()
        # Select
        self.select_backend(backend_id)
        # Update it's enabled state
        self.on_backend_state_changed(None, backend.get_id())