Code Duplication    Length = 25-27 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2707-2733 (lines=27) @@
2704
        cmd.set_attribute('details', '1')
2705
        return self._send_xml_command(cmd)
2706
2707
    def get_notes(self, *, filter=None, filter_id=None, details=None,
2708
                  result=None):
2709
        """Request a list of notes
2710
2711
        Arguments:
2712
            filter (str, optional): Filter term to use for the query
2713
            filter_id (str, optional): UUID of an existing filter to use for
2714
                the query
2715
            details (boolean, optional): Add info about connected results and
2716
                tasks
2717
            result (boolean, optional): Return the details of possible connected
2718
                results.
2719
2720
        Returns:
2721
            The response. See :py:meth:`send_command` for details.
2722
        """
2723
        cmd = XmlCommand('get_notes')
2724
2725
        _add_filter(cmd, filter, filter_id)
2726
2727
        if not details is None:
2728
            cmd.set_attribute('details', _to_bool(details))
2729
2730
        if not result is None:
2731
            cmd.set_attribute('result', _to_bool(result))
2732
2733
        return self._send_xml_command(cmd)
2734
2735
    def get_note(self, note_id):
2736
        """Request a single note
@@ 2845-2869 (lines=25) @@
2842
2843
        return self._send_xml_command(cmd)
2844
2845
    def get_overrides(self, *, filter=None, filter_id=None, details=None,
2846
                      result=None):
2847
        """Request a list of overrides
2848
2849
        Arguments:
2850
            filter (str, optional): Filter term to use for the query
2851
            filter_id (str, optional): UUID of an existing filter to use for
2852
                the query
2853
            details (boolean, optional):
2854
            result (boolean, optional):
2855
2856
        Returns:
2857
            The response. See :py:meth:`send_command` for details.
2858
        """
2859
        cmd = XmlCommand('get_overrides')
2860
2861
        _add_filter(cmd, filter, filter_id)
2862
2863
        if not details is None:
2864
            cmd.set_attribute('details', _to_bool(details))
2865
2866
        if not result is None:
2867
            cmd.set_attribute('result', _to_bool(result))
2868
2869
        return self._send_xml_command(cmd)
2870
2871
    def get_override(self, override_id):
2872
        """Request a single override