subscript_template/main.py

31 lines
671 B
Python
Raw Permalink Normal View History

2024-07-18 10:08:24 +00:00
import os
import json
from subscription import get_subscription, name
2024-07-18 10:08:24 +00:00
targetFile = "dist/%s.json" % name
2024-07-18 10:08:24 +00:00
def main():
print(
"""
------------------------------------------------------
\tGenerating subscription.json
------------------------------------------------------
"""
)
os.makedirs(os.path.dirname(targetFile), exist_ok=True)
with open(targetFile, "w", encoding="utf-8") as f:
json.dump(get_subscription(), f, ensure_ascii=False, indent=4)
print(
"""
------------------------------------------------------
\tDone
------------------------------------------------------
"""
)
if __name__ == "__main__":
main()