extract_swift_flags: fix the tables parsing
The code for parsing existing tables didn't find all the options because of spaces and new lines. This patch should now handle those characters. Change-Id: If6a5d8812e6e6f46e14944578cc5eb94d8374ccf
This commit is contained in:
parent
a8cb0407d8
commit
5dcedd48d3
|
@ -97,6 +97,11 @@ sufficient for many of the books.
|
||||||
Release notes
|
Release notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
0.14
|
||||||
|
----
|
||||||
|
|
||||||
|
* ``extract_swift_flags``: Correctly parses existing tables
|
||||||
|
|
||||||
0.13
|
0.13
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,10 @@ def get_existing_options(optfiles):
|
||||||
trlist = tbody.getElementsByTagName('tr')
|
trlist = tbody.getElementsByTagName('tr')
|
||||||
for tr in trlist:
|
for tr in trlist:
|
||||||
try:
|
try:
|
||||||
optentry = tr.childNodes[1].childNodes[0]
|
tdlist = tr.getElementsByTagName('td')
|
||||||
option, default = optentry.nodeValue.split('=', 1)
|
optentry = tdlist[0].childNodes[0].nodeValue
|
||||||
helptext = tr.childNodes[2].childNodes[0].nodeValue
|
option = optentry.split('=', 1)[0].strip()
|
||||||
|
helptext = tdlist[1].childNodes[0].nodeValue
|
||||||
except IndexError:
|
except IndexError:
|
||||||
continue
|
continue
|
||||||
if option not in options or 'No help text' in options[option]:
|
if option not in options or 'No help text' in options[option]:
|
||||||
|
|
Loading…
Reference in New Issue