make threads subdir under board so we can put an index.json there with board metadata
This commit is contained in:
parent
eabf099f47
commit
6fb7980218
@ -13,6 +13,10 @@ def output (data, destination):
|
|||||||
|
|
||||||
def output_forum (data, destination):
|
def output_forum (data, destination):
|
||||||
os.makedirs(destination)
|
os.makedirs(destination)
|
||||||
|
|
||||||
|
with open(os.path.join(destination, "index.json"), "w") as out_file:
|
||||||
|
out_file.write(json.dumps({title: data.title}, indent=4))
|
||||||
|
|
||||||
for category in data.categories:
|
for category in data.categories:
|
||||||
os.makedirs(os.path.join(destination, category.title))
|
os.makedirs(os.path.join(destination, category.title))
|
||||||
for board in category.children:
|
for board in category.children:
|
||||||
@ -20,8 +24,12 @@ def output_forum (data, destination):
|
|||||||
|
|
||||||
def output_board (data, destination):
|
def output_board (data, destination):
|
||||||
os.makedirs(destination)
|
os.makedirs(destination)
|
||||||
|
os.makedirs(os.path.join(destination, "threads"))
|
||||||
|
with open(os.path.join(destination, "index.json"), "w") as out_file:
|
||||||
|
out_file.write(json.dumps({"title": data.title}, indent=4))
|
||||||
|
|
||||||
for thread in data.children:
|
for thread in data.children:
|
||||||
output_thread(thread, os.path.join(destination, thread.title))
|
output_thread(thread, os.path.join(destination, "threads", thread.title))
|
||||||
|
|
||||||
def output_thread (data, destination):
|
def output_thread (data, destination):
|
||||||
with open(destination, "w") as out_file:
|
with open(destination, "w") as out_file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user