1616out_path = Path (prefix ) / "Menu"
1717pkg_name = environ ["PKG_NAME" ]
1818pkg_version = environ ["PKG_VERSION" ]
19+ folder_and_category_name = environ ["MENU_FOLDER_NAME" ] # defined in `meta.yaml`
1920
2021if not out_path .is_dir ():
2122 out_path .mkdir (parents = True )
@@ -30,6 +31,7 @@ def txt_replace(txt):
3031 ("#PREFIX#" , prefix ),
3132 ("#PKG_NAME#" , pkg_name ),
3233 ("#PKG_VERSION#" , pkg_version ),
34+ ("#FOLDER_AND_CATEGORY_NAME#" , folder_and_category_name ),
3335 ):
3436 txt = txt .replace (start , end )
3537 return txt
@@ -39,14 +41,15 @@ def txt_replace(txt):
3941(out_path / f"{ pkg_name } .json" ).write_text (txt_replace (menu_txt ))
4042
4143
42- for fstem in ("console" , "info" , "web" , "forum" , ' jupyter' ):
44+ for fstem in ("console" , "info" , "web" , "forum" , " jupyter" ):
4345 for ext in ("icns" , "ico" , "png" ):
4446 copy2 (in_path / f"{ fstem } .{ ext } " , out_path / f"{ pkg_name } _{ fstem } .{ ext } " )
4547
4648for ext in ("sh" , "applescript" , "bat" ):
47- for fpath in in_path .glob (f' *.{ ext } ' ):
49+ for fpath in in_path .glob (f" *.{ ext } " ):
4850 (out_path / f"{ pkg_name } _{ fpath .name } " ).write_text (
49- txt_replace (fpath .read_text ()))
51+ txt_replace (fpath .read_text ())
52+ )
5053
5154for fname in ("spi_sys_info.py" , "spi_mac_folder_icon.png" ):
5255 copy2 (in_path / fname , out_path / fname )
0 commit comments