- Timestamp:
- 2011-06-29 09:59:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/build_games.py
r2248 r2250 9 9 10 10 11 report_location = "\\\\eppu.it.jyu.fi\\kurssit\\npo\\temp" 11 12 output_dir = abspath("pelit") 12 13 lib_dir_x86 = abspath('lib\\x86') … … 14 15 projects_that_did_not_build = [] 15 16 report = Document() 16 document_root= ""17 table = "" 17 18 18 19 def check_requirements(): … … 33 34 34 35 35 def addElement(parent, name, value): 36 def addElement(parent, name): 37 node = report.createElement(name) 38 parent.appendChild(node) 39 return node 40 41 42 def addTextElement(parent, name, value): 36 43 node = report.createElement(name) 37 44 parent.appendChild(node) 38 45 node.appendChild(report.createTextNode(str(value))) 46 return node 39 47 40 48 41 49 def add_to_report(author, name, success): 42 e = report.createElement("game") 43 document_root.appendChild(e) 44 45 addElement(e, "author", author) 46 addElement(e, "name", name) 47 addElement(e, "success", success) 50 style = "success" 51 if not success: 52 style = "fail" 53 tr = addElement(table, "tr") 54 tr.setAttribute("class", style) 55 addTextElement(tr, "td", author) 56 addTextElement(tr, "td", name) 48 57 49 58 … … 87 96 88 97 def initialize_report(): 89 global document_root 90 document_root = report.createElement("games") 91 report.appendChild(document_root) 98 html = addElement(report, "html") 99 100 refresh_tag = addElement(html, "meta") 101 refresh_tag.setAttribute("http-equiv", "refresh") 102 refresh_tag.setAttribute("content", "30") 103 104 head = addElement(html, "head") 105 css_link = addElement(head, "link") 106 css_link.setAttribute("href", "build.css") 107 css_link.setAttribute("rel", "StyleSheet") 108 css_link.setAttribute("type", "text/css") 109 addTextElement(head, "title", "Build") 110 111 body = addElement(html, "body") 112 global table 113 table = addElement(body, "table") 92 114 93 115 94 116 def write_report(): 95 with open( "build_report.xml", "w") as f:117 with open(join(report_location, "build_report.html"), "w") as f: 96 118 f.write(report.toprettyxml()) 97 119
Note: See TracChangeset
for help on using the changeset viewer.