forked from garnaat/missingcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_html.py
More file actions
27 lines (24 loc) · 834 Bytes
/
generate_html.py
File metadata and controls
27 lines (24 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import json
def generate_html():
"""
Just a simple function to generate a chunk of HTML that I can
paste into my blog entry detailing this same info. Makes it
easier to keep things up to date. Automating this completely
would be better but that will have to wait till I have time
to investigate blogger api's.
"""
fp = open('aws.json')
data = json.load(fp)
fp.close()
html = ''
keys = data['services'].keys()
keys.sort()
for service in keys:
value = data['services'][service]
html += '<b>%s</b>\n' % service
html += ' <ul>\n'
for region in value['regions']:
html += ' <li>%s: %s</li>\n' % (region['name'],
region['endpoint'])
html += ' </ul>\n'
return html