Exemple #1
0
    output.append(html_headers(cursor, the_page.page_data))

output.append(page_results)

if the_page.page_data.get("Header", True) and page_results != "" and ajax != True:
    output.append(html_footers(cursor, the_page.page_data, False))


def _print_ignoring_error(text):
    text = re.sub(
        r"""[^a-zA-Z0-9! 	*$@?_#\-'"+<>()\[\]:=,.;/&\\{}%\n]""", "<strong style='color:#F00;'>*</strong>", text
    )
    print(text)


output = common.de_unicode("".join(output))

try:
    print(output)
except UnicodeEncodeError as e:
    ignore_uni_errror = common.get_val("iue", 0)

    f = open("/Library/WebServer/Documents/rob3/rob_out.html", "w", encoding="utf-8")
    content = f.write(output)
    f.close()

    if ignore_uni_errror:
        _print_ignoring_error(output)

    o = output
Exemple #2
0
elif m == 'remove_wonder':			import pages.cities.remove_wonder as the_page

# Map
# elif m == 'add_continent':			import pages.map.add_continent as the_page

# Nothing? 404?
else:								the_page = HTTP404()


output = []

cursor = database.get_cursor()
page_results = the_page.main(cursor)
ajax = bool(common.get_val('ajax', False))

if the_page.page_data.get("Redirect", "") != "":
	print("Location: web.py?mode={0}".format(the_page.page_data["Redirect"]))
	print("")

else:
	if the_page.page_data.get("Header", True) and page_results != "" and ajax != True:
		output.append(headers.main(cursor, the_page.page_data))
	
	output.append(page_results)
	
	if the_page.page_data.get("Header", True) and page_results != "" and ajax != True:
		output.append(headers.footers(cursor))
	
	print("")
	print(common.de_unicode("".join(output)))