- Subspace: Opensource_gaming |
-
-
+ |
+ Mindustry |
+
+
+
-
-
+ |
-
- |
-
-
+ #mindustry-logic
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
+
+
-
-
+
+ |
+
+
+ |
+
+
+
-
-
-
- MeetAndMatch |
-
-
-
-
+ |
+ Minetest |
+
+
+
+
- Subspace: Open-Source-RTS-Xmas-party-Invite |
-
-
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Unvanquished (space) |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ The Mana World |
+
+
+
+ |
+
+
+ |
+
+
-
-
+ |
-
- |
-
-
+ Matrix
-
-
-
-
- |
-
-
-
-
-
-
-
- |
-
+
+
-
-
+
+ |
+
+
+ |
+
+
+ |
+
+
+
-
-
-
- Off-topic |
-
-
-
-
+ |
+ Blocknerd Games |
+
+
+
+
- Subspace: Historical |
-
-
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Engines |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ CorsixTH |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Godot |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ SimulaVR |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ OpenMW |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Communities |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Opensource_gaming |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Open-Source-RTS-Xmas-party-Invite |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ LibreGaming Community |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ onFOSS-LAN |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Historical |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+ Tools |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
diff --git a/script.py b/script.py
index 55d8c1e..e384849 100755
--- a/script.py
+++ b/script.py
@@ -9,25 +9,34 @@ def mxc2url(mxc):
mediaId = mxc.split('/')[3]
return "https://matrix.org/_matrix/media/v3/download/" + serverName + "/" + mediaId
-def render(spaces, template):
+def render(spaces, loops, template):
appTemplate = Template(filename=template)
- print(appTemplate.render(s=spaces))
+ print(appTemplate.render(s=spaces,loops=loops))
-def make_hierarchy(room, loops, depth=0):
+def make_hierarchy(space, room, loops):
try:
- print(' ' * depth + '- ' + room['name'])
- if room['children_state'] and room['room_id'] not in loops:
- for child in room['children_state']:
- make_hierarchy(ROOMS[child['state_key']], loops, depth+1)
+ if 'children' in space:
+ space['children'].append(room)
+ else:
+ space['children'] = [room]
+ if 'children_state' in room:
+ for child in room['children_state']:
+ if ROOMS[child['state_key']]['room_id'] not in loops:
+ make_hierarchy(room,ROOMS[child['state_key']], loops)
except:
- # missing or no name
- print(' ' * depth + ' Skip ' + room['room_id'])
+ pass
if __name__ == '__main__':
with open('libregamingspaces.json') as f:
data = json.load(f)
- # render(data, './spaces.html')
ROOMS = {room['room_id'] : room for room in data}
- make_hierarchy(ROOMS['!IdUUdKALNzBLKEjvbP:matrix.org'], ['!JTpfWshTKZpZiUASvP:hacklab.fi'])
+ spaces={'name':"TOP"}
+ loops=['!JTpfWshTKZpZiUASvP:hacklab.fi']
+ make_hierarchy(spaces,ROOMS['!IdUUdKALNzBLKEjvbP:matrix.org'], loops)
+ #print(spaces)
+ render(spaces, loops, './spaces.html')
+
+
+
diff --git a/spaces.html b/spaces.html
index 118b0b3..6905011 100644
--- a/spaces.html
+++ b/spaces.html
@@ -10,18 +10,19 @@
- <%def name="render(space)">
+ <%def name="render(room)">
- % for room in space:
% if 'avatar_url' in room:
|
% endif
- % if 'room_type' in room and room['room_type'] == "m.space":
- Subspace: ${room['name']} |
+ % if 'children' in room:
+ ${room['name']} |
- ${render(room['children_state'])} |
+ % for subroom in room['children']:
+ ${render(subroom)} |
+ % endfor
% else:
% if 'room_id' in room:
@@ -35,7 +36,6 @@
% endif
% endif
- % endfor
%def>
| | |