major rework of ythdd.py, new method for setting config in ythdd_globals.py

- slightly modified config, api keys now have the value "CHANGEME"
- requirements.txt has new dependency, flask apscheduler
- ythdd.py has been reworked, support for argument parsing has been added, code is now split into functions
- ythdd_api_v1.py features real uptime as well
- ythdd_db.py is no longer dependent on ythdd_globals.py
- ythdd_globals.py has a method for setting config and getting it from configfile variable
This commit is contained in:
2024-12-12 11:02:11 +01:00
parent c60f7db698
commit 1e4b05c33b
7 changed files with 161 additions and 60 deletions

View File

@@ -1,14 +1,14 @@
#!/usr/bin/python3
from flask_sqlalchemy import SQLAlchemy
import toml
import ythdd_globals
# import ythdd_globals
database_file = ythdd_globals.config["general"]["db_file_path"]
# database_file = ythdd_globals.config["general"]["db_file_path"]
global db
#db = SQLAlchemy()
def initDB(app):
def initDB(app, config):
db = SQLAlchemy(app)
class LocalUsers(db.Model):