Code Duplication    Length = 25-27 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2667-2693 (lines=27) @@
2664
        cmd.set_attribute('details', '1')
2665
        return self._send_xml_command(cmd)
2666
2667
    def get_notes(self, *, filter=None, filter_id=None, details=None,
2668
                  result=None):
2669
        """Request a list of notes
2670
2671
        Arguments:
2672
            filter (str, optional): Filter term to use for the query
2673
            filter_id (str, optional): UUID of an existing filter to use for
2674
                the query
2675
            details (boolean, optional): Add info about connected results and
2676
                tasks
2677
            result (boolean, optional): Return the details of possible connected
2678
                results.
2679
2680
        Returns:
2681
            The response. See :py:meth:`send_command` for details.
2682
        """
2683
        cmd = XmlCommand('get_notes')
2684
2685
        _add_filter(cmd, filter, filter_id)
2686
2687
        if not details is None:
2688
            cmd.set_attribute('details', _to_bool(details))
2689
2690
        if not result is None:
2691
            cmd.set_attribute('result', _to_bool(result))
2692
2693
        return self._send_xml_command(cmd)
2694
2695
    def get_note(self, note_id):
2696
        """Request a single note
@@ 2805-2829 (lines=25) @@
2802
2803
        return self._send_xml_command(cmd)
2804
2805
    def get_overrides(self, *, filter=None, filter_id=None, details=None,
2806
                      result=None):
2807
        """Request a list of overrides
2808
2809
        Arguments:
2810
            filter (str, optional): Filter term to use for the query
2811
            filter_id (str, optional): UUID of an existing filter to use for
2812
                the query
2813
            details (boolean, optional):
2814
            result (boolean, optional):
2815
2816
        Returns:
2817
            The response. See :py:meth:`send_command` for details.
2818
        """
2819
        cmd = XmlCommand('get_overrides')
2820
2821
        _add_filter(cmd, filter, filter_id)
2822
2823
        if not details is None:
2824
            cmd.set_attribute('details', _to_bool(details))
2825
2826
        if not result is None:
2827
            cmd.set_attribute('result', _to_bool(result))
2828
2829
        return self._send_xml_command(cmd)
2830
2831
    def get_override(self, override_id):
2832
        """Request a single override