From d8c6d585fe4057c14122abe10ebe352717b392d0 Mon Sep 17 00:00:00 2001 From: Jonathan Martens Date: Thu, 6 May 2021 09:55:09 +0200 Subject: [PATCH] Use PySubSub instead of deprecated wx.lib.pubsub fixes #131 --- dicompyler/baseplugins/2dview.py | 2 +- dicompyler/baseplugins/anonymize.py | 2 +- dicompyler/baseplugins/dvh.py | 2 +- dicompyler/baseplugins/quickopen.py | 2 +- dicompyler/baseplugins/treeview.py | 2 +- dicompyler/dicomgui.py | 2 +- dicompyler/guiutil.py | 2 +- dicompyler/main.py | 2 +- dicompyler/plugin.py | 2 +- dicompyler/preferences.py | 4 ++-- requirements.txt | 3 +++ 11 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dicompyler/baseplugins/2dview.py b/dicompyler/baseplugins/2dview.py index 6e8746c..accec68 100644 --- a/dicompyler/baseplugins/2dview.py +++ b/dicompyler/baseplugins/2dview.py @@ -10,7 +10,7 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import pub +from pubsub import pub from matplotlib import _cntr as cntr from matplotlib import __version__ as mplversion import numpy as np diff --git a/dicompyler/baseplugins/anonymize.py b/dicompyler/baseplugins/anonymize.py index ad837c3..306e8b7 100755 --- a/dicompyler/baseplugins/anonymize.py +++ b/dicompyler/baseplugins/anonymize.py @@ -10,7 +10,7 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import pub +from pubsub import pub import os, threading from dicompyler import guiutil, util diff --git a/dicompyler/baseplugins/dvh.py b/dicompyler/baseplugins/dvh.py index 2a0863c..a869d26 100755 --- a/dicompyler/baseplugins/dvh.py +++ b/dicompyler/baseplugins/dvh.py @@ -12,7 +12,7 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import pub +from pubsub import pub from dicompyler import guiutil, util from dicompyler import guidvh import numpy as np diff --git a/dicompyler/baseplugins/quickopen.py b/dicompyler/baseplugins/quickopen.py index a84537f..7bd00c5 100644 --- a/dicompyler/baseplugins/quickopen.py +++ b/dicompyler/baseplugins/quickopen.py @@ -11,7 +11,7 @@ import logging logger = logging.getLogger('dicompyler.quickimport') import wx -from wx.lib.pubsub import pub +from pubsub import pub from dicompylercore import dicomparser from dicompyler import util diff --git a/dicompyler/baseplugins/treeview.py b/dicompyler/baseplugins/treeview.py index 8135cf3..df8983c 100755 --- a/dicompyler/baseplugins/treeview.py +++ b/dicompyler/baseplugins/treeview.py @@ -14,7 +14,7 @@ from six.moves import queue import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import pub +from pubsub import pub from wx.dataview import TreeListCtrl as tlc from dicompyler import guiutil, util try: diff --git a/dicompyler/dicomgui.py b/dicompyler/dicomgui.py index 642e266..462a0b1 100755 --- a/dicompyler/dicomgui.py +++ b/dicompyler/dicomgui.py @@ -15,7 +15,7 @@ import hashlib, os, threading import wx from wx.xrc import * -from wx.lib.pubsub import pub +from pubsub import pub import numpy as np from dicompylercore import dicomparser from dicompyler import guiutil, util diff --git a/dicompyler/guiutil.py b/dicompyler/guiutil.py index c5ec10d..076802e 100755 --- a/dicompyler/guiutil.py +++ b/dicompyler/guiutil.py @@ -10,7 +10,7 @@ from dicompyler import util import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import pub +from pubsub import pub def IsMSWindows(): """Are we running on Windows? diff --git a/dicompyler/main.py b/dicompyler/main.py index 5e188fb..b602505 100644 --- a/dicompyler/main.py +++ b/dicompyler/main.py @@ -20,7 +20,7 @@ import wx.adv import wx.lib.dialogs, webbrowser import pydicom -from wx.lib.pubsub import pub +from pubsub import pub from dicompylercore import dvhcalc from dicompyler import __version__ from dicompyler import guiutil, util diff --git a/dicompyler/plugin.py b/dicompyler/plugin.py index ff417b0..feab73b 100755 --- a/dicompyler/plugin.py +++ b/dicompyler/plugin.py @@ -12,7 +12,7 @@ import imp, os import wx from wx.xrc import * -from wx.lib.pubsub import pub +from pubsub import pub from dicompyler import guiutil, util def import_plugins(userpath=None): diff --git a/dicompyler/preferences.py b/dicompyler/preferences.py index 8d73980..c0b47a7 100755 --- a/dicompyler/preferences.py +++ b/dicompyler/preferences.py @@ -10,7 +10,7 @@ import os import wx from wx.xrc import * -from wx.lib.pubsub import pub +from pubsub import pub from dicompyler import guiutil, util try: @@ -377,7 +377,7 @@ def main(): import tempfile, os import wx - from wx.lib.pubsub import Publisher as pub + from pubsub import Publisher as pub app = wx.App(False) diff --git a/requirements.txt b/requirements.txt index 987eefd..8719332 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,6 @@ wxPython>=4.0.0b2 matplotlib>=1.3,<2.2 numpy>=1.13.1 https://github.com/darcymason/pydicom/archive/master.zip + +# Fix #131 +PyPubSub