Skip to content

Commit

Permalink
Run ruff check --fix (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbampton authored Dec 9, 2024
1 parent ec2f87d commit 09bf1cc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
3 changes: 1 addition & 2 deletions config/admin/app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
from collections import defaultdict

import yaml
from flask import Flask, jsonify, redirect, render_template, request, session, url_for
from flask import Flask, redirect, render_template, request, session, url_for

app = Flask(__name__)
app.secret_key = "your_secret_key"
Expand Down
2 changes: 1 addition & 1 deletion config/module/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def command_layout_type(item: Dict[str, Any], prefix: str, value: str) -> str:
+ f'"{generate_name}", '
+ f'"{value}", '
+ f"{is_mother}"
+ f")\n"
+ ")\n"
)


Expand Down
35 changes: 17 additions & 18 deletions config/sync.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import os
import sys
from typing import Any, Dict, List
from typing import Any, Dict

import yaml
from module.utils import command_layout_style_type, command_layout_type
Expand Down Expand Up @@ -48,12 +48,12 @@ def prettify_block_type(item: Dict[str, Any], group: Dict[str, Any]) -> str:
idtextlower = idtext.lower()

return (
f"ADD_BLOCK_TYPE"
+ f"("
"ADD_BLOCK_TYPE"
+ "("
+ f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}"'
+ f")\n"
+ ")\n"
)


Expand Down Expand Up @@ -84,40 +84,40 @@ def prettify_layout_attribute_type(item: Dict[str, Any], group: Dict[str, Any])
if index == 0:
result += (
key_normal
+ f"("
+ "("
+ (
f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}", '
+ f'"{generate_name}", '
+ f'"{str(value)}"'
+ f")\n"
+ ")\n"
)
)
else:
result += (
key_repeat
+ f"("
+ "("
+ (
f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}", '
+ f'"{generate_name}", '
+ f'"{str(values)}"'
+ f")\n"
+ ")\n"
)
)
return result
else:
return (
key_normal
+ f"("
+ "("
+ f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}", '
+ f'"{generate_name}", '
+ f'"{str(values)}"'
+ f")\n"
+ ")\n"
)


Expand Down Expand Up @@ -146,11 +146,11 @@ def prettify_layout_attribute_style_global_value(
result += key_normal
else:
result += key_repeat
result += f"(" + f"{itemid}, " + f'"{str(values)}"' + f")\n"
result += "(" + f"{itemid}, " + f'"{str(values)}"' + ")\n"

return result
else:
return key_normal + f"(" + f"{itemid}, " + f'"{str(values)}"' + f")\n"
return key_normal + "(" + f"{itemid}, " + f'"{str(values)}"' + ")\n"


def prettify_layout_attribute_style_type(
Expand Down Expand Up @@ -271,27 +271,27 @@ def prettify_layout_attribute_style_state_type(
result += "ADD_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE_REPEAT"

result += (
f"("
"("
+ f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}", '
+ f'"{str(value)}", '
+ f'"{generate_name}"'
+ f")\n"
+ ")\n"
)
index += 1

return result
else:
return (
f"ADD_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE"
+ f"("
"ADD_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE"
+ "("
+ f"{itemid}, "
+ f'"{idtext}", '
+ f'"{idtextlower}", '
+ f'"{str(values)}", '
+ f'"{generate_name}"'
+ f")\n"
+ ")\n"
)


Expand Down Expand Up @@ -571,7 +571,6 @@ def get_a_attr(attributes, attr_id):
docs += "| نام ویژگی | توضیح | تولید |\n"
docs += "|-----------|------------|-------|\n"
for attr in allowed_attributes:

attr_item = get_a_attr(attributes, attr)
# print("attr_item: ", attr_item, attr)
# print(attributes)
Expand Down

0 comments on commit 09bf1cc

Please sign in to comment.