AI Implementation feature(1082): Project Scaffold and Docker Packaging (#1)
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from . import __version__
|
||||
from .config import ConfigError, load_config
|
||||
from .state import load_posted, save_posted
|
||||
|
||||
|
||||
log = logging.getLogger("tenbackward")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
|
||||
)
|
||||
|
||||
try:
|
||||
config = load_config()
|
||||
except ConfigError as exc:
|
||||
log.error("configuration error: %s", exc)
|
||||
return 2
|
||||
|
||||
config.data_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
state = load_posted(config.data_dir)
|
||||
save_posted(config.data_dir, state)
|
||||
|
||||
log.info(
|
||||
"10backward v%s ready (site=%s, run_at=%s, tz=%s, hashtags=%s, prefix=%r)",
|
||||
__version__,
|
||||
config.site_url,
|
||||
config.run_at,
|
||||
config.tz,
|
||||
config.hashtags,
|
||||
config.throwback_prefix,
|
||||
)
|
||||
|
||||
log.warning(
|
||||
"post pipeline is not yet implemented; this run only validates the scaffold. "
|
||||
"Future job will clone the blog and post a throwback via Mastodon.py."
|
||||
)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user