File tree 5 files changed +24
-15
lines changed
5 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,15 @@ __pycache__
6
6
latest_bundle_data.json
7
7
latest_bundle_tag.json
8
8
generated_images
9
+
10
+ # Virtual environment-specific files
11
+ .env
12
+ .venv
13
+
14
+ # MacOS-specific files
15
+ * .DS_Store
16
+
17
+ # IDE-specific files
18
+ .idea
19
+ .vscode
20
+ * ~
Original file line number Diff line number Diff line change 8
8
hooks :
9
9
- id : black
10
10
- repo : https://github.com/fsfe/reuse-tool
11
- rev : v0.12.1
11
+ rev : v1.1.2
12
12
hooks :
13
13
- id : reuse
14
14
- repo : https://github.com/pre-commit/pre-commit-hooks
18
18
- id : end-of-file-fixer
19
19
- id : trailing-whitespace
20
20
- repo : https://github.com/pycqa/pylint
21
- rev : pylint- 2.7.1
21
+ rev : v3. 2.7
22
22
hooks :
23
23
- id : pylint
24
24
name : pylint (library code)
Original file line number Diff line number Diff line change @@ -30,4 +30,4 @@ The help command will list all possible commands and arguments.
30
30
31
31
``` shell
32
32
python3 create_requirement_images.py --help
33
- ```
33
+ ```
Original file line number Diff line number Diff line change 38
38
TEXT_COLOR = "#B0B0B0"
39
39
HIDDEN_TEXT_COLOR = "#808080"
40
40
41
- f = open ("latest_bundle_data.json" , "r" )
42
- bundle_data = json .load (f )
43
- f .close ()
41
+ with open ("latest_bundle_data.json" , "r" , encoding = "utf-8" ) as f :
42
+ bundle_data = json .load (f )
44
43
45
44
46
45
def asset_path (asset_name ):
@@ -416,17 +415,15 @@ def make_sd_dir(position):
416
415
)
417
416
make_libraries (final_list_to_render , _libraries_position )
418
417
419
- if project_files_count == 0 :
420
- project_files_count = 1
421
-
422
418
_sd_dir_position = (
423
419
76 ,
424
420
PADDING
425
- + (LINE_SPACING * (7 + project_files_count + len (final_list_to_render ))),
421
+ + (LINE_SPACING * (7 + project_files_count + len (final_list_to_render )))
422
+ + (1 if context ["added_settings_toml" ] else 0 ) * LINE_SPACING ,
426
423
)
427
424
make_sd_dir (_sd_dir_position )
428
425
429
- img .save ("generated_images/{}.png" . format ( image_name ) )
426
+ img .save (f "generated_images/{ image_name } .png" )
430
427
431
428
432
429
def generate_learn_requirement_image ( # pylint: disable=invalid-name
Original file line number Diff line number Diff line change @@ -116,14 +116,14 @@ def ensure_latest_bundle():
116
116
117
117
ensure_latest_bundle ()
118
118
119
- with open ("latest_bundle_data.json" , "r" ) as f :
119
+ with open ("latest_bundle_data.json" , "r" , encoding = "utf-8" ) as f :
120
120
bundle_data = json .load (f )
121
121
122
122
123
123
def get_files_for_project (project_name ):
124
124
"""Get the set of files for a learn project"""
125
125
found_files = set ()
126
- project_dir = "{ }/{}/". format ( LEARN_GUIDE_REPO , project_name )
126
+ project_dir = f" { LEARN_GUIDE_REPO } /{ project_name } /"
127
127
128
128
full_tree = os .walk (project_dir )
129
129
root_level = next (full_tree )
@@ -153,11 +153,11 @@ def get_libs_for_project(project_name):
153
153
"""Get the set of libraries for a learn project"""
154
154
found_libs = set ()
155
155
found_imports = []
156
- project_dir = "{}{ }/". format ( LEARN_GUIDE_REPO , project_name )
156
+ project_dir = f" { LEARN_GUIDE_REPO } { project_name } /"
157
157
for file in os .listdir (project_dir ):
158
158
if file .endswith (".py" ):
159
159
160
- found_imports = findimports .find_imports ("{}{}" . format ( project_dir , file ) )
160
+ found_imports = findimports .find_imports (f" { project_dir } { file } " )
161
161
162
162
for cur_import in found_imports :
163
163
cur_lib = cur_import .name .split ("." )[0 ]
You can’t perform that action at this time.
0 commit comments