1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Fixes the make_doc.sh, <, > and & signs in descriptions that cause the parser to break.

Documentation for HTTPClient.
Added a query_string_from_dict method to HTTPClient to create a x-www-form-urlencoded valid query string for GET and POST messages.
String now has http_escape() and http_unescape() methods to help facilitate the above query_string_from_dict method.
This commit is contained in:
Aren Villanueva
2015-11-18 22:33:29 +11:00
parent 36d620c633
commit 5c7e9e7e63
7 changed files with 118 additions and 8 deletions

View File

@@ -1,5 +1,19 @@
import sys
import xml.etree.ElementTree as ET
from xml.sax.saxutils import escape, unescape
html_escape_table = {
'"': "&quot;",
"'": "&apos;"
}
html_unescape_table = {v:k for k, v in html_escape_table.items()}
def html_escape(text):
return escape(text, html_escape_table)
def html_unescape(text):
return unescape(text, html_unescape_table)
input_list = []
@@ -96,7 +110,7 @@ def make_html_class_list(class_list,columns):
idx=0
for n in class_list:
col = idx/col_max
col = int(idx/col_max)
if (col>=columns):
col=columns-1
fit_columns[col]+=[n]
@@ -299,6 +313,7 @@ def make_type(p_type,p_parent):
def make_text_def(class_name,parent,text):
text = html_escape(text)
pos=0
while(True):
pos = text.find("[",pos)
@@ -598,7 +613,6 @@ def make_html_class(node):
descr=node.find("description")
if (descr!=None and descr.text.strip()!=""):
h4=ET.SubElement(div,"h4")
h4.text="Description:"
@@ -644,7 +658,6 @@ def make_html_class(node):
class_names=[]
classes={}
for file in input_list:
tree = ET.parse(file)
doc=tree.getroot()