From 241dfa8ba603f69c90e75dd30f69146fdab66dac Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sun, 2 Oct 2022 16:32:01 -0400 Subject: [PATCH] Rename undercover/ to app/ --- {undercover => app}/__init__.py | 3 +-- {undercover => app}/db.py | 2 +- {undercover => app}/email.py | 2 +- {undercover => app}/fallback.py | 0 {undercover => app}/pdf_builder.py | 0 {undercover => app}/routes.py | 7 +++---- {undercover => app}/static/favicon.png | Bin {undercover => app}/static/fonts/Barlow-Medium.ttf | Bin {undercover => app}/static/fonts/Barlow-Regular.ttf | Bin {undercover => app}/static/styles.css | 0 {undercover => app}/templates/_formhelpers.jinja2 | 0 {undercover => app}/templates/base.jinja2 | 0 {undercover => app}/templates/error.jinja2 | 0 {undercover => app}/templates/writing.jinja2 | 0 start | 2 +- 15 files changed, 7 insertions(+), 9 deletions(-) rename {undercover => app}/__init__.py (96%) rename {undercover => app}/db.py (99%) rename {undercover => app}/email.py (97%) rename {undercover => app}/fallback.py (100%) rename {undercover => app}/pdf_builder.py (100%) rename {undercover => app}/routes.py (97%) rename {undercover => app}/static/favicon.png (100%) rename {undercover => app}/static/fonts/Barlow-Medium.ttf (100%) rename {undercover => app}/static/fonts/Barlow-Regular.ttf (100%) rename {undercover => app}/static/styles.css (100%) rename {undercover => app}/templates/_formhelpers.jinja2 (100%) rename {undercover => app}/templates/base.jinja2 (100%) rename {undercover => app}/templates/error.jinja2 (100%) rename {undercover => app}/templates/writing.jinja2 (100%) diff --git a/undercover/__init__.py b/app/__init__.py similarity index 96% rename from undercover/__init__.py rename to app/__init__.py index 183083d..82ae34a 100644 --- a/undercover/__init__.py +++ b/app/__init__.py @@ -7,8 +7,7 @@ from flask import Flask, Response, make_response, render_template from flask_minify import Minify from werkzeug.exceptions import HTTPException -import undercover.routes -import undercover.email +from app import routes, email def create_app(test_config=None) -> Flask: diff --git a/undercover/db.py b/app/db.py similarity index 99% rename from undercover/db.py rename to app/db.py index c5fbbf1..0afe533 100644 --- a/undercover/db.py +++ b/app/db.py @@ -9,7 +9,7 @@ from uuid import uuid4, UUID import bcrypt import psycopg -from undercover.fallback import MockConnection +from app.fallback import MockConnection @dataclass diff --git a/undercover/email.py b/app/email.py similarity index 97% rename from undercover/email.py rename to app/email.py index 64f3054..ac908c0 100644 --- a/undercover/email.py +++ b/app/email.py @@ -3,7 +3,7 @@ import os import sys from mailjet_rest import Client -from undercover.fallback import mock_sender +from app.fallback import mock_sender api_key = os.environ.get('MAILJET_API_KEY') api_secret = os.environ.get('MAILJET_SECRET_KEY') diff --git a/undercover/fallback.py b/app/fallback.py similarity index 100% rename from undercover/fallback.py rename to app/fallback.py diff --git a/undercover/pdf_builder.py b/app/pdf_builder.py similarity index 100% rename from undercover/pdf_builder.py rename to app/pdf_builder.py diff --git a/undercover/routes.py b/app/routes.py similarity index 97% rename from undercover/routes.py rename to app/routes.py index eac3053..bd7aa16 100644 --- a/undercover/routes.py +++ b/app/routes.py @@ -6,13 +6,12 @@ import subprocess import threading import urllib.parse -from flask import (Blueprint, render_template, request, make_response, session, redirect, jsonify, Response) +from flask import Blueprint, render_template, request, make_response, session, redirect, jsonify, Response from wtforms import Form, SelectField, StringField, TextAreaField, validators from email_validator import validate_email, EmailNotValidError -import undercover.db as db -import undercover.email as email -from undercover.pdf_builder import CLData +from app import db, email +from app.pdf_builder import CLData writing_blueprint = Blueprint('writing', __name__) diff --git a/undercover/static/favicon.png b/app/static/favicon.png similarity index 100% rename from undercover/static/favicon.png rename to app/static/favicon.png diff --git a/undercover/static/fonts/Barlow-Medium.ttf b/app/static/fonts/Barlow-Medium.ttf similarity index 100% rename from undercover/static/fonts/Barlow-Medium.ttf rename to app/static/fonts/Barlow-Medium.ttf diff --git a/undercover/static/fonts/Barlow-Regular.ttf b/app/static/fonts/Barlow-Regular.ttf similarity index 100% rename from undercover/static/fonts/Barlow-Regular.ttf rename to app/static/fonts/Barlow-Regular.ttf diff --git a/undercover/static/styles.css b/app/static/styles.css similarity index 100% rename from undercover/static/styles.css rename to app/static/styles.css diff --git a/undercover/templates/_formhelpers.jinja2 b/app/templates/_formhelpers.jinja2 similarity index 100% rename from undercover/templates/_formhelpers.jinja2 rename to app/templates/_formhelpers.jinja2 diff --git a/undercover/templates/base.jinja2 b/app/templates/base.jinja2 similarity index 100% rename from undercover/templates/base.jinja2 rename to app/templates/base.jinja2 diff --git a/undercover/templates/error.jinja2 b/app/templates/error.jinja2 similarity index 100% rename from undercover/templates/error.jinja2 rename to app/templates/error.jinja2 diff --git a/undercover/templates/writing.jinja2 b/app/templates/writing.jinja2 similarity index 100% rename from undercover/templates/writing.jinja2 rename to app/templates/writing.jinja2 diff --git a/start b/start index 0362957..3f6ecc6 100755 --- a/start +++ b/start @@ -18,6 +18,6 @@ if [[ "$1" == "prod" ]]; then gunicorn -b localhost:8080 "undercover:create_app()" else echo "Starting local dev server..." - export FLASK_APP=undercover + export FLASK_APP=app flask --debug run --host=0.0.0.0 fi