File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ def make_release_dir(version):
1010
1111src_path = (Path (__file__ ).parent .parent / "src" ).absolute ()
1212version_path = src_path / "_version.py"
13-
14- metadata_template = Path (__file__ ).parent / "metadata_template.json"
15- build_path = Path ("build" ).absolute ()
16-
1713icons_path = src_path .parent / "icons"
1814resources_path = icons_path
15+ metadata_template = Path (__file__ ).parent / "metadata_template.json"
16+
17+ build_path = Path ("build" ).absolute ()
1918
2019# Delete build and recreate
2120try :
@@ -30,6 +29,9 @@ def make_release_dir(version):
3029shutil .copy (
3130 icons_path / "icon-64x64.png" , build_path / "plugin" / "resources" / "icon.png"
3231)
32+ shutil .copy (
33+ icons_path / "icon-24x24.png" , build_path / "plugin" / "plugins" / "icon-24x24.png"
34+ )
3335
3436# Clean out any __pycache__ or .pyc files (https://stackoverflow.com/a/41386937)
3537[p .unlink () for p in build_path .rglob ("*.py[co]" )]
Original file line number Diff line number Diff line change 1- import os
21import sys
32import threading
43import time
4+ from pathlib import Path
55
66import wx
77import wx .aui
@@ -27,9 +27,7 @@ def callback(_):
2727
2828 while not wx .GetApp ():
2929 time .sleep (1 )
30- bm = wx .Bitmap (
31- os .path .join (os .path .dirname (__file__ ), "icon.png" ), wx .BITMAP_TYPE_PNG
32- )
30+ bm = wx .Bitmap (str (Meta .icon_file_path ), wx .BITMAP_TYPE_PNG )
3331 button_wx_item_id = 0
3432
3533 from pcbnew import ID_H_TOOLBAR
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ class Meta:
6161 version : str = __version__
6262 category : str = "Read PCB"
6363 icon_dir : Path = Path (__file__ ).parent
64- icon_base_file_name : str = "icon.png"
64+ icon_file_path : Path = icon_dir / "icon-24x24.png"
65+ # assert icon_file_path.exists()
6566
6667
6768def setattr_keywords (obj , name , value ):
@@ -295,10 +296,7 @@ def __init__(self):
295296 self .pcbnew_icon_support = hasattr (self , "show_toolbar_button" )
296297 self .show_toolbar_button = True
297298 self .description = Meta .body
298-
299- icon_file_path = Meta .icon_dir / Meta .icon_base_file_name
300- # assert icon_file_path.exists()
301- self .icon_file_name = str (icon_file_path )
299+ self .icon_file_name = str (Meta .icon_file_path )
302300
303301 def defaults (self ):
304302 pass
You can’t perform that action at this time.
0 commit comments