Skip to content

Commit

Permalink
Normalize string quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonyte committed Jul 7, 2023
1 parent 9b3936a commit 39e35d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
from models import Command, Result

app = FastAPI()
app.mount('/static', StaticFiles(directory='static'), name='static')
app.mount("/static", StaticFiles(directory="static"), name="static")


@app.get('/', response_class=HTMLResponse)
@app.get("/", response_class=HTMLResponse)
async def root():
with open('static/index.html') as file:
with open("static/index.html") as file:
return HTMLResponse(file.read())


@app.post('/api/command', response_model=Result)
@app.post("/api/command", response_model=Result)
async def command(cmd: Command):
original_cwd = os.getcwd()
try:
Expand All @@ -34,7 +34,7 @@ async def command(cmd: Command):
returncode = result.returncode
args = result.args
except Exception as exc: # pylint: disable=broad-except
stdout = ''
stdout = ""
stderr = str(exc)
returncode = 1
args = cmd.args
Expand Down
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Command(BaseModel):
args: list[str]
cwd: str = '.'
cwd: str = "."


class Result(BaseModel):
Expand Down

0 comments on commit 39e35d0

Please sign in to comment.