Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit bf424b1

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent 753a860 commit bf424b1

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
# built documents.
6363
#
6464
# The short X.Y version.
65-
version = "{}".format(VERSION)
65+
version = f"{VERSION}"
6666
# The full version, including alpha/beta/rc tags.
67-
release = "{}".format(VERSION)
67+
release = f"{VERSION}"
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.

mysql_autoxtrabackup/api/controller/controller.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ async def home() -> RedirectResponse:
2828
)
2929
async def backup() -> JSONResponse:
3030
backup_ = Backup()
31-
result = backup_.all_backup()
32-
if result:
31+
if result := backup_.all_backup():
3332
return JSONResponse(
3433
content={"result": "Successfully finished the backup process"},
3534
status_code=status.HTTP_201_CREATED,
@@ -48,8 +47,7 @@ async def backup() -> JSONResponse:
4847
)
4948
async def prepare() -> JSONResponse:
5049
prepare_ = Prepare()
51-
result = prepare_.prepare_inc_full_backups()
52-
if result:
50+
if result := prepare_.prepare_inc_full_backups():
5351
return JSONResponse(
5452
content={"result": "Successfully prepared all the backups"},
5553
status_code=status.HTTP_200_OK,
@@ -68,10 +66,9 @@ async def prepare() -> JSONResponse:
6866
)
6967
async def backups() -> JSONResponse:
7068
backup_ = Backup()
71-
result = list_available_backups(
69+
if result := list_available_backups(
7270
str(backup_.builder_obj.backup_options.get("backup_dir"))
73-
)
74-
if result:
71+
):
7572
return JSONResponse(content={"backups": result}, status_code=status.HTTP_200_OK)
7673
return JSONResponse(content={"backups": {}}, status_code=status.HTTP_200_OK)
7774

0 commit comments

Comments
 (0)