@@ -28,23 +28,23 @@ def main(output_dir: Path | None = None) -> None:
2828 output_dir = Path () / "output"
2929 output_dir .mkdir (exist_ok = True , parents = True )
3030
31- with open (output_dir / "preset_responses_table.md" , "w" ) as out :
31+ with (output_dir / "preset_responses_table.md" ). open ( "w" ) as out :
3232 out .write (f"{ table_preset_responses ()} " )
3333
34- with open (output_dir / "apps_table.md" , "w" ) as out :
34+ with (output_dir / "apps_table.md" ). open ( "w" ) as out :
3535 out .write (f"{ table_apps ()} " )
3636
37- with open (output_dir / "spreadsheets_table.md" , "w" ) as out :
37+ with (output_dir / "spreadsheets_table.md" ). open ( "w" ) as out :
3838 out .write (f"{ table_spreadsheets ()} " )
3939
40- with open (output_dir / "data_dictionary_table.md" , "w" ) as out :
40+ with (output_dir / "data_dictionary_table.md" ). open ( "w" ) as out :
4141 out .write (f"{ table_data_dictionary ()} " )
4242
4343
4444def table_data_dictionary () -> str :
4545 """Create markdown table for list of apps."""
4646 data_dictionary_file = get_input_dir () / "data-dictionary.json"
47- with open (data_dictionary_file ) as f :
47+ with data_dictionary_file . open () as f :
4848 data_dictionary = list (json .load (f ).values ())
4949 data_dictionary = sorted (data_dictionary , key = itemgetter ("VariableName" ))
5050 for i , _ in enumerate (data_dictionary ):
@@ -74,9 +74,9 @@ def table_spreadsheets() -> str:
7474 for i , value in enumerate (sheets ):
7575 if "meeg" in value ["dir" ]:
7676 continue
77- sheets [i ][
78- "preview "
79- ] = f" { PREVIEW_BASE } { BASE_RAW_URL } / { value [ 'dir' ] } /activities/ { value [ 'basename' ] } / { value [ 'basename' ] } _schema.jsonld"
77+ sheets [i ]["preview" ] = (
78+ f" { PREVIEW_BASE } { BASE_RAW_URL } / { value [ 'dir' ] } /activities/ { value [ 'basename' ] } / { value [ 'basename' ] } _schema.jsonld "
79+ )
8080
8181 TemplateManager .initialize ()
8282 template = TemplateManager .env .get_template ("spreadsheet_table.j2" )
@@ -86,7 +86,7 @@ def table_spreadsheets() -> str:
8686def table_apps () -> str :
8787 """Create markdown table for spreadsheets that are not apps or preset responses."""
8888 spreadsheets_info = get_spreadsheets_info ()
89- apps = [value for key , value in spreadsheets_info .items () if spreadsheets_info [ key ] ["app_link" ]]
89+ apps = [value for key , value in spreadsheets_info .items () if value ["app_link" ]]
9090 apps = sorted (apps , key = itemgetter ("basename" ))
9191
9292 TemplateManager .initialize ()
0 commit comments