use ordered dictionary
This commit is contained in:
parent
86ebe46376
commit
ec57a59654
@ -1,3 +1,3 @@
|
|||||||
# bink
|
# bink
|
||||||
|
|
||||||
serverless microblogging for tilde.town
|
serverless forum for tilde.town
|
3
bink.py
3
bink.py
@ -4,6 +4,7 @@ import json
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
from time import time_ns
|
from time import time_ns
|
||||||
import os
|
import os
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
home = os.path.expanduser("~/.bink")
|
home = os.path.expanduser("~/.bink")
|
||||||
my_user = home.split("/")[2]
|
my_user = home.split("/")[2]
|
||||||
@ -25,7 +26,7 @@ def post_object(path):
|
|||||||
def generate_feed():
|
def generate_feed():
|
||||||
posts = [post_object(path) for path in glob("/home/**/.bink/*")]
|
posts = [post_object(path) for path in glob("/home/**/.bink/*")]
|
||||||
posts.sort(key=lambda x: x[0])
|
posts.sort(key=lambda x: x[0])
|
||||||
tree = {}
|
tree = OrderedDict()
|
||||||
for time, user, path in posts:
|
for time, user, path in posts:
|
||||||
# try:
|
# try:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user