Skip to content

Commit 1bf80c9

Browse files
committed
Refactor formatting in setup.py and _convert.py
Improves code readability by reformatting lists and dictionary values in setup.py and breaking up a long path assignment in _convert.py. No functional changes were made.
1 parent 2038552 commit 1bf80c9

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

setup.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@
2525
packages=find_packages(),
2626
package_data={
2727
"sphinx_togglebutton": [
28-
"_static/togglebutton.css",
29-
"_static/togglebutton.js",
28+
"_static/togglebutton.css",
29+
"_static/togglebutton.js",
3030
"_static/togglebutton-chevron.svg",
3131
"translations/README.md",
3232
"translations/_convert.py",
3333
"translations/jsons/*.json",
34-
"translations/locales/**/*"
34+
"translations/locales/**/*",
3535
]
3636
},
3737
install_requires=["setuptools", "wheel", "sphinx", "docutils"],
38-
extras_require={"sphinx": ["matplotlib", "numpy", "myst_nb", "sphinx_book_theme", "sphinx_design", "sphinx_examples"]},
38+
extras_require={
39+
"sphinx": [
40+
"matplotlib",
41+
"numpy",
42+
"myst_nb",
43+
"sphinx_book_theme",
44+
"sphinx_design",
45+
"sphinx_examples",
46+
]
47+
},
3948
classifiers=["License :: OSI Approved :: MIT License"],
4049
)

sphinx_togglebutton/translations/_convert.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
MESSAGE_CATALOG_NAME = "togglebutton"
77

8+
89
def convert_json(folder=None):
910
folder = folder or Path(__file__).parent
1011

@@ -19,7 +20,13 @@ def convert_json(folder=None):
1920
english = data[0]["text"]
2021
for item in data[1:]:
2122
language = item["symbol"]
22-
out_path = folder / "locales" / language / "LC_MESSAGES" / f"{MESSAGE_CATALOG_NAME}.po"
23+
out_path = (
24+
folder
25+
/ "locales"
26+
/ language
27+
/ "LC_MESSAGES"
28+
/ f"{MESSAGE_CATALOG_NAME}.po"
29+
)
2330
if not out_path.parent.exists():
2431
out_path.parent.mkdir(parents=True)
2532
if not out_path.exists():

0 commit comments

Comments
 (0)