Code Duplication    Length = 25-27 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 3025-3051 (lines=27) @@
3022
        cmd.set_attribute("details", "1")
3023
        return self._send_xml_command(cmd)
3024
3025
    def get_notes(
3026
        self, *, filter=None, filter_id=None, details=None, result=None
3027
    ):
3028
        """Request a list of notes
3029
3030
        Arguments:
3031
            filter (str, optional): Filter term to use for the query
3032
            filter_id (str, optional): UUID of an existing filter to use for
3033
                the query
3034
            details (boolean, optional): Add info about connected results and
3035
                tasks
3036
            result (boolean, optional): Return the details of possible connected
3037
                results.
3038
3039
        Returns:
3040
            The response. See :py:meth:`send_command` for details.
3041
        """
3042
        cmd = XmlCommand("get_notes")
3043
3044
        _add_filter(cmd, filter, filter_id)
3045
3046
        if not details is None:
3047
            cmd.set_attribute("details", _to_bool(details))
3048
3049
        if not result is None:
3050
            cmd.set_attribute("result", _to_bool(result))
3051
3052
        return self._send_xml_command(cmd)
3053
3054
    def get_note(self, note_id):
@@ 3172-3196 (lines=25) @@
3169
3170
        return self._send_xml_command(cmd)
3171
3172
    def get_overrides(
3173
        self, *, filter=None, filter_id=None, details=None, result=None
3174
    ):
3175
        """Request a list of overrides
3176
3177
        Arguments:
3178
            filter (str, optional): Filter term to use for the query
3179
            filter_id (str, optional): UUID of an existing filter to use for
3180
                the query
3181
            details (boolean, optional):
3182
            result (boolean, optional):
3183
3184
        Returns:
3185
            The response. See :py:meth:`send_command` for details.
3186
        """
3187
        cmd = XmlCommand("get_overrides")
3188
3189
        _add_filter(cmd, filter, filter_id)
3190
3191
        if not details is None:
3192
            cmd.set_attribute("details", _to_bool(details))
3193
3194
        if not result is None:
3195
            cmd.set_attribute("result", _to_bool(result))
3196
3197
        return self._send_xml_command(cmd)
3198
3199
    def get_override(self, override_id):