Code Duplication    Length = 31-31 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5945-5975 (lines=31) @@
5942
        """
5943
        return self._send_xml_command(XmlCommand("get_version"))
5944
5945
    def help(
5946
        self, *, format: Optional[str] = None, help_type: Optional[str] = ""
5947
    ) -> Any:
5948
        """Get the help text
5949
5950
        Arguments:
5951
            format: One of "html", "rnc", "text" or "xml
5952
            help_type: One of "brief" or "". Default ""
5953
5954
        Returns:
5955
            The response. See :py:meth:`send_command` for details.
5956
        """
5957
        cmd = XmlCommand("help")
5958
5959
        if help_type not in ("", "brief"):
5960
            raise InvalidArgument(
5961
                'help_type argument must be an empty string or "brief"'
5962
            )
5963
5964
        cmd.set_attribute("type", help_type)
5965
5966
        if format:
5967
            if not format.lower() in ("html", "rnc", "text", "xml"):
5968
                raise InvalidArgument(
5969
                    "help format Argument must be one of html, rnc, text or "
5970
                    "xml"
5971
                )
5972
5973
            cmd.set_attribute("format", format)
5974
5975
        return self._send_xml_command(cmd)
5976
5977
    def modify_asset(self, asset_id: str, comment: Optional[str] = "") -> Any:
5978
        """Modifies an existing asset.

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 4370-4400 (lines=31) @@
4367
        """
4368
        return self._send_xml_command(XmlCommand("get_version"))
4369
4370
    def help(
4371
        self, *, format: Optional[str] = None, help_type: Optional[str] = ""
4372
    ) -> Any:
4373
        """Get the help text
4374
4375
        Arguments:
4376
            format: One of "html", "rnc", "text" or "xml
4377
            help_type: One of "brief" or "". Default ""
4378
4379
        Returns:
4380
            The response. See :py:meth:`send_command` for details.
4381
        """
4382
        cmd = XmlCommand("help")
4383
4384
        if help_type not in ("", "brief"):
4385
            raise InvalidArgument(
4386
                'help_type argument must be an empty string or "brief"'
4387
            )
4388
4389
        cmd.set_attribute("type", help_type)
4390
4391
        if format:
4392
            if not format.lower() in ("html", "rnc", "text", "xml"):
4393
                raise InvalidArgument(
4394
                    "help format Argument must be one of html, rnc, text or "
4395
                    "xml"
4396
                )
4397
4398
            cmd.set_attribute("format", format)
4399
4400
        return self._send_xml_command(cmd)
4401
4402
    def modify_agent(
4403
        self,