Example #1
0
    def edit(self, argv):
        """edit <name>
    Interact with the named device."""
        name = argv[1]
        obj = self._obj.get_object(name)
        if obj is None:
            self._print("No such device name. Choose from:")
            self._print_list(self._obj.keys())
            return

        if hasattr(obj, "get_configurator"):
            self._print("Getting configurator. This may take a while...")
            obj = obj.get_configurator(self._obj._logfile)
            self._print("ok.")
            cmd = CLI.get_generic_cmd(obj, self._ui.clone(), configuratorCLI.ConfiguratorCLI)
            if cmd:
                raise NewCommand, cmd
        else:
            cmd = slstorageCLI.get_editor(self, obj, obj.name)
            if cmd:
                raise NewCommand, cmd
            else:
                self._print("No editor for %r." % (obj,))