Code Duplication    Length = 31-31 lines in 2 locations

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,

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5977-6007 (lines=31) @@
5974
        """
5975
        return self._send_xml_command(XmlCommand("get_version"))
5976
5977
    def help(
5978
        self, *, format: Optional[str] = None, help_type: Optional[str] = ""
5979
    ) -> Any:
5980
        """Get the help text
5981
5982
        Arguments:
5983
            format: One of "html", "rnc", "text" or "xml
5984
            help_type: One of "brief" or "". Default ""
5985
5986
        Returns:
5987
            The response. See :py:meth:`send_command` for details.
5988
        """
5989
        cmd = XmlCommand("help")
5990
5991
        if help_type not in ("", "brief"):
5992
            raise InvalidArgument(
5993
                'help_type argument must be an empty string or "brief"'
5994
            )
5995
5996
        cmd.set_attribute("type", help_type)
5997
5998
        if format:
5999
            if not format.lower() in ("html", "rnc", "text", "xml"):
6000
                raise InvalidArgument(
6001
                    "help format Argument must be one of html, rnc, text or "
6002
                    "xml"
6003
                )
6004
6005
            cmd.set_attribute("format", format)
6006
6007
        return self._send_xml_command(cmd)
6008
6009
    def modify_asset(self, asset_id: str, comment: Optional[str] = "") -> Any:
6010
        """Modifies an existing asset.