Added placeholders and small change to mail
This commit is contained in:
parent
db0e301426
commit
80a354c484
29
main.py
29
main.py
@ -14,13 +14,40 @@ from dotenv import load_dotenv
|
||||
from os import getenv
|
||||
from os.path import dirname, join
|
||||
|
||||
import typer
|
||||
|
||||
# Load environment variables from .env file
|
||||
dotenv_path = join(dirname(__file__), ".env")
|
||||
load_dotenv(dotenv_path)
|
||||
|
||||
# TODO: Flag --now to run temporarily and just execute hourly tasks instantly then exit
|
||||
# TODO: Logging
|
||||
# TODO: Email alerts + structure
|
||||
# TODO: Use typer for CLI
|
||||
# TODO: Fix readme and git.uthmn.com page for final release.
|
||||
# TODO: Error handling all round
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
@app.command()
|
||||
def main():
|
||||
"""
|
||||
Checks for updates and emails hourly for security, daily for general as a daemon.
|
||||
"""
|
||||
pass
|
||||
|
||||
@app.command()
|
||||
def now():
|
||||
"""
|
||||
Checks for apt upgrades and emails them then exits.
|
||||
"""
|
||||
# TODO: Flag --now to run temporarily and just execute hourly tasks instantly then exit
|
||||
pass
|
||||
|
||||
@app.callback()
|
||||
def callback():
|
||||
"""
|
||||
Checks apt for upgrades and emails them
|
||||
"""
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
|
||||
@ -117,5 +117,3 @@ def receive_emails(folder="INBOX", limit=50):
|
||||
print(f"Error receiving emails: {e}")
|
||||
|
||||
return emails
|
||||
|
||||
print(receive_emails())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user