Code Duplication    Length = 25-27 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2953-2979 (lines=27) @@
2950
        cmd.set_attribute("details", "1")
2951
        return self._send_xml_command(cmd)
2952
2953
    def get_notes(
2954
        self, *, filter=None, filter_id=None, details=None, result=None
2955
    ):
2956
        """Request a list of notes
2957
2958
        Arguments:
2959
            filter (str, optional): Filter term to use for the query
2960
            filter_id (str, optional): UUID of an existing filter to use for
2961
                the query
2962
            details (boolean, optional): Add info about connected results and
2963
                tasks
2964
            result (boolean, optional): Return the details of possible connected
2965
                results.
2966
2967
        Returns:
2968
            The response. See :py:meth:`send_command` for details.
2969
        """
2970
        cmd = XmlCommand("get_notes")
2971
2972
        _add_filter(cmd, filter, filter_id)
2973
2974
        if not details is None:
2975
            cmd.set_attribute("details", _to_bool(details))
2976
2977
        if not result is None:
2978
            cmd.set_attribute("result", _to_bool(result))
2979
2980
        return self._send_xml_command(cmd)
2981
2982
    def get_note(self, note_id):
@@ 3100-3124 (lines=25) @@
3097
3098
        return self._send_xml_command(cmd)
3099
3100
    def get_overrides(
3101
        self, *, filter=None, filter_id=None, details=None, result=None
3102
    ):
3103
        """Request a list of overrides
3104
3105
        Arguments:
3106
            filter (str, optional): Filter term to use for the query
3107
            filter_id (str, optional): UUID of an existing filter to use for
3108
                the query
3109
            details (boolean, optional):
3110
            result (boolean, optional):
3111
3112
        Returns:
3113
            The response. See :py:meth:`send_command` for details.
3114
        """
3115
        cmd = XmlCommand("get_overrides")
3116
3117
        _add_filter(cmd, filter, filter_id)
3118
3119
        if not details is None:
3120
            cmd.set_attribute("details", _to_bool(details))
3121
3122
        if not result is None:
3123
            cmd.set_attribute("result", _to_bool(result))
3124
3125
        return self._send_xml_command(cmd)
3126
3127
    def get_override(self, override_id):