@@ -11,22 +11,21 @@ class NmapParser(object):
1111 def parse (cls , nmap_data = None , data_type = 'XML' , incomplete = False ):
1212 """
1313 Generic class method of NmapParser class.
14+
1415 The data to be parsed does not need to be a complete nmap
1516 scan report. You can possibly give <hosts>...</hosts>
1617 or <port> XML tags.
1718
18- :param nmap_data: any portion of nmap scan result.
19-
20- nmap_data should always be a string representing a part
19+ :param nmap_data: any portion of nmap scan result. \
20+ nmap_data should always be a string representing a part \
2121 or a complete nmap scan report.
22-
2322 :type nmap_data: string
2423
2524 :param data_type: specifies the type of data to be parsed.
2625 :type data_type: string ("XML"|"JSON"|"YAML").
2726
28- :param incomplete: enable you to parse interrupted nmap scans
29- and/or incomplete nmap xml blocks by adding a </nmaprun> at
27+ :param incomplete: enable you to parse interrupted nmap scans \
28+ and/or incomplete nmap xml blocks by adding a </nmaprun> at \
3029 the end of the scan.
3130 :type incomplete: boolean
3231
@@ -51,12 +50,12 @@ def _parse_xml(cls, nmap_data=None, incomplete=False):
5150 In this case: XML. This method is called by cls.parse class
5251 method and receives nmap scan results data (in XML).
5352
54- :param nmap_data: any portion of nmap scan result can be given
55- as argument. nmap_data should always be a string representing
53+ :param nmap_data: any portion of nmap scan result can be given \
54+ as argument. nmap_data should always be a string representing \
5655 a part or a complete nmap scan report.
5756 :type nmap_data: string
5857
59- This method checks which portion of a nmap scan is given
58+ This method checks which portion of a nmap scan is given \
6059 as argument.
6160 It could be:
6261
@@ -66,12 +65,12 @@ def _parse_xml(cls, nmap_data=None, incomplete=False):
6665 4. a list of hosts: <hosts/> tag (TODO)
6766 5. a list of ports: <ports/> tag
6867
69- :param incomplete: enable you to parse interrupted nmap scans
70- and/or incomplete nmap xml blocks by adding a </nmaprun> at
68+ :param incomplete: enable you to parse interrupted nmap scans \
69+ and/or incomplete nmap xml blocks by adding a </nmaprun> at \
7170 the end of the scan.
72-
7371 :type incomplete: boolean
74- :return: NmapObject (NmapHost, NmapService or NmapReport)
72+
73+ :return: NmapObject (NmapHost, NmapService or NmapReport) \
7574 or a list of NmapObject
7675 """
7776
@@ -140,19 +139,18 @@ def _parse_xml_report(cls, root=None):
140139 @classmethod
141140 def parse_fromstring (cls , nmap_data , data_type = "XML" , incomplete = False ):
142141 """
143- Call generic cls.parse() method and ensure that a string is
142+ Call generic cls.parse() method and ensure that a string is \
144143 passed on as argument. If not, an exception is raised.
145144
146- :param nmap_data: Same as for parse(), any portion of nmap scan.
147-
145+ :param nmap_data: Same as for parse(), any portion of nmap scan. \
148146 Reports could be passed as argument. Data type _must_ be a string.
149147
150148 :type nmap_data: string
151149
152150 :param data_type: Specifies the type of data passed on as argument.
153151
154- :param incomplete: enable you to parse interrupted nmap scans
155- and/or incomplete nmap xml blocks by adding a </nmaprun> at
152+ :param incomplete: enable you to parse interrupted nmap scans \
153+ and/or incomplete nmap xml blocks by adding a </nmaprun> at \
156154 the end of the scan.
157155 :type incomplete: boolean
158156
@@ -169,20 +167,18 @@ def parse_fromfile(cls, nmap_report_path,
169167 data_type = "XML" ,
170168 incomplete = False ):
171169 """
172- Call generic cls.parse() method and ensure that a correct file
170+ Call generic cls.parse() method and ensure that a correct file \
173171 path is given as argument. If not, an exception is raised.
174172
175- :param nmap_data: Same as for parse().
176-
177- Any portion of nmap scan reports could be passed as argument.
178-
179- Data type _must be a valid path to a file containing
173+ :param nmap_data: Same as for parse(). \
174+ Any portion of nmap scan reports could be passed as argument. \
175+ Data type _must be a valid path to a file containing \
180176 nmap scan results.
181177
182178 :param data_type: Specifies the type of serialization in the file.
183179
184- :param incomplete: enable you to parse interrupted nmap scans
185- and/or incomplete nmap xml blocks by adding a </nmaprun> at
180+ :param incomplete: enable you to parse interrupted nmap scans \
181+ and/or incomplete nmap xml blocks by adding a </nmaprun> at \
186182 the end of the scan.
187183 :type incomplete: boolean
188184
@@ -200,9 +196,9 @@ def parse_fromfile(cls, nmap_report_path,
200196 @classmethod
201197 def parse_fromdict (cls , rdict ):
202198 """
203- Strange method which transforms a python dict
204- representation of a NmapReport and turns it into an
205- NmapReport object.
199+ Strange method which transforms a python dict \
200+ representation of a NmapReport and turns it into an \
201+ NmapReport object. \
206202 Needs to be reviewed and possibly removed.
207203
208204 :param rdict: python dict representation of an NmapReport
0 commit comments