From 368f6b645b30555bcc714e8bfd5a3efc8e509e25 Mon Sep 17 00:00:00 2001 From: awkawb Date: Wed, 27 Dec 2023 16:40:47 -0500 Subject: [PATCH] added instance directory, added tests directory, removed markdown_content --- all_paw_care/__init__.py | 11 +- apc-db.dot | 18 ---- all_paw_care.db => instance/all_paw_care.db | Bin config.py => instance/config.py | 0 markdown_content/CHANGELOG.md | 13 --- markdown_content/Makefile | 15 --- markdown_content/README.md | 4 - markdown_content/__init__.py | 97 ------------------ .../public/forms/meet-and-greet.html | 1 - markdown_content/public/pages/about-me.html | 6 -- markdown_content/public/pages/contact-me.html | 5 - markdown_content/public/pages/faq/faq.html | 3 - .../faq/questions/accepted-payments.html | 12 --- .../faq/questions/additional-animals.html | 2 - .../faq/questions/invoice-payment-terms.html | 2 - .../public/pages/services/cards/drop-ins.html | 2 - .../pages/services/cards/house-sitting.html | 3 - .../public/pages/services/cards/walking.html | 2 - .../public/pages/services/services.html | 6 -- markdown_content/scripts/build.sh | 16 --- markdown_content/src/forms/meet-and-greet.md | 3 - markdown_content/src/pages/about-me.md | 13 --- markdown_content/src/pages/contact-me.md | 13 --- markdown_content/src/pages/faq/faq.md | 9 -- .../pages/faq/questions/accepted-payments.md | 16 --- .../pages/faq/questions/additional-animals.md | 7 -- .../faq/questions/invoice-payment-terms.md | 7 -- .../src/pages/services/cards/drop-ins.md | 8 -- .../src/pages/services/cards/house-sitting.md | 9 -- .../src/pages/services/cards/walking.md | 8 -- .../src/pages/services/services.md | 12 --- scripts/process-images.sh | 8 +- all_paw_care.sql => tests/all_paw_care.sql | 0 33 files changed, 10 insertions(+), 321 deletions(-) delete mode 100644 apc-db.dot rename all_paw_care.db => instance/all_paw_care.db (100%) rename config.py => instance/config.py (100%) delete mode 100644 markdown_content/CHANGELOG.md delete mode 100644 markdown_content/Makefile delete mode 100644 markdown_content/README.md delete mode 100644 markdown_content/__init__.py delete mode 100644 markdown_content/public/forms/meet-and-greet.html delete mode 100644 markdown_content/public/pages/about-me.html delete mode 100644 markdown_content/public/pages/contact-me.html delete mode 100644 markdown_content/public/pages/faq/faq.html delete mode 100644 markdown_content/public/pages/faq/questions/accepted-payments.html delete mode 100644 markdown_content/public/pages/faq/questions/additional-animals.html delete mode 100644 markdown_content/public/pages/faq/questions/invoice-payment-terms.html delete mode 100644 markdown_content/public/pages/services/cards/drop-ins.html delete mode 100644 markdown_content/public/pages/services/cards/house-sitting.html delete mode 100644 markdown_content/public/pages/services/cards/walking.html delete mode 100644 markdown_content/public/pages/services/services.html delete mode 100644 markdown_content/scripts/build.sh delete mode 100644 markdown_content/src/forms/meet-and-greet.md delete mode 100644 markdown_content/src/pages/about-me.md delete mode 100644 markdown_content/src/pages/contact-me.md delete mode 100644 markdown_content/src/pages/faq/faq.md delete mode 100644 markdown_content/src/pages/faq/questions/accepted-payments.md delete mode 100644 markdown_content/src/pages/faq/questions/additional-animals.md delete mode 100644 markdown_content/src/pages/faq/questions/invoice-payment-terms.md delete mode 100644 markdown_content/src/pages/services/cards/drop-ins.md delete mode 100644 markdown_content/src/pages/services/cards/house-sitting.md delete mode 100644 markdown_content/src/pages/services/cards/walking.md delete mode 100644 markdown_content/src/pages/services/services.md rename all_paw_care.sql => tests/all_paw_care.sql (100%) diff --git a/all_paw_care/__init__.py b/all_paw_care/__init__.py index 317bac1..4c341d1 100644 --- a/all_paw_care/__init__.py +++ b/all_paw_care/__init__.py @@ -4,9 +4,6 @@ from all_paw_care.pages import pages from all_paw_care.users import users from all_paw_care.db.actions import ensure_tables -# App config -from config import Config - # Flask from flask import Flask @@ -16,10 +13,10 @@ from sqlalchemy.orm import Session def create_app(): # Initialize app - all_paw_care = Flask(__name__) - - # Import config - all_paw_care.config.from_object(Config) + # + # Learn more about instance folders here: + # https://flask.palletsprojects.com/en/3.0.x/config/#instance-folders + all_paw_care = Flask(__name__, instance_relative_config=True) # Register app blueprints all_paw_care.register_blueprint(pages) diff --git a/apc-db.dot b/apc-db.dot deleted file mode 100644 index 8aaf65a..0000000 --- a/apc-db.dot +++ /dev/null @@ -1,18 +0,0 @@ -graph { - ROUTER[label="Router\n\ - IP Address: 10.0.0.1"]; - - KYLIA_CLOUD[label="kylia-cloud\n\ - IP Address: 10.0.0.11"]; - - AXIS_CAMERA[label="AXIS Camera\n\ - IP Address: 10.0.0.100"]; - - AWKAWB_CLOUD[label="awkawb-cloud\n\ - IP Address: 10.0.0.10"]; - - AWKAWB_PI4GAMING[label="awkawb-pi4gaming\n\ - IP Address: 10.0.0.12"]; - - ROUTER -- { AWKAWB_CLOUD KYLIA_CLOUD AWKAWB_PI4GAMING AXIS_CAMERA } -} diff --git a/all_paw_care.db b/instance/all_paw_care.db similarity index 100% rename from all_paw_care.db rename to instance/all_paw_care.db diff --git a/config.py b/instance/config.py similarity index 100% rename from config.py rename to instance/config.py diff --git a/markdown_content/CHANGELOG.md b/markdown_content/CHANGELOG.md deleted file mode 100644 index 494fdce..0000000 --- a/markdown_content/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on -[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this -project adheres to -[Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [0.0.1] - TBD - -Initial release - diff --git a/markdown_content/Makefile b/markdown_content/Makefile deleted file mode 100644 index 8a91a72..0000000 --- a/markdown_content/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -IP_ADDR = allpawcare.com -PUBLIC_DIR = public -BUILD_SCRIPT = scripts/build.sh - -.PHONY: all -all: clean - -.PHONY: clean-public-dir -clean-public-dir: - rm -rf ${PUBLIC_DIR}/* - -.PHONY: build -build: clean-public-dir - ./${BUILD_SCRIPT} - diff --git a/markdown_content/README.md b/markdown_content/README.md deleted file mode 100644 index bd7ff5c..0000000 --- a/markdown_content/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# www.AllPawCare.com markdown content - -Markdown assets for templates in -[www.allpawcare.com](https://gitea.awkawb.cloud/awkawb/www.allpawcare.com.git). diff --git a/markdown_content/__init__.py b/markdown_content/__init__.py deleted file mode 100644 index 7624211..0000000 --- a/markdown_content/__init__.py +++ /dev/null @@ -1,97 +0,0 @@ -''' - Converts site content written in Markdown to HTML. -''' - -class MarkdownContent(dict): - def __init__(self): - import frontmatter - import os - - # content paths with metadata - self.PAGES_METADATA = dict() - self.FORMS_METADATA = dict() - - for content_dir in self._CONTENT_DIRS: - self.__get_content(content_dir) - - def __getitem__(self, page): - return self.METADATA[page] - - def __content_page_faq(self): - ''' - Fetch FAQ page content. - ''' - - return True - - def __content_page_services(self): - ''' - Fetch services page content. - ''' - - return True - - def __content_page_about_me(self): - ''' - Fetch about me page content. - ''' - - return True - - def __content_page_contact_me(self): - ''' - Fetch contact me page content. - ''' - - return True - - def __content_form_meet_and_greet(self): - ''' - Fetch meet & greet form content. - ''' - - return True - - def __get_content(self, content_dir: str): - import frontmatter - import os - - metadata = dict() - - for items in os.walk(content_dir): - if len(items[2]) > 0: - for file in items[2]: - path = os.path.join(items[0], file) - - metadata[path] = \ - frontmatter.load(path).to_dict() - - return metadata - - def get_page(self, page: str): - ''' - Transforms Markdown to HTML for pages. - ''' - -# match page.lower(): -# case 'faq': -# return True -# -# case 'services': -# return True -# -# case 'about me': -# return True -# -# case 'contact me': -# return True - - def get_form(self, form: str): - ''' - Transforms Markdown to HTML for forms. - ''' - -# match form.lower(): -# case 'meet and greet': -# return True - diff --git a/markdown_content/public/forms/meet-and-greet.html b/markdown_content/public/forms/meet-and-greet.html deleted file mode 100644 index 8b13789..0000000 --- a/markdown_content/public/forms/meet-and-greet.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/markdown_content/public/pages/about-me.html b/markdown_content/public/pages/about-me.html deleted file mode 100644 index 0709c3d..0000000 --- a/markdown_content/public/pages/about-me.html +++ /dev/null @@ -1,6 +0,0 @@ -

Welcome to All Paw Care!

-

I’ve been providing professional animal caretaking services in the -Baltimore area for over 4 years. I provide services for paws of all -shapes and sizes and specialize in dog and cat care.

-

Animals add so much to our lives so caring for them is just as -important.

diff --git a/markdown_content/public/pages/contact-me.html b/markdown_content/public/pages/contact-me.html deleted file mode 100644 index 8b297a6..0000000 --- a/markdown_content/public/pages/contact-me.html +++ /dev/null @@ -1,5 +0,0 @@ -

If you have any questions,the FAQ page may have an answer.

-

If your question isn’t on the FAQ or you want to directly contact me, -email or text messages work best.

-

My personal Instagram page is public and includes pictures of my -animal caretaking work along with all my interests.

diff --git a/markdown_content/public/pages/faq/faq.html b/markdown_content/public/pages/faq/faq.html deleted file mode 100644 index b0c0d5a..0000000 --- a/markdown_content/public/pages/faq/faq.html +++ /dev/null @@ -1,3 +0,0 @@ -

Here you’ll find answers to some common questions. If what your -looking for can’t be found, head over to the contact me -page for information on communicating with me directly.

diff --git a/markdown_content/public/pages/faq/questions/accepted-payments.html b/markdown_content/public/pages/faq/questions/accepted-payments.html deleted file mode 100644 index 195b68f..0000000 --- a/markdown_content/public/pages/faq/questions/accepted-payments.html +++ /dev/null @@ -1,12 +0,0 @@ -

A broad range of payment types are accepted to make the process -easy.

- diff --git a/markdown_content/public/pages/faq/questions/additional-animals.html b/markdown_content/public/pages/faq/questions/additional-animals.html deleted file mode 100644 index e05b4a4..0000000 --- a/markdown_content/public/pages/faq/questions/additional-animals.html +++ /dev/null @@ -1,2 +0,0 @@ -

Additional animals are charged per addition. For example, a walking -service for three dogs incures two addtional dog fees.

diff --git a/markdown_content/public/pages/faq/questions/invoice-payment-terms.html b/markdown_content/public/pages/faq/questions/invoice-payment-terms.html deleted file mode 100644 index e724a20..0000000 --- a/markdown_content/public/pages/faq/questions/invoice-payment-terms.html +++ /dev/null @@ -1,2 +0,0 @@ -

Payments are due 7 days after invoicing. Invoices are sent on the day -of service or during (e.g house sitting).

diff --git a/markdown_content/public/pages/services/cards/drop-ins.html b/markdown_content/public/pages/services/cards/drop-ins.html deleted file mode 100644 index 42e1073..0000000 --- a/markdown_content/public/pages/services/cards/drop-ins.html +++ /dev/null @@ -1,2 +0,0 @@ -

Service includes 15 minutes of in-home play and/or care for your -dog/cat. Longer drop-ins are available!

diff --git a/markdown_content/public/pages/services/cards/house-sitting.html b/markdown_content/public/pages/services/cards/house-sitting.html deleted file mode 100644 index 0c769f1..0000000 --- a/markdown_content/public/pages/services/cards/house-sitting.html +++ /dev/null @@ -1,3 +0,0 @@ -

Service includes nightly in-home care for your animal. Drop-ins or -walks are provided during the day. Cleaning of cat litter is included -too!

diff --git a/markdown_content/public/pages/services/cards/walking.html b/markdown_content/public/pages/services/cards/walking.html deleted file mode 100644 index d2cc9ec..0000000 --- a/markdown_content/public/pages/services/cards/walking.html +++ /dev/null @@ -1,2 +0,0 @@ -

Service includes 30 minute walk for your dog/cat and bags for poop -clean-up.

diff --git a/markdown_content/public/pages/services/services.html b/markdown_content/public/pages/services/services.html deleted file mode 100644 index 6bfb7d0..0000000 --- a/markdown_content/public/pages/services/services.html +++ /dev/null @@ -1,6 +0,0 @@ -

All services are for a single animal. Additional animals are charged -seperately.

-

Set up a meeting before scheduling any service. I’ll come to your -home or some place more convienient. The meeting will serve a way for -your pet and I to get comfortable with each other. Also, any questions -you may have can be discussed too!

diff --git a/markdown_content/scripts/build.sh b/markdown_content/scripts/build.sh deleted file mode 100644 index 9156adf..0000000 --- a/markdown_content/scripts/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /run/current-system/sw/bin/bash - -# Static runtime variables -SRC_DIR=src -PUBLIC_DIR=public - -for content in $(find $SRC_DIR -type f) -do - output_file="$PUBLIC_DIR/$(echo "$content" | sed -e 's/src\///g' -e 's/md$/html/g')" - content_type=$(echo $content | awk -F/ '{ print $2 }') - - mkdir -p $(dirname $output_file) - - pandoc -o "$output_file" "$content" -done - diff --git a/markdown_content/src/forms/meet-and-greet.md b/markdown_content/src/forms/meet-and-greet.md deleted file mode 100644 index c4a6785..0000000 --- a/markdown_content/src/forms/meet-and-greet.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -Title: Meet and greet request ---- diff --git a/markdown_content/src/pages/about-me.md b/markdown_content/src/pages/about-me.md deleted file mode 100644 index dd71c02..0000000 --- a/markdown_content/src/pages/about-me.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -Title: About me ---- - -Welcome to All Paw Care! - -I've been providing professional animal caretaking services in the -Baltimore area for over 4 years. I provide services for paws of all -shapes and sizes and specialize in dog and cat care. - -Animals add so much to our lives so caring for them is just as -important. - diff --git a/markdown_content/src/pages/contact-me.md b/markdown_content/src/pages/contact-me.md deleted file mode 100644 index a500255..0000000 --- a/markdown_content/src/pages/contact-me.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -Title: Contact me ---- - -If you have any questions,the FAQ page may have -an answer. - -If your question isn't on the FAQ or you want to directly -contact me, email or text messages work best. - -My personal Instagram page is public and includes pictures -of my animal caretaking work along with all my interests. - diff --git a/markdown_content/src/pages/faq/faq.md b/markdown_content/src/pages/faq/faq.md deleted file mode 100644 index 2abcf13..0000000 --- a/markdown_content/src/pages/faq/faq.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -Title: FAQ ---- - -Here you'll find answers to some common questions. If what your -looking for can't be found, head over to the -[contact me]() page for information on communicating with me -directly. - diff --git a/markdown_content/src/pages/faq/questions/accepted-payments.md b/markdown_content/src/pages/faq/questions/accepted-payments.md deleted file mode 100644 index e4e56ce..0000000 --- a/markdown_content/src/pages/faq/questions/accepted-payments.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -Header: What types of payments do you accept? ---- - -A broad range of payment types are accepted to make the process -easy. - -- Cash -- Credit/Debit cards (Amex, Discover, Mastercard, Visa, etc.) -- ACH transfers (direct bank transfer from your checking account) -- Paypal -- Apple Pay -- Google Pay -- Zelle -- plus more... - diff --git a/markdown_content/src/pages/faq/questions/additional-animals.md b/markdown_content/src/pages/faq/questions/additional-animals.md deleted file mode 100644 index 99bdc17..0000000 --- a/markdown_content/src/pages/faq/questions/additional-animals.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -Header: Do you accept more than one animal? ---- - -Additional animals are charged per addition. For example, a walking -service for three dogs incures two addtional dog fees. - diff --git a/markdown_content/src/pages/faq/questions/invoice-payment-terms.md b/markdown_content/src/pages/faq/questions/invoice-payment-terms.md deleted file mode 100644 index 9848964..0000000 --- a/markdown_content/src/pages/faq/questions/invoice-payment-terms.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -Header: When is payment for a service due? ---- - -Payments are due 7 days after invoicing. Invoices are sent on the day -of service or during (e.g house sitting). - diff --git a/markdown_content/src/pages/services/cards/drop-ins.md b/markdown_content/src/pages/services/cards/drop-ins.md deleted file mode 100644 index 36cc3a4..0000000 --- a/markdown_content/src/pages/services/cards/drop-ins.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -Title: Drop-ins -Price: $18+/visit ---- - -Service includes 15 minutes of in-home play and/or care for your -dog/cat. Longer drop-ins are available! - diff --git a/markdown_content/src/pages/services/cards/house-sitting.md b/markdown_content/src/pages/services/cards/house-sitting.md deleted file mode 100644 index c12e10d..0000000 --- a/markdown_content/src/pages/services/cards/house-sitting.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -Title: House sitting -Price: $35+/night ---- - -Service includes nightly in-home care for your animal. Drop-ins or -walks are provided during the day. Cleaning of cat litter is included -too! - diff --git a/markdown_content/src/pages/services/cards/walking.md b/markdown_content/src/pages/services/cards/walking.md deleted file mode 100644 index 9722c95..0000000 --- a/markdown_content/src/pages/services/cards/walking.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -Title: Walking -Price: $20+/walk ---- - -Service includes 30 minute walk for your dog/cat and bags for poop -clean-up. - diff --git a/markdown_content/src/pages/services/services.md b/markdown_content/src/pages/services/services.md deleted file mode 100644 index 1fe8e04..0000000 --- a/markdown_content/src/pages/services/services.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -Title: Services ---- - -All services are for a single animal. Additional animals are charged -seperately. - -Set up a meeting before scheduling any service. I'll come to your -home or some place more convienient. The meeting will serve a way for -your pet and I to get comfortable with each other. Also, any -questions you may have can be discussed too! - diff --git a/scripts/process-images.sh b/scripts/process-images.sh index 42ad492..46775c7 100755 --- a/scripts/process-images.sh +++ b/scripts/process-images.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash -IMG_ORIGINALS="img_original" -IMG_PUBLIC="all_paw_care/static/img" +# This directory contains images for processing +IMG_ORIGINALS="$1" + +# The static image directory for the website module +IMG_PUBLIC="$2" + IMG_SIZES_NAME=("sm" "md" "lg" "xl" "xxl") IMG_SIZES=("346" "461" "595" "720" "840") diff --git a/all_paw_care.sql b/tests/all_paw_care.sql similarity index 100% rename from all_paw_care.sql rename to tests/all_paw_care.sql