Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
namnguyen20999 committed Dec 23, 2024
1 parent 5d46618 commit 3bc41b8
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions taipy/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,7 @@ def _convert_unsupported_data(value: t.Any) -> t.Optional[t.Any]:
The transformed data or None if no transformation is possible.
"""
try:
return Gui.__unsupported_data_converter(value) if _is_function(
Gui.__unsupported_data_converter) else None # type: ignore
return Gui.__unsupported_data_converter(value) if _is_function(Gui.__unsupported_data_converter) else None # type: ignore
except Exception as e:
_warn(f"Error transforming data: {str(e)}")
return None
Expand Down Expand Up @@ -1235,9 +1234,7 @@ def __request_data_update(self, var_name: str, payload: t.Any) -> None:
if ret_payload:
break
except Exception as e: # pragma: no cover
_warn(
f"Exception raised in '{lib_name}.get_data({lib_name}, payload, {user_var_name}, value)'",
# noqa: E501
_warn(f"Exception raised in '{lib_name}.get_data({lib_name}, payload, {user_var_name}, value)'",# noqa: E501
e,
)
if not isinstance(ret_payload, dict):
Expand Down Expand Up @@ -2060,8 +2057,7 @@ def add_page(
raise Exception("name is required for add_page() function.")
if not Gui.__RE_PAGE_NAME.match(name): # pragma: no cover
raise SyntaxError(
f'Page name "{name}" is invalid. It must only contain letters, digits, dash (-), underscore (_), and forward slash (/) characters.'
# noqa: E501
f'Page name "{name}" is invalid. It must only contain letters, digits, dash (-), underscore (_), and forward slash (/) characters.'# noqa: E501
)
if name.startswith("/"): # pragma: no cover
raise SyntaxError(f'Page name "{name}" cannot start with forward slash (/) character.')
Expand Down Expand Up @@ -2259,8 +2255,7 @@ def _bind_var(self, var_name: str) -> str:
self._bind(encoded_var_name, bind_locals[var_name])
else:
_warn(
f"Variable '{var_name}' is not available in either the '{self._get_locals_context()}' or '__main__' modules."
# noqa: E501
f"Variable '{var_name}' is not available in either the '{self._get_locals_context()}' or '__main__' modules."# noqa: E501
)
return encoded_var_name

Expand Down Expand Up @@ -2629,8 +2624,7 @@ def _get_webapp_path(self):
_warn(f"Using webapp_path: '{_conf_webapp_path}'.")
else: # pragma: no cover
_warn(
f"webapp_path: '{_conf_webapp_path}' is not a valid directory. Falling back to '{_webapp_path}'."
# noqa: E501
f"webapp_path: '{_conf_webapp_path}' is not a valid directory. Falling back to '{_webapp_path}'."# noqa: E501
)
return _webapp_path

Expand Down Expand Up @@ -2702,8 +2696,7 @@ def __init_ngrok(self):
if not util.find_spec("pyngrok"):
raise RuntimeError("Cannot use ngrok as pyngrok package is not installed.")
ngrok.set_auth_token(token) # type: ignore[reportPossiblyUnboundVariable]
self._ngrok = (
ngrok.connect(app_config.get("port"), "http"), token) # type: ignore[reportPossiblyUnboundVariable]
self._ngrok = (ngrok.connect(app_config.get("port"), "http"), token) # type: ignore[reportPossiblyUnboundVariable]
_TaipyLogger._get_logger().info(f" * NGROK Public Url: {self._ngrok[0].public_url}")

def __bind_default_function(self):
Expand Down Expand Up @@ -2946,8 +2939,7 @@ def run(
glob_ctx[lib_context[0]] = lib_context[1]
elif lib_context:
_warn(
f"Method {name}.on_init() should return a Tuple[str, Any] where the first element must be a valid Python identifier."
# noqa: E501
f"Method {name}.on_init() should return a Tuple[str, Any] where the first element must be a valid Python identifier."# noqa: E501
)
except Exception as e: # pragma: no cover
if not self._call_on_exception(f"{name}.on_init", e):
Expand Down

0 comments on commit 3bc41b8

Please sign in to comment.