Skip to content

Commit d4ed9d1

Browse files
committed
run black prettier && fix
1 parent 4b03fee commit d4ed9d1

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

srv/python/mviewerstudio_backend/app_factory.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
logger = logging.getLogger(__name__)
88

9+
910
def setup_logging(app: Flask) -> None:
1011
logging.basicConfig(
1112
level=app.config["LOG_LEVEL"],
12-
format='[%(asctime)s] %(levelname)s (%(module)s): %(message)s', datefmt='%Y-%m-%d %H:%M:%S'
13+
format="[%(asctime)s] %(levelname)s (%(module)s): %(message)s",
14+
datefmt="%Y-%m-%d %H:%M:%S",
1315
)
14-
16+
1517

1618
def load_config(app: Flask) -> None:
1719
app.config.from_object("mviewerstudio_backend.settings.Config")
@@ -40,7 +42,6 @@ def init_publish_directory(app: Flask) -> None:
4042
logger.info(f"CREATE PUBLISH PATH {publish_path}")
4143
app.publish_path = publish_path
4244
logger.info(f"PUBLISH PATH READY TO USE : {publish_path}")
43-
4445

4546

4647
def create_app() -> Flask:

srv/python/mviewerstudio_backend/utils/git_utils.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ def unlock_repo(repo):
1212
"""
1313
Force remove git lock file
1414
"""
15-
lock_file = path.join(repo.working_dir, '.git', 'index.lock')
15+
lock_file = path.join(repo.working_dir, ".git", "index.lock")
1616
remove(lock_file)
1717

18+
1819
def init_repo(workspace):
1920
"""
2021
Create app git repo.
@@ -50,6 +51,7 @@ def init_or_get_repo(workspace):
5051
repo = git.Repo(workspace)
5152
return repo
5253

54+
5355
def checkout(repo, target, hard=False):
5456
"""
5557
checkout repo to targeted branch, tag, commit ref.
@@ -62,8 +64,8 @@ def checkout(repo, target, hard=False):
6264
logger.debug(repo.working_dir)
6365

6466
repo_dir = repo.working_dir
65-
lock_file = path.join(repo.working_dir, '.git', 'index.lock')
66-
67+
lock_file = path.join(repo.working_dir, ".git", "index.lock")
68+
6769
if path.exists(lock_file):
6870
logger.error(f"GIT : REPO LOCKED {repo_dir}")
6971
sleep(5)
@@ -186,7 +188,6 @@ def get_versions(self):
186188
"""
187189
logger.debug("GIT : READ VERSIONS (COMMITS AND TAGS)")
188190
return {"tags": self.get_tags(), "commits": self.get_commits()}
189-
190191

191192
def get_tags(self):
192193
"""

srv/python/mviewerstudio_backend/utils/login_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77

88
logger = logging.getLogger(__name__)
99

10+
1011
def _get_current_user() -> Optional["User"]:
1112
if has_app_context():
1213
logger.debug("GET USER : READ HEADER")
1314
logger.debug(dict(request.headers))
1415
roles = request.headers.get("sec-roles", "").split(";")
1516
# sec-org by default. Use sec-orgname to have organism long name
16-
orgname = request.headers.get("sec-org")info
17+
orgname = request.headers.get("sec-org")
1718
if not orgname:
1819
orgname = current_app.config["DEFAULT_ORG"]
1920
normalize_orgname = replace_special_chars(orgname)

srv/python/mviewerstudio_backend/utils/register_utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def create_register_from_file_system(self):
6363
self._configs_files_to_register()
6464
logger.info("REGISTER : CREATE PROCESS SUCCESS")
6565
except:
66-
logger.error("REGISTER : CREATE PROCESS FAIL - Please control each app files")
66+
logger.error(
67+
"REGISTER : CREATE PROCESS FAIL - Please control each app files"
68+
)
6769

6870
def _delete_register(self):
6971
"""
@@ -111,8 +113,6 @@ def _configs_files_to_register(self):
111113
logger.error(e)
112114
logger.debug(f"REGISTER : APP PROCESS END")
113115

114-
115-
116116
def update_register(self, json_dict=None):
117117
"""
118118
Replace register json file by a given json content.

0 commit comments

Comments
 (0)