Skip to content

Commit

Permalink
Move some code to .core
Browse files Browse the repository at this point in the history
Fix python3/wxphoenix compatibility
  • Loading branch information
qu1ck committed Feb 20, 2019
1 parent 9edb1af commit e594337
Show file tree
Hide file tree
Showing 8 changed files with 703 additions and 676 deletions.
23 changes: 12 additions & 11 deletions InteractiveHtmlBom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import wx
import wx.aui

from .generate_interactive_bom import InteractiveHtmlBomPlugin


def check_for_bom_button():
# From Miles McCoo's blog
Expand All @@ -22,6 +24,8 @@ def callback(_):

import os
path = os.path.dirname(__file__)
while not wx.GetApp():
time.sleep(1)
bm = wx.Bitmap(path + '/icon.png', wx.BITMAP_TYPE_PNG)
button_wx_item_id = 0
while True:
Expand All @@ -40,15 +44,12 @@ def callback(_):
top_tb.Realize()


if wx.GetApp():
from .generate_interactive_bom import GenerateInteractiveBomPlugin

plugin = GenerateInteractiveBomPlugin()
plugin.register()
plugin = InteractiveHtmlBomPlugin()
plugin.register()

# Add a button the hacky way if plugin button is not supported
# in pcbnew, unless this is linux.
if not plugin.pcbnew_icon_support and not sys.platform.startswith('linux'):
t = threading.Thread(target=check_for_bom_button)
t.daemon = True
t.start()
# Add a button the hacky way if plugin button is not supported
# in pcbnew, unless this is linux.
if not plugin.pcbnew_icon_support and not sys.platform.startswith('linux'):
t = threading.Thread(target=check_for_bom_button)
t.daemon = True
t.start()
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Config:
# Helper constants
config_file = os.path.join(os.path.dirname(__file__), 'config.ini')
config_file = os.path.join(os.path.dirname(__file__), '..', 'config.ini')
bom_view_choices = ['bom-only', 'left-right', 'top-bottom']
layer_view_choices = ['F', 'FB', 'B']
default_sort_order = [
Expand Down
File renamed without changes.
Loading

0 comments on commit e594337

Please sign in to comment.