Changeset 10681 in genesis
- Timestamp:
- May 6, 2012, 1:37:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10665 r10681 942 942 uri = base_uri.strip('/').split('/') 943 943 944 output = "" 944 output = "Template Holder" 945 content_type='text/plain' 945 946 if base_uri.endswith('/create/network.kml'): 946 output += "Content-type:application/vnd.google-earth.kml+xml\r\n\r\n"947 output += make_network_kml.make_graph()947 content_type='application/vnd.google-earth.kml+xml' 948 output = make_network_kml.make_graph() 948 949 elif not uri[0]: 949 950 if is_text_request(): 950 output += "Content-type:text/plain\r\n\r\n"951 output += '\n'.join(get_hostlist())951 content_type = 'text/plain' 952 output = '\n'.join(get_hostlist()) 952 953 else: 953 output += "Content-type:text/html\r\n\r\n"954 output += generate_title(get_hostlist())954 content_type = 'text/html' 955 output = generate_title(get_hostlist()) 955 956 elif len(uri) == 1: 956 957 if is_text_request(): 957 output += "Content-type:text/plain\r\n\r\n"958 output += generate_node(uri[0])958 content_type = 'text/plain' 959 output = generate_node(uri[0]) 959 960 else: 960 output += "Content-type:text/html\r\n\r\n"961 output += generate_node_overview(uri[0])961 content_type = 'text/html' 962 output = generate_node_overview(uri[0]) 962 963 elif len(uri) == 2: 963 output += "Content-type:text/plain\r\n\r\n"964 output += generate_config(uri[0], uri[1])964 content_type = 'text/plain' 965 output = generate_config(uri[0], uri[1]) 965 966 else: 966 967 assert False, "Invalid option" 968 969 print "Content-Type: %s" % content_type 970 print "Content-Length: %s" % len(output) 971 print "" 967 972 print output 968 973
Note:
See TracChangeset
for help on using the changeset viewer.