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 import getenv
|
||||||
from os.path import dirname, join
|
from os.path import dirname, join
|
||||||
|
|
||||||
|
import typer
|
||||||
|
|
||||||
# Load environment variables from .env file
|
# Load environment variables from .env file
|
||||||
dotenv_path = join(dirname(__file__), ".env")
|
dotenv_path = join(dirname(__file__), ".env")
|
||||||
load_dotenv(dotenv_path)
|
load_dotenv(dotenv_path)
|
||||||
|
|
||||||
# TODO: Flag --now to run temporarily and just execute hourly tasks instantly then exit
|
|
||||||
# TODO: Logging
|
# TODO: Logging
|
||||||
# TODO: Email alerts + structure
|
# TODO: Email alerts + structure
|
||||||
# TODO: Use typer for CLI
|
# TODO: Use typer for CLI
|
||||||
# TODO: Fix readme and git.uthmn.com page for final release.
|
# TODO: Fix readme and git.uthmn.com page for final release.
|
||||||
# TODO: Error handling all round
|
# 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}")
|
print(f"Error receiving emails: {e}")
|
||||||
|
|
||||||
return emails
|
return emails
|
||||||
|
|
||||||
print(receive_emails())
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user