Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Sep 29, 2024
1 parent 4aed9b3 commit 829e957
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion robyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import multiprocess as mp
from nestd import get_all_nested
from robyn.robyn import FunctionInfo, Headers, HttpMethod, Request, Response, WebSocketConnector, get_version

from robyn import status_codes
from robyn.argument_parser import Config
Expand All @@ -20,6 +19,7 @@
from robyn.processpool import run_processes
from robyn.reloader import compile_rust_files
from robyn.responses import html, serve_file, serve_html
from robyn.robyn import FunctionInfo, Headers, HttpMethod, Request, Response, WebSocketConnector, get_version
from robyn.router import MiddlewareRouter, MiddlewareType, Router, WebSocketRouter
from robyn.types import Directory
from robyn.ws import WebSocket
Expand Down
16 changes: 9 additions & 7 deletions robyn/cli.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import os
import shutil
import subprocess
import sys
from typing import Optional
import webbrowser
from InquirerPy.resolver import prompt
from pathlib import Path
from typing import Optional

from InquirerPy.base.control import Choice
from .argument_parser import Config
from .reloader import create_rust_file, setup_reloader
from InquirerPy.resolver import prompt

from robyn.env_populator import load_vars
from robyn.robyn import get_version
from pathlib import Path
import shutil
import subprocess

from .argument_parser import Config
from .reloader import create_rust_file, setup_reloader

SCAFFOLD_DIR = Path(__file__).parent / "scaffold"
CURRENT_WORKING_DIR = Path.cwd()
Expand Down
2 changes: 1 addition & 1 deletion robyn/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from enum import Enum
import logging
from enum import Enum
from typing import Optional


Expand Down
2 changes: 1 addition & 1 deletion robyn/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import asdict, dataclass, field
from importlib import resources
from inspect import Signature
from typing import Callable, Dict, List, Optional, TypedDict, Any
from typing import Any, Callable, Dict, List, Optional, TypedDict

from robyn import Response
from robyn.responses import FileResponse, html
Expand Down
9 changes: 5 additions & 4 deletions robyn/processpool.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import asyncio
import webbrowser
from multiprocess import Process
import signal
import sys
import webbrowser
from typing import Dict, List
from robyn.logger import logger

from multiprocess import Process

from robyn.events import Events
from robyn.logger import logger
from robyn.robyn import FunctionInfo, Headers, Server, SocketHeld
from robyn.router import GlobalMiddleware, RouteMiddleware, Route
from robyn.router import GlobalMiddleware, Route, RouteMiddleware
from robyn.types import Directory
from robyn.ws import WebSocket

Expand Down
2 changes: 1 addition & 1 deletion robyn/reloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import glob
import os
import signal
import subprocess
import sys
Expand Down
6 changes: 3 additions & 3 deletions robyn/responses.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Optional
import os
import mimetypes
import os
from typing import Optional

from robyn.robyn import Response, Headers
from robyn.robyn import Headers, Response


class FileResponse:
Expand Down
21 changes: 6 additions & 15 deletions robyn/router.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
import inspect
import logging
from abc import ABC, abstractmethod
from asyncio import iscoroutinefunction
from functools import wraps
from inspect import signature
from types import CoroutineType
from typing import Callable, Dict, List, NamedTuple, Union, Optional
from robyn.authentication import AuthenticationHandler, AuthenticationNotConfiguredError
from robyn.dependency_injection import DependencyMap
from robyn.responses import FileResponse
from typing import Callable, Dict, List, NamedTuple, Optional, Union

from robyn.robyn import (
FunctionInfo,
Headers,
HttpMethod,
MiddlewareType,
Request,
Response,
)
from robyn import status_codes
from robyn.authentication import AuthenticationHandler, AuthenticationNotConfiguredError
from robyn.dependency_injection import DependencyMap
from robyn.jsonify import jsonify

from robyn.responses import FileResponse
from robyn.robyn import FunctionInfo, Headers, HttpMethod, MiddlewareType, Request, Response
from robyn.ws import WebSocket

import logging

_logger = logging.getLogger(__name__)


Expand Down
1 change: 1 addition & 0 deletions robyn/scaffold/mongo/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pymongo import MongoClient

from robyn import Robyn

app = Robyn(__file__)
Expand Down
1 change: 1 addition & 0 deletions robyn/scaffold/postgres/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import psycopg2

from robyn import Robyn

DB_NAME = "postgresDB"
Expand Down
3 changes: 2 additions & 1 deletion robyn/scaffold/prisma/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from robyn import Robyn
from prisma import Prisma
from prisma.models import User

from robyn import Robyn

app = Robyn(__file__)
prisma = Prisma(auto_register=True)

Expand Down
3 changes: 2 additions & 1 deletion robyn/scaffold/sqlite/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from robyn import Robyn
import sqlite3

from robyn import Robyn

app = Robyn(__file__)


Expand Down
5 changes: 2 additions & 3 deletions robyn/scaffold/sqlmodel/app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from robyn import Robyn

from sqlmodel import SQLModel, Session, create_engine, select
from models import Hero
from sqlmodel import Session, SQLModel, create_engine, select

from robyn import Robyn

app = Robyn(__file__)

Expand Down
4 changes: 2 additions & 2 deletions robyn/templating.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from abc import ABC, abstractmethod

from jinja2 import Environment, FileSystemLoader

from robyn import status_codes

from .robyn import Headers, Response

from jinja2 import Environment, FileSystemLoader


class TemplateInterface(ABC):
def __init__(self): ...
Expand Down
2 changes: 1 addition & 1 deletion robyn/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import asyncio
import inspect
from typing import TYPE_CHECKING, Callable

from robyn.argument_parser import Config
from robyn.dependency_injection import DependencyMap

from robyn.robyn import FunctionInfo

if TYPE_CHECKING:
Expand Down

0 comments on commit 829e957

Please sign in to comment.