diff --git a/backend/README.md b/backend/README.md index a2017a4..3c9b1d5 100644 --- a/backend/README.md +++ b/backend/README.md @@ -2,6 +2,6 @@ MySQL is used. -CREATE DATABASE noxiosdb; -CREATE USER 'noxios'@'localhost'; -GRANT ALL PRIVILEGES ON noxiosdb.* To 'noxios'@'localhost' IDENTIFIED BY 'password'; +CREATE DATABASE bwmdb; +CREATE USER 'bwm'@'localhost'; +GRANT ALL PRIVILEGES ON bwmdb.* To 'bwm'@'localhost' IDENTIFIED BY 'password'; diff --git a/backend/__pycache__/database.cpython-314.pyc b/backend/__pycache__/database.cpython-314.pyc new file mode 100644 index 0000000..d4722e7 Binary files /dev/null and b/backend/__pycache__/database.cpython-314.pyc differ diff --git a/backend/__pycache__/main.cpython-314.pyc b/backend/__pycache__/main.cpython-314.pyc new file mode 100644 index 0000000..39e90b3 Binary files /dev/null and b/backend/__pycache__/main.cpython-314.pyc differ diff --git a/backend/controller/__pycache__/comments.cpython-312.pyc b/backend/controller/__pycache__/comments.cpython-312.pyc deleted file mode 100644 index b087b28..0000000 Binary files a/backend/controller/__pycache__/comments.cpython-312.pyc and /dev/null differ diff --git a/backend/controller/__pycache__/newsletter.cpython-312.pyc b/backend/controller/__pycache__/newsletter.cpython-312.pyc deleted file mode 100644 index 36197e6..0000000 Binary files a/backend/controller/__pycache__/newsletter.cpython-312.pyc and /dev/null differ diff --git a/backend/controller/__pycache__/user.cpython-312.pyc b/backend/controller/__pycache__/user.cpython-312.pyc deleted file mode 100644 index 937e33d..0000000 Binary files a/backend/controller/__pycache__/user.cpython-312.pyc and /dev/null differ diff --git a/backend/controller/comments.py b/backend/controller/comments.py deleted file mode 100644 index 839b7b9..0000000 --- a/backend/controller/comments.py +++ /dev/null @@ -1,7 +0,0 @@ -def setup_comment_routes(app): - - #get comments - @app.get("/comment/{id}") - async def get_comments_for_post(req, res): - return res.json(status_code=201) - #add comment \ No newline at end of file diff --git a/backend/controller/newsletter.py b/backend/controller/newsletter.py deleted file mode 100644 index 709df5e..0000000 --- a/backend/controller/newsletter.py +++ /dev/null @@ -1,12 +0,0 @@ - -def setup_newsletter_routes(app): - - # Create Mail Entry by Mail - @app.post("/newsletter") - async def create_mail_entry(request, response): - return response.json(status_code=201) - - # Delete Mail Entry by UUID - @app.put("/newsletter/{id}") - async def create_mail_entry(request, response): - return response.json(status_code=201) \ No newline at end of file diff --git a/backend/controller/user.py b/backend/controller/user.py deleted file mode 100644 index 2b030eb..0000000 --- a/backend/controller/user.py +++ /dev/null @@ -1,29 +0,0 @@ -from database import get_db -from nexios import Depend -from nexios.http import Request, Response -from sqlalchemy.ext.asyncio import AsyncSession -from models import User - -def setup_user_routes(app): - - @app.get("/users") - async def list_users( - request: Request, - response: Response, - db: AsyncSession = Depend(get_db) - ): - result = await db.execute("SELECT * FROM users") - users = result.fetchall() - return response.json(users) - - @app.post("/users") - async def create_user( - request: Request, - response: Response, - db: AsyncSession = Depend(get_db) - ): - data = await request.json - user = User(**data) - db.add(user) - await db.commit() - return response.json({"id": user.id}) \ No newline at end of file diff --git a/backend/database.py b/backend/database.py index 20b4a49..6ebbf58 100644 --- a/backend/database.py +++ b/backend/database.py @@ -1,29 +1,17 @@ -from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, AsyncSession -from sqlalchemy.orm import declarative_base -from config import DATABASE_URL +from models.subscription import Base +from sqlalchemy.orm import sessionmaker +from sqlalchemy import create_engine -engine = create_async_engine( - DATABASE_URL, - echo=True, - pool_size=5, - max_overflow=10, +DB_URL = "sqlite:///./test.db" + +engine = create_engine( + DB_URL, + connect_args={"check_same_thread": False} ) -AsyncSessionLocal = async_sessionmaker( - engine, - class_=AsyncSession, - expire_on_commit=False, +SessionLocal = sessionmaker( + autoflush=False, + bind=engine ) -Base = declarative_base() - -async def init_db(): - async with engine.begin() as conn: - await conn.run_sync(Base.metadata.create_all) - -async def get_db() -> AsyncSession: - async with AsyncSessionLocal() as session: - try: - yield session - finally: - await session.close() \ No newline at end of file +Base.metadata.create_all(bind=engine) \ No newline at end of file diff --git a/backend/main.py b/backend/main.py index 16c7c75..3f26c3f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1,21 +1,56 @@ -from database import init_db -from controller.user import setup_user_routes -from controller.comments import setup_comment_routes -from controller.newsletter import setup_newsletter_routes -from nexios import NexiosApp -import uvicorn +from fastapi import HTTPException +from typing import List +from models.subscription import Subscription +from fastapi import Depends +from database import SessionLocal +from fastapi import FastAPI +from schemas.subscription import SubscriptionCreate, Subscription +app = FastAPI() -app = NexiosApp() +def get_db(): + db = SessionLocal() + try: + yield db + finally: + db.close() -@app.on_startup -async def startup(): - await init_db() +@app.post("/newsletter/", response_model=Subscription) +def sub_newsletter(newsletter: SubscriptionCreate, db = Depends(get_db)): + db_newsletter = Subscription(**newsletter.dict()) + db.add(db_newsletter) + db.commit() + db.refresh(db_newsletter) + return db_newsletter -setup_newsletter_routes(app) -setup_comment_routes(app) -setup_user_routes(app) +@app.get("/subscriptions/", response_model=List[Subscription]) +def read_subscriptions(skip: int = 0, limit: int = 100, db = Depends(get_db)): + subscriptions = db.query(Subscription).offset(skip).limit(limit).all() + return subscriptions -# Run the application -if __name__ == "__main__": - uvicorn.run("main:app") \ No newline at end of file +@app.get("/subscriptions/{subscription_id}", response_model=Subscription) +def read_subscription(subscription_id: int, db = Depends(get_db)): + db_subscription = db.query(Subscription).filter(Subscription.id == subscription_id).first() + if db_subscription is None: + raise HTTPException(status_code=404, detail="subscription not found") + return db_subscription + +@app.put("/subscriptions/{subscription_id}", response_model=Subscription) +def update_subscription(subscription_id: int, subscription: SubscriptionCreate, db = Depends(get_db)): + db_subscription = db.query(Subscription).filter(Subscription.id == subscription_id).first() + if db_subscription is None: + raise HTTPException(status_code=404, detail="subscription not found") + for key, value in subscription.model_dump().items(): + setattr(db_subscription, key, value) + db.commit() + db.refresh(db_subscription) + return db_subscription + +@app.delete("/subscriptions/{subscription_id}") +def delete_subscription(subscription_id: int, db = Depends(get_db)): + db_subscription = db.query(Subscription).filter(Subscription.id == subscription_id).first() + if db_subscription is None: + raise HTTPException(status_code=404, detail="subscription not found") + db.delete(db_subscription) + db.commit() + return {"message": "subscription deleted successfully"} \ No newline at end of file diff --git a/backend/models.py b/backend/models.py deleted file mode 100644 index 6f57b7c..0000000 --- a/backend/models.py +++ /dev/null @@ -1,14 +0,0 @@ -from sqlalchemy import Column, Integer, String, Boolean, DateTime -from sqlalchemy.orm import declarative_base -from datetime import datetime - -Base = declarative_base() - -class User(Base): - __tablename__ = "users" - - id = Column(Integer, primary_key=True) - name = Column(String(100)) - email = Column(String(100), unique=True) - is_active = Column(Boolean, default=True) - created_at = Column(DateTime, default=datetime.now) \ No newline at end of file diff --git a/backend/models/__pycache__/newsletter.cpython-314.pyc b/backend/models/__pycache__/newsletter.cpython-314.pyc new file mode 100644 index 0000000..0db9303 Binary files /dev/null and b/backend/models/__pycache__/newsletter.cpython-314.pyc differ diff --git a/backend/models/__pycache__/subscription.cpython-314.pyc b/backend/models/__pycache__/subscription.cpython-314.pyc new file mode 100644 index 0000000..94e8a23 Binary files /dev/null and b/backend/models/__pycache__/subscription.cpython-314.pyc differ diff --git a/backend/models/subscription.py b/backend/models/subscription.py new file mode 100644 index 0000000..7621dc8 --- /dev/null +++ b/backend/models/subscription.py @@ -0,0 +1,12 @@ +from sqlalchemy import Integer +from sqlalchemy import String +from sqlalchemy import Column +from sqlalchemy.ext.declarative import declarative_base + +Base = declarative_base() + +class Subscription(Base): + __tablename__ = "newsletter" + + id = Column(Integer, primary_key=True, index=True) + email = Column(String, index=True, unique=True) \ No newline at end of file diff --git a/backend/pyrefly.toml b/backend/pyrefly.toml index 3bff0ea..91fc77f 100644 --- a/backend/pyrefly.toml +++ b/backend/pyrefly.toml @@ -1,6 +1 @@ -project-includes = [ - "venv/**/*.py*", - "venv/**/*.ipynb", -] - -python-platform = "linux" \ No newline at end of file +[tool.pyrefly] \ No newline at end of file diff --git a/backend/schemas/__pycache__/newsletter.cpython-314.pyc b/backend/schemas/__pycache__/newsletter.cpython-314.pyc new file mode 100644 index 0000000..6f2a9de Binary files /dev/null and b/backend/schemas/__pycache__/newsletter.cpython-314.pyc differ diff --git a/backend/schemas/__pycache__/subscription.cpython-314.pyc b/backend/schemas/__pycache__/subscription.cpython-314.pyc new file mode 100644 index 0000000..3aaad28 Binary files /dev/null and b/backend/schemas/__pycache__/subscription.cpython-314.pyc differ diff --git a/backend/schemas/subscription.py b/backend/schemas/subscription.py new file mode 100644 index 0000000..473983a --- /dev/null +++ b/backend/schemas/subscription.py @@ -0,0 +1,14 @@ +from pydantic import BaseModel + +class SubscriptionBase(BaseModel): + email: str + +class SubscriptionCreate(SubscriptionBase): + pass + +class Subscription(SubscriptionBase): + id: int + + class Config: + from_attributes = True + diff --git a/backend/test.db b/backend/test.db new file mode 100644 index 0000000..382f39f Binary files /dev/null and b/backend/test.db differ diff --git a/backend/user.py b/backend/user.py deleted file mode 100644 index 590b9f0..0000000 --- a/backend/user.py +++ /dev/null @@ -1,17 +0,0 @@ -from nexios.pagination import SyncDataHandler -from sqlalchemy import select -from models import User - -class UserDataHandler(SyncDataHandler): - def __init__(self, session): - self.session = session - - def get_total_items(self): - result = self.session.execute(select(User)) - return len(result.scalars().all()) - - def get_items(self, offset, limit): - result = self.session.execute( - select(User).offset(offset).limit(limit) - ) - return result.scalars().all() \ No newline at end of file diff --git a/backend/venv/bin/Activate.ps1 b/backend/venv/bin/Activate.ps1 deleted file mode 100644 index eeea358..0000000 --- a/backend/venv/bin/Activate.ps1 +++ /dev/null @@ -1,247 +0,0 @@ -<# -.Synopsis -Activate a Python virtual environment for the current PowerShell session. - -.Description -Pushes the python executable for a virtual environment to the front of the -$Env:PATH environment variable and sets the prompt to signify that you are -in a Python virtual environment. Makes use of the command line switches as -well as the `pyvenv.cfg` file values present in the virtual environment. - -.Parameter VenvDir -Path to the directory that contains the virtual environment to activate. The -default value for this is the parent of the directory that the Activate.ps1 -script is located within. - -.Parameter Prompt -The prompt prefix to display when this virtual environment is activated. By -default, this prompt is the name of the virtual environment folder (VenvDir) -surrounded by parentheses and followed by a single space (ie. '(.venv) '). - -.Example -Activate.ps1 -Activates the Python virtual environment that contains the Activate.ps1 script. - -.Example -Activate.ps1 -Verbose -Activates the Python virtual environment that contains the Activate.ps1 script, -and shows extra information about the activation as it executes. - -.Example -Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv -Activates the Python virtual environment located in the specified location. - -.Example -Activate.ps1 -Prompt "MyPython" -Activates the Python virtual environment that contains the Activate.ps1 script, -and prefixes the current prompt with the specified string (surrounded in -parentheses) while the virtual environment is active. - -.Notes -On Windows, it may be required to enable this Activate.ps1 script by setting the -execution policy for the user. You can do this by issuing the following PowerShell -command: - -PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - -For more information on Execution Policies: -https://go.microsoft.com/fwlink/?LinkID=135170 - -#> -Param( - [Parameter(Mandatory = $false)] - [String] - $VenvDir, - [Parameter(Mandatory = $false)] - [String] - $Prompt -) - -<# Function declarations --------------------------------------------------- #> - -<# -.Synopsis -Remove all shell session elements added by the Activate script, including the -addition of the virtual environment's Python executable from the beginning of -the PATH variable. - -.Parameter NonDestructive -If present, do not remove this function from the global namespace for the -session. - -#> -function global:deactivate ([switch]$NonDestructive) { - # Revert to original values - - # The prior prompt: - if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { - Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt - Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT - } - - # The prior PYTHONHOME: - if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { - Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME - Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME - } - - # The prior PATH: - if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { - Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH - Remove-Item -Path Env:_OLD_VIRTUAL_PATH - } - - # Just remove the VIRTUAL_ENV altogether: - if (Test-Path -Path Env:VIRTUAL_ENV) { - Remove-Item -Path env:VIRTUAL_ENV - } - - # Just remove VIRTUAL_ENV_PROMPT altogether. - if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { - Remove-Item -Path env:VIRTUAL_ENV_PROMPT - } - - # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: - if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { - Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force - } - - # Leave deactivate function in the global namespace if requested: - if (-not $NonDestructive) { - Remove-Item -Path function:deactivate - } -} - -<# -.Description -Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the -given folder, and returns them in a map. - -For each line in the pyvenv.cfg file, if that line can be parsed into exactly -two strings separated by `=` (with any amount of whitespace surrounding the =) -then it is considered a `key = value` line. The left hand string is the key, -the right hand is the value. - -If the value starts with a `'` or a `"` then the first and last character is -stripped from the value before being captured. - -.Parameter ConfigDir -Path to the directory that contains the `pyvenv.cfg` file. -#> -function Get-PyVenvConfig( - [String] - $ConfigDir -) { - Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" - - # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). - $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue - - # An empty map will be returned if no config file is found. - $pyvenvConfig = @{ } - - if ($pyvenvConfigPath) { - - Write-Verbose "File exists, parse `key = value` lines" - $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath - - $pyvenvConfigContent | ForEach-Object { - $keyval = $PSItem -split "\s*=\s*", 2 - if ($keyval[0] -and $keyval[1]) { - $val = $keyval[1] - - # Remove extraneous quotations around a string value. - if ("'""".Contains($val.Substring(0, 1))) { - $val = $val.Substring(1, $val.Length - 2) - } - - $pyvenvConfig[$keyval[0]] = $val - Write-Verbose "Adding Key: '$($keyval[0])'='$val'" - } - } - } - return $pyvenvConfig -} - - -<# Begin Activate script --------------------------------------------------- #> - -# Determine the containing directory of this script -$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition -$VenvExecDir = Get-Item -Path $VenvExecPath - -Write-Verbose "Activation script is located in path: '$VenvExecPath'" -Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" -Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" - -# Set values required in priority: CmdLine, ConfigFile, Default -# First, get the location of the virtual environment, it might not be -# VenvExecDir if specified on the command line. -if ($VenvDir) { - Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" -} -else { - Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." - $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") - Write-Verbose "VenvDir=$VenvDir" -} - -# Next, read the `pyvenv.cfg` file to determine any required value such -# as `prompt`. -$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir - -# Next, set the prompt from the command line, or the config file, or -# just use the name of the virtual environment folder. -if ($Prompt) { - Write-Verbose "Prompt specified as argument, using '$Prompt'" -} -else { - Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" - if ($pyvenvCfg -and $pyvenvCfg['prompt']) { - Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" - $Prompt = $pyvenvCfg['prompt']; - } - else { - Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" - Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" - $Prompt = Split-Path -Path $venvDir -Leaf - } -} - -Write-Verbose "Prompt = '$Prompt'" -Write-Verbose "VenvDir='$VenvDir'" - -# Deactivate any currently active virtual environment, but leave the -# deactivate function in place. -deactivate -nondestructive - -# Now set the environment variable VIRTUAL_ENV, used by many tools to determine -# that there is an activated venv. -$env:VIRTUAL_ENV = $VenvDir - -if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { - - Write-Verbose "Setting prompt to '$Prompt'" - - # Set the prompt to include the env name - # Make sure _OLD_VIRTUAL_PROMPT is global - function global:_OLD_VIRTUAL_PROMPT { "" } - Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT - New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt - - function global:prompt { - Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " - _OLD_VIRTUAL_PROMPT - } - $env:VIRTUAL_ENV_PROMPT = $Prompt -} - -# Clear PYTHONHOME -if (Test-Path -Path Env:PYTHONHOME) { - Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME - Remove-Item -Path Env:PYTHONHOME -} - -# Add the venv to the PATH -Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH -$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/backend/venv/bin/activate b/backend/venv/bin/activate deleted file mode 100644 index 2bb7136..0000000 --- a/backend/venv/bin/activate +++ /dev/null @@ -1,70 +0,0 @@ -# This file must be used with "source bin/activate" *from bash* -# You cannot run it directly - -deactivate () { - # reset old environment variables - if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then - PATH="${_OLD_VIRTUAL_PATH:-}" - export PATH - unset _OLD_VIRTUAL_PATH - fi - if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then - PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" - export PYTHONHOME - unset _OLD_VIRTUAL_PYTHONHOME - fi - - # Call hash to forget past commands. Without forgetting - # past commands the $PATH changes we made may not be respected - hash -r 2> /dev/null - - if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then - PS1="${_OLD_VIRTUAL_PS1:-}" - export PS1 - unset _OLD_VIRTUAL_PS1 - fi - - unset VIRTUAL_ENV - unset VIRTUAL_ENV_PROMPT - if [ ! "${1:-}" = "nondestructive" ] ; then - # Self destruct! - unset -f deactivate - fi -} - -# unset irrelevant variables -deactivate nondestructive - -# on Windows, a path can contain colons and backslashes and has to be converted: -if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then - # transform D:\path\to\venv to /d/path/to/venv on MSYS - # and to /cygdrive/d/path/to/venv on Cygwin - export VIRTUAL_ENV=$(cygpath /home/ebby/Desktop/Bluewaterblog/backend/venv) -else - # use the path as-is - export VIRTUAL_ENV=/home/ebby/Desktop/Bluewaterblog/backend/venv -fi - -_OLD_VIRTUAL_PATH="$PATH" -PATH="$VIRTUAL_ENV/"bin":$PATH" -export PATH - -# unset PYTHONHOME if set -# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) -# could use `if (set -u; : $PYTHONHOME) ;` in bash -if [ -n "${PYTHONHOME:-}" ] ; then - _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" - unset PYTHONHOME -fi - -if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then - _OLD_VIRTUAL_PS1="${PS1:-}" - PS1='(venv) '"${PS1:-}" - export PS1 - VIRTUAL_ENV_PROMPT='(venv) ' - export VIRTUAL_ENV_PROMPT -fi - -# Call hash to forget past commands. Without forgetting -# past commands the $PATH changes we made may not be respected -hash -r 2> /dev/null diff --git a/backend/venv/bin/activate.csh b/backend/venv/bin/activate.csh deleted file mode 100644 index c4db864..0000000 --- a/backend/venv/bin/activate.csh +++ /dev/null @@ -1,27 +0,0 @@ -# This file must be used with "source bin/activate.csh" *from csh*. -# You cannot run it directly. - -# Created by Davide Di Blasi . -# Ported to Python 3.3 venv by Andrew Svetlov - -alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' - -# Unset irrelevant variables. -deactivate nondestructive - -setenv VIRTUAL_ENV /home/ebby/Desktop/Bluewaterblog/backend/venv - -set _OLD_VIRTUAL_PATH="$PATH" -setenv PATH "$VIRTUAL_ENV/"bin":$PATH" - - -set _OLD_VIRTUAL_PROMPT="$prompt" - -if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then - set prompt = '(venv) '"$prompt" - setenv VIRTUAL_ENV_PROMPT '(venv) ' -endif - -alias pydoc python -m pydoc - -rehash diff --git a/backend/venv/bin/activate.fish b/backend/venv/bin/activate.fish deleted file mode 100644 index 698cbd0..0000000 --- a/backend/venv/bin/activate.fish +++ /dev/null @@ -1,69 +0,0 @@ -# This file must be used with "source /bin/activate.fish" *from fish* -# (https://fishshell.com/). You cannot run it directly. - -function deactivate -d "Exit virtual environment and return to normal shell environment" - # reset old environment variables - if test -n "$_OLD_VIRTUAL_PATH" - set -gx PATH $_OLD_VIRTUAL_PATH - set -e _OLD_VIRTUAL_PATH - end - if test -n "$_OLD_VIRTUAL_PYTHONHOME" - set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME - set -e _OLD_VIRTUAL_PYTHONHOME - end - - if test -n "$_OLD_FISH_PROMPT_OVERRIDE" - set -e _OLD_FISH_PROMPT_OVERRIDE - # prevents error when using nested fish instances (Issue #93858) - if functions -q _old_fish_prompt - functions -e fish_prompt - functions -c _old_fish_prompt fish_prompt - functions -e _old_fish_prompt - end - end - - set -e VIRTUAL_ENV - set -e VIRTUAL_ENV_PROMPT - if test "$argv[1]" != "nondestructive" - # Self-destruct! - functions -e deactivate - end -end - -# Unset irrelevant variables. -deactivate nondestructive - -set -gx VIRTUAL_ENV /home/ebby/Desktop/Bluewaterblog/backend/venv - -set -gx _OLD_VIRTUAL_PATH $PATH -set -gx PATH "$VIRTUAL_ENV/"bin $PATH - -# Unset PYTHONHOME if set. -if set -q PYTHONHOME - set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME - set -e PYTHONHOME -end - -if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" - # fish uses a function instead of an env var to generate the prompt. - - # Save the current fish_prompt function as the function _old_fish_prompt. - functions -c fish_prompt _old_fish_prompt - - # With the original prompt function renamed, we can override with our own. - function fish_prompt - # Save the return status of the last command. - set -l old_status $status - - # Output the venv prompt; color taken from the blue of the Python logo. - printf "%s%s%s" (set_color 4B8BBE) '(venv) ' (set_color normal) - - # Restore the return status of the previous command. - echo "exit $old_status" | . - # Output the original/"old" prompt. - _old_fish_prompt - end - - set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" - set -gx VIRTUAL_ENV_PROMPT '(venv) ' -end diff --git a/backend/venv/bin/idna b/backend/venv/bin/idna deleted file mode 100755 index 0986f05..0000000 --- a/backend/venv/bin/idna +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from idna.cli import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/bin/nexios b/backend/venv/bin/nexios deleted file mode 100755 index 61833ce..0000000 --- a/backend/venv/bin/nexios +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from nexios.cli import cli -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(cli()) diff --git a/backend/venv/bin/pip b/backend/venv/bin/pip deleted file mode 100755 index c46120d..0000000 --- a/backend/venv/bin/pip +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/bin/pip3 b/backend/venv/bin/pip3 deleted file mode 100755 index c46120d..0000000 --- a/backend/venv/bin/pip3 +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/bin/pip3.12 b/backend/venv/bin/pip3.12 deleted file mode 100755 index c46120d..0000000 --- a/backend/venv/bin/pip3.12 +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from pip._internal.cli.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/bin/pyrefly b/backend/venv/bin/pyrefly deleted file mode 100755 index ad62c98..0000000 Binary files a/backend/venv/bin/pyrefly and /dev/null differ diff --git a/backend/venv/bin/python b/backend/venv/bin/python deleted file mode 120000 index acd4152..0000000 --- a/backend/venv/bin/python +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/python \ No newline at end of file diff --git a/backend/venv/bin/python3 b/backend/venv/bin/python3 deleted file mode 120000 index d8654aa..0000000 --- a/backend/venv/bin/python3 +++ /dev/null @@ -1 +0,0 @@ -python \ No newline at end of file diff --git a/backend/venv/bin/python3.12 b/backend/venv/bin/python3.12 deleted file mode 120000 index d8654aa..0000000 --- a/backend/venv/bin/python3.12 +++ /dev/null @@ -1 +0,0 @@ -python \ No newline at end of file diff --git a/backend/venv/bin/tortoise b/backend/venv/bin/tortoise deleted file mode 100755 index 466af28..0000000 --- a/backend/venv/bin/tortoise +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from tortoise.cli import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/bin/uvicorn b/backend/venv/bin/uvicorn deleted file mode 100755 index 0682709..0000000 --- a/backend/venv/bin/uvicorn +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ebby/Desktop/Bluewaterblog/backend/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from uvicorn.main import main -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/backend/venv/include/site/python3.12/greenlet/greenlet.h b/backend/venv/include/site/python3.12/greenlet/greenlet.h deleted file mode 100644 index d02a16e..0000000 --- a/backend/venv/include/site/python3.12/greenlet/greenlet.h +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */ - -/* Greenlet object interface */ - -#ifndef Py_GREENLETOBJECT_H -#define Py_GREENLETOBJECT_H - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* This is deprecated and undocumented. It does not change. */ -#define GREENLET_VERSION "1.0.0" - -#ifndef GREENLET_MODULE -#define implementation_ptr_t void* -#endif - -typedef struct _greenlet { - PyObject_HEAD - PyObject* weakreflist; - PyObject* dict; - implementation_ptr_t pimpl; -} PyGreenlet; - -#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type)) - - -/* C API functions */ - -/* Total number of symbols that are exported */ -#define PyGreenlet_API_pointers 12 - -#define PyGreenlet_Type_NUM 0 -#define PyExc_GreenletError_NUM 1 -#define PyExc_GreenletExit_NUM 2 - -#define PyGreenlet_New_NUM 3 -#define PyGreenlet_GetCurrent_NUM 4 -#define PyGreenlet_Throw_NUM 5 -#define PyGreenlet_Switch_NUM 6 -#define PyGreenlet_SetParent_NUM 7 - -#define PyGreenlet_MAIN_NUM 8 -#define PyGreenlet_STARTED_NUM 9 -#define PyGreenlet_ACTIVE_NUM 10 -#define PyGreenlet_GET_PARENT_NUM 11 - -#ifndef GREENLET_MODULE -/* This section is used by modules that uses the greenlet C API */ -static void** _PyGreenlet_API = NULL; - -# define PyGreenlet_Type \ - (*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM]) - -# define PyExc_GreenletError \ - ((PyObject*)_PyGreenlet_API[PyExc_GreenletError_NUM]) - -# define PyExc_GreenletExit \ - ((PyObject*)_PyGreenlet_API[PyExc_GreenletExit_NUM]) - -/* - * PyGreenlet_New(PyObject *args) - * - * greenlet.greenlet(run, parent=None) - */ -# define PyGreenlet_New \ - (*(PyGreenlet * (*)(PyObject * run, PyGreenlet * parent)) \ - _PyGreenlet_API[PyGreenlet_New_NUM]) - -/* - * PyGreenlet_GetCurrent(void) - * - * greenlet.getcurrent() - */ -# define PyGreenlet_GetCurrent \ - (*(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM]) - -/* - * PyGreenlet_Throw( - * PyGreenlet *greenlet, - * PyObject *typ, - * PyObject *val, - * PyObject *tb) - * - * g.throw(...) - */ -# define PyGreenlet_Throw \ - (*(PyObject * (*)(PyGreenlet * self, \ - PyObject * typ, \ - PyObject * val, \ - PyObject * tb)) \ - _PyGreenlet_API[PyGreenlet_Throw_NUM]) - -/* - * PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args) - * - * g.switch(*args, **kwargs) - */ -# define PyGreenlet_Switch \ - (*(PyObject * \ - (*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \ - _PyGreenlet_API[PyGreenlet_Switch_NUM]) - -/* - * PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent) - * - * g.parent = new_parent - */ -# define PyGreenlet_SetParent \ - (*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \ - _PyGreenlet_API[PyGreenlet_SetParent_NUM]) - -/* - * PyGreenlet_GetParent(PyObject* greenlet) - * - * return greenlet.parent; - * - * This could return NULL even if there is no exception active. - * If it does not return NULL, you are responsible for decrementing the - * reference count. - */ -# define PyGreenlet_GetParent \ - (*(PyGreenlet* (*)(PyGreenlet*)) \ - _PyGreenlet_API[PyGreenlet_GET_PARENT_NUM]) - -/* - * deprecated, undocumented alias. - */ -# define PyGreenlet_GET_PARENT PyGreenlet_GetParent - -# define PyGreenlet_MAIN \ - (*(int (*)(PyGreenlet*)) \ - _PyGreenlet_API[PyGreenlet_MAIN_NUM]) - -# define PyGreenlet_STARTED \ - (*(int (*)(PyGreenlet*)) \ - _PyGreenlet_API[PyGreenlet_STARTED_NUM]) - -# define PyGreenlet_ACTIVE \ - (*(int (*)(PyGreenlet*)) \ - _PyGreenlet_API[PyGreenlet_ACTIVE_NUM]) - - - - -/* Macro that imports greenlet and initializes C API */ -/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we - keep the older definition to be sure older code that might have a copy of - the header still works. */ -# define PyGreenlet_Import() \ - { \ - _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \ - } - -#endif /* GREENLET_MODULE */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_GREENLETOBJECT_H */ diff --git a/backend/venv/lib64 b/backend/venv/lib64 deleted file mode 120000 index 7951405..0000000 --- a/backend/venv/lib64 +++ /dev/null @@ -1 +0,0 @@ -lib \ No newline at end of file diff --git a/backend/venv/pyvenv.cfg b/backend/venv/pyvenv.cfg deleted file mode 100644 index e076519..0000000 --- a/backend/venv/pyvenv.cfg +++ /dev/null @@ -1,5 +0,0 @@ -home = /usr/bin -include-system-site-packages = false -version = 3.12.3 -executable = /usr/bin/python3.12 -command = /usr/bin/python -m venv /home/ebby/Desktop/Bluewaterblog/backend/venv