Skip to content

Commit

Permalink
Lint again
Browse files Browse the repository at this point in the history
  • Loading branch information
picklelo committed Apr 24, 2024
1 parent bbcdd9d commit 4e4b030
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
14 changes: 8 additions & 6 deletions integration/test_call_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,14 @@ def test_call_script(
yield_callback_button.click()
update_counter_button.click()
assert call_script.poll_for_value(counter, exp_not_equal="0") == "4"
assert call_script.poll_for_value(
results, exp_not_equal="[]"
) == '["%s1",null,{"%s3":42,"a":[1,2,3],"s":"js","o":{"a":1,"b":2}},"async %s4"]' % (
script,
script,
script,
assert (
call_script.poll_for_value(results, exp_not_equal="[]")
== '["%s1",null,{"%s3":42,"a":[1,2,3],"s":"js","o":{"a":1,"b":2}},"async %s4"]'
% (
script,
script,
script,
)
)
reset_button.click()
assert call_script.poll_for_value(counter, exp_not_equal="4") == "0"
Expand Down
4 changes: 1 addition & 3 deletions reflex/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,9 +1590,7 @@ def _get_dynamic_imports(self) -> str:
library_import = f"const {self.alias if self.alias else self.tag} = dynamic(() => import('{import_name}')"
mod_import = (
# https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-named-exports
f".then((mod) => mod.{self.tag})"
if not self.is_default
else ""
f".then((mod) => mod.{self.tag})" if not self.is_default else ""
)
return "".join((library_import, mod_import, opts_fragment))

Expand Down
12 changes: 4 additions & 8 deletions reflex/components/markdown/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def create(cls, *children, **props) -> Component:
Returns:
The markdown component.
"""
assert len(children) == 1 and types._isinstance(
children[0], Union[str, Var]
assert (
len(children) == 1 and types._isinstance(children[0], Union[str, Var])
), "Markdown component must have exactly one child containing the markdown source."

# Custom styles are deprecated.
Expand Down Expand Up @@ -257,9 +257,7 @@ def format_component_map(self) -> dict[str, str]:
}

# Separate out inline code and code blocks.
components[
"code"
] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
components["code"] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
const match = (className || '').match(/language-(?<lang>.*)/);
const language = match ? match[1] : '';
if (language) {{
Expand All @@ -277,9 +275,7 @@ def format_component_map(self) -> dict[str, str]:
) : (
{self.format_component("codeblock", language=Var.create_safe("language", _var_is_local=False))}
);
}}}}""".replace(
"\n", " "
)
}}}}""".replace("\n", " ")

return components

Expand Down
7 changes: 6 additions & 1 deletion reflex/reflex.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,12 @@ def deploy(

hosting_cli.deploy(
app_name=app_name,
export_fn=lambda zip_dest_dir, api_url, deploy_url, frontend, backend, zipping: export_utils.export(
export_fn=lambda zip_dest_dir,
api_url,
deploy_url,
frontend,
backend,
zipping: export_utils.export(
zip_dest_dir=zip_dest_dir,
api_url=api_url,
deploy_url=deploy_url,
Expand Down

0 comments on commit 4e4b030

Please sign in to comment.