Fix lint errors
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
"""Flask web server."""
|
||||
|
||||
from flask import Flask, render_template, request
|
||||
from app.send_page import send_page
|
||||
|
||||
@ -8,10 +10,12 @@ app = Flask(__name__)
|
||||
|
||||
@app.route("/", methods=['GET'])
|
||||
def index():
|
||||
"""Returns index template."""
|
||||
return render_template('index.html', status='')
|
||||
|
||||
@app.route("/", methods=['POST'])
|
||||
def send():
|
||||
"""POST function"""
|
||||
result = send_page(
|
||||
name=request.form.get('name'),
|
||||
email=request.form.get('email'),
|
||||
|
@ -1,11 +1,14 @@
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
"""Main module."""
|
||||
|
||||
from app.app import app
|
||||
|
||||
|
||||
def main():
|
||||
"""Run the app."""
|
||||
app.run()
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -1,10 +1,13 @@
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
"""Send messages via the Pushover API."""
|
||||
|
||||
import os
|
||||
import requests
|
||||
|
||||
|
||||
def send_page(name: str, email: str, message: str) -> tuple:
|
||||
"""POST to the Pushover API."""
|
||||
api_url = "https://api.pushover.net/1/messages.json"
|
||||
api_token = os.getenv('PUSHOVER_API_TOKEN')
|
||||
user_key = os.getenv('PUSHOVER_USER_KEY')
|
||||
|
Reference in New Issue
Block a user