flake8 linting and other small updates
This commit is contained in:
parent
f1b606852b
commit
ccd584198f
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@ pip-wheel-metadata/
|
||||
|
||||
test/*
|
||||
*.db
|
||||
instance/*
|
||||
static/*
|
||||
|
@ -1,11 +1,11 @@
|
||||
def deploy():
|
||||
"""Run deployment of database."""
|
||||
from flask_migrate import init, migrate, stamp, upgrade
|
||||
|
||||
from app import create_app, db
|
||||
# This model is required for flask_migrate to make the table
|
||||
from postmodel import Post # noqa: F401
|
||||
|
||||
from app import create_app, db
|
||||
|
||||
app = create_app()
|
||||
app.app_context().push()
|
||||
db.create_all()
|
||||
|
@ -7,7 +7,21 @@ from sqlalchemy.exc import (DatabaseError, DataError, IntegrityError,
|
||||
InterfaceError, InvalidRequestError)
|
||||
|
||||
|
||||
def schedule_text(request):
|
||||
def schedule_post(request):
|
||||
if request.form["text"]:
|
||||
return _schedule_text(request)
|
||||
if request.form["file"]:
|
||||
return _schedule_file(request)
|
||||
|
||||
return "no correct header found"
|
||||
|
||||
|
||||
def _schedule_file(request):
|
||||
print(request.form["file"])
|
||||
return "not yet implemented"
|
||||
|
||||
|
||||
def _schedule_text(request):
|
||||
print(request.form["text"])
|
||||
try:
|
||||
text = request.form["text"]
|
||||
|
8
start.py
8
start.py
@ -1,8 +1,8 @@
|
||||
import flask_apscheduler
|
||||
from flask import Blueprint, Flask, request
|
||||
from flask import request
|
||||
|
||||
from app import create_app
|
||||
from scheduler.schedule_text import schedule_text
|
||||
from scheduler.schedule_text import schedule_post
|
||||
from updater import update_rss_feed
|
||||
|
||||
APP = create_app()
|
||||
@ -25,8 +25,8 @@ def index():
|
||||
|
||||
|
||||
@APP.route("/schedule", methods=["POST"])
|
||||
def schedule_post():
|
||||
return schedule_text(request)
|
||||
def schedule():
|
||||
return schedule_post(request)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -1,2 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><id>http://crunk.website</id><title>Crunk website</title><updated>2023-10-03T18:20:53.506614+00:00</updated><link href="http://crunk.website" rel="alternate"/><link href="http://crunk.website/test.atom" rel="self"/><generator uri="https://lkiesow.github.io/python-feedgen" version="0.9.0">python-feedgen</generator><subtitle>Some things crunk is doing!</subtitle></feed>
|
@ -1,2 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>Crunk website</title><link>http://crunk.website/test.atom</link><description>Some things crunk is doing!</description><atom:link href="http://crunk.website/test.atom" rel="self"/><docs>http://www.rssboard.org/rss-specification</docs><generator>python-feedgen</generator><language>en</language><lastBuildDate>Tue, 03 Oct 2023 18:20:53 +0000</lastBuildDate></channel></rss>
|
@ -32,7 +32,5 @@ def create_rss_feed():
|
||||
|
||||
|
||||
def write_rss_feed(fg):
|
||||
atomfeed = fg.atom_str(pretty=True)
|
||||
rssfeed = fg.rss_str(pretty=True)
|
||||
fg.atom_file("static/atom.xml")
|
||||
fg.rss_file("static/rss.xml")
|
||||
|
Loading…
Reference in New Issue
Block a user