From e67e01af885ad1edf1ca8b1772e3e051b0cca103 Mon Sep 17 00:00:00 2001 From: cicer Date: Tue, 10 Oct 2023 18:36:54 -0500 Subject: [PATCH 1/6] change --- main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main.py b/main.py index dd4e781..47610ea 100644 --- a/main.py +++ b/main.py @@ -41,3 +41,4 @@ def message(): return HTMLResponse('

Hello world

') +#holita \ No newline at end of file From 39fa8670cb8316d36efbb7cd80dc0e4a820028a1 Mon Sep 17 00:00:00 2001 From: cicer Date: Tue, 10 Oct 2023 18:59:42 -0500 Subject: [PATCH 2/6] req --- requiremets.txt | Bin 468 -> 233 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requiremets.txt b/requiremets.txt index 303d9208761a7c7a38a3e459599264fd9481d2ac..d27e84738b8b3ca90321baddba7af6c75f0200e8 100644 GIT binary patch literal 233 zcmW-b%Z|e!3`O^Rj0J?I>B5U{t1en~q*;y-A*t2GM1gtm_cgQg;~pP-``32DY4zQ@`);S bBc8wFUx}P4aYmG+(BD54($4=+oTPsPJ0e3A literal 468 zcmX|-PfNp45X9#!_*F_@8cRKR@G2e@1&>nFe?j|FnpE`5tH0gN3y)1;XLfdG|9;oX z`cbP+cf5sWT2hs+b)`n1AdNm8ThUL{V#GSoPG_xkq-=T)T2o7B?CACy_?}QH_)0f0 zLVwTnmX}f5!Zc0=YC3b*IIuBIv&q#1X|-W4_L}S3`6se$=w{T+xhb0G Date: Tue, 10 Oct 2023 19:09:34 -0500 Subject: [PATCH 3/6] pass --- passenger_wsgi.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 passenger_wsgi.py diff --git a/passenger_wsgi.py b/passenger_wsgi.py new file mode 100644 index 0000000..69d4145 --- /dev/null +++ b/passenger_wsgi.py @@ -0,0 +1,4 @@ +from a2wsgi import ASGIMiddleware +from main import app + +application = ASGIMiddleware(app) \ No newline at end of file From cb8c645baca5062c7ffb5207e02b82c8d1d3ceab Mon Sep 17 00:00:00 2001 From: cicer Date: Tue, 10 Oct 2023 19:41:05 -0500 Subject: [PATCH 4/6] jet --- main.py | 62 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/main.py b/main.py index 47610ea..97d6bb8 100644 --- a/main.py +++ b/main.py @@ -1,41 +1,41 @@ from fastapi import FastAPI from fastapi.responses import HTMLResponse -from config.database import engine, Base -from middlewares.error_handler import ErrorHandler -from routers.movie import movie_router -from routers.user import user_router +# from config.database import engine, Base +# from middlewares.error_handler import ErrorHandler +# from routers.movie import movie_router +# from routers.user import user_router app = FastAPI() app.title = "Mi aplicación con FastAPI" app.version = "0.0.1" -app.add_middleware(ErrorHandler) - -app.include_router(movie_router) -app.include_router(user_router) - - -Base.metadata.create_all(bind=engine) - - -movies = [ - { - "id": 1, - "title": "Avatar", - "overview": "En un exuberante planeta llamado Pandora viven los Na'vi, seres que ...", - "year": "2009", - "rating": 7.8, - "category": "Acción" - }, - { - "id": 2, - "title": "Avatar", - "overview": "En un exuberante planeta llamado Pandora viven los Na'vi, seres que ...", - "year": "2009", - "rating": 7.8, - "category": "Acción" - } -] +# app.add_middleware(ErrorHandler) + +# app.include_router(movie_router) +# app.include_router(user_router) + + +# Base.metadata.create_all(bind=engine) + + +# movies = [ +# { +# "id": 1, +# "title": "Avatar", +# "overview": "En un exuberante planeta llamado Pandora viven los Na'vi, seres que ...", +# "year": "2009", +# "rating": 7.8, +# "category": "Acción" +# }, +# { +# "id": 2, +# "title": "Avatar", +# "overview": "En un exuberante planeta llamado Pandora viven los Na'vi, seres que ...", +# "year": "2009", +# "rating": 7.8, +# "category": "Acción" +# } +# ] @app.get('/', tags=['home']) def message(): From 84400a49214662aeca8b2a1a27f086570a73aa43 Mon Sep 17 00:00:00 2001 From: cicer Date: Wed, 11 Oct 2023 18:42:36 -0500 Subject: [PATCH 5/6] deco --- initapp.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 initapp.py diff --git a/initapp.py b/initapp.py new file mode 100644 index 0000000..21b5c49 --- /dev/null +++ b/initapp.py @@ -0,0 +1,39 @@ +import subprocess +from typing import List, Tuple, Union + +def execute_command(command: str) -> Tuple[bool, Union[str, str]]: + try: + # Execute the command and capture standard output and errors + process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + stdout, stderr = process.communicate() + + # Check if there were errors during execution + if process.returncode == 0: + # Success: the command ran without errors + return True, stdout + else: + # Error: the command returned a non-zero exit code + return False, stderr + except Exception as e: + # Error during command execution + return False, str(e) + +def execute_commands(commands: List[str]) -> List[Tuple[bool, Union[str, str]]]: + results = [] + for i, command in enumerate(commands, start=1): + success, result = execute_command(command) + results.append((success, result)) + status = 'executed successfully' if success else 'error during command execution' + print(f"Command '{command}': {status}") + print(result) + + return results + +# Example of usage +commands = [ + "ls -la", + "echo 'Hello, World!'", + "date", + "git add ." + ] +results = execute_commands(commands) From d6a9f68fbf3b5dca9840ebac7ff8604f3a5707c3 Mon Sep 17 00:00:00 2001 From: cicer Date: Wed, 11 Oct 2023 18:43:32 -0500 Subject: [PATCH 6/6] deco --- initapp.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/initapp.py b/initapp.py index 21b5c49..f4f0ce7 100644 --- a/initapp.py +++ b/initapp.py @@ -31,9 +31,7 @@ def execute_commands(commands: List[str]) -> List[Tuple[bool, Union[str, str]]]: # Example of usage commands = [ - "ls -la", - "echo 'Hello, World!'", - "date", - "git add ." + "git add .", + "git commit -m deco" ] results = execute_commands(commands)