Skip to content

Commit

Permalink
Changes to make it work on Python 3 with wxPython 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianInostroza committed Dec 18, 2018
1 parent e1affce commit 0e2fe70
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import wx
import wx.aui

from generate_interactive_bom import GenerateInteractiveBomPlugin
from .generate_interactive_bom import GenerateInteractiveBomPlugin


def check_for_bom_button():
Expand Down
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from wx import FileConfig

import dialog.settings_dialog
from .dialog import settings_dialog


class Config:
Expand Down
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/dialog/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from settings_dialog import SettingsDialog
from .settings_dialog import SettingsDialog
9 changes: 7 additions & 2 deletions InteractiveHtmlBom/dialog/settings_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import wx

import dialog_base
from . import dialog_base


def pop_error(msg):
Expand All @@ -24,7 +24,12 @@ def __init__(self, extra_data_func, config_save_func):
# hack for new wxFormBuilder generating code incompatible with old wxPython
# noinspection PyMethodOverriding
def SetSizeHints(self, sz1, sz2):
self.SetSizeHintsSz(sz1, sz2)
try:
# wxPython 3
self.SetSizeHintsSz(sz1, sz2)
except TypeError:
# wxPython 4
super(SettingsDialog, self).SetSizeHints(sz1, sz2)

def set_extra_data_path(self, extra_data_file):
self.panel.extra.netlistFilePicker.Path = extra_data_file
Expand Down
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/fontparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from newstroke_font import NEWSTROKE_FONT
from .newstroke_font import NEWSTROKE_FONT


class FontParser:
Expand Down
10 changes: 5 additions & 5 deletions InteractiveHtmlBom/generate_interactive_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import pcbnew
import wx

import dialog
import units
from config import Config
from fontparser import FontParser
from schematic_data import parse_schematic_data, find_latest_schematic_data
from . import dialog
from . import units
from .config import Config
from .fontparser import FontParser
from .schematic_data import parse_schematic_data, find_latest_schematic_data


def setup_logger():
Expand Down
4 changes: 2 additions & 2 deletions InteractiveHtmlBom/schematic_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from xmlparser import XmlParser
from netlistparser import NetlistParser
from .xmlparser import XmlParser
from .netlistparser import NetlistParser

PARSERS = {
'.xml': XmlParser,
Expand Down
4 changes: 2 additions & 2 deletions InteractiveHtmlBom/schematic_data/netlistparser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from parser_base import ParserBase
from sexpressions import parse_sexpression
from .parser_base import ParserBase
from .sexpressions import parse_sexpression


class NetlistParser(ParserBase):
Expand Down
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/schematic_data/xmlparser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from xml.dom import minidom

from parser_base import ParserBase
from .parser_base import ParserBase


class XmlParser(ParserBase):
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import InteractiveHtmlBom
from . import InteractiveHtmlBom

0 comments on commit 0e2fe70

Please sign in to comment.