From 71974c94810c869c3d2093ec917b26d12b4947bc Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 24 Jul 2010 07:18:57 -0400 Subject: [PATCH] Rework gui/__init__.py imports --- hooke/ui/gui/__init__.py | 61 +++++-------------- hooke/ui/gui/libhooke.py | 2 +- hooke/ui/gui/panel/__init__.py | 12 ++++ hooke/ui/gui/{panels => panel}/commands.py | 0 hooke/ui/gui/{panels => panel}/note.py | 0 .../ui/gui/{panels => panel}/perspectives.py | 0 hooke/ui/gui/{panels => panel}/playlist.py | 0 hooke/ui/gui/{panels => panel}/plot.py | 0 .../gui/{panels => panel}/propertyeditor.py | 0 hooke/ui/gui/{panels => panel}/results.py | 0 hooke/ui/gui/panels/__init__.py | 1 - 11 files changed, 29 insertions(+), 47 deletions(-) create mode 100644 hooke/ui/gui/panel/__init__.py rename hooke/ui/gui/{panels => panel}/commands.py (100%) rename hooke/ui/gui/{panels => panel}/note.py (100%) rename hooke/ui/gui/{panels => panel}/perspectives.py (100%) rename hooke/ui/gui/{panels => panel}/playlist.py (100%) rename hooke/ui/gui/{panels => panel}/plot.py (100%) rename hooke/ui/gui/{panels => panel}/propertyeditor.py (100%) rename hooke/ui/gui/{panels => panel}/results.py (100%) delete mode 100644 hooke/ui/gui/panels/__init__.py diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index 153b06d..db64594 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -3,11 +3,11 @@ """Defines :class:`GUI` providing a wxWindows interface to Hooke. """ -import lib.libhooke as lh +WX_GOOD=['2.6','2.8'] + import wxversion -wxversion.select(lh.WX_GOOD) +wxversion.select(WX_GOOD) -from configobj import ConfigObj import copy import os.path import platform @@ -15,53 +15,24 @@ import shutil import time import wx.html -import wx.lib.agw.aui as aui +import wx.aui as aui import wx.lib.evtmgr as evtmgr -import wx.propgrid as wxpg + +# wxPropertyGrid included in wxPython >= 2.9.1, until then, see +# http://wxpropgrid.sourceforge.net/cgi-bin/index?page=download +# until then, we'll avoid it because of the *nix build problems. +#import wx.propgrid as wxpg from matplotlib.ticker import FuncFormatter -from configobj import __version__ as configobj_version -from matplotlib import __version__ as mpl_version -from numpy import __version__ as numpy_version -from scipy import __version__ as scipy_version -from sys import version as python_version -from wx import __version__ as wx_version -from wx.propgrid import PROPGRID_MAJOR -from wx.propgrid import PROPGRID_MINOR -from wx.propgrid import PROPGRID_RELEASE - -try: - from agw import cubecolourdialog as CCD -except ImportError: # if it's not there locally, try the wxPython lib. - import wx.lib.agw.cubecolourdialog as CCD - -#set the Hooke directory -lh.hookeDir = os.path.abspath(os.path.dirname(__file__)) -from config.config import config -import drivers -import lib.clickedpoint -import lib.curve -import lib.delta -import lib.playlist -import lib.plotmanipulator +from ..command import CommandExit, Exit, Command, Argument, StoreValue +from ..interaction import Request, BooleanRequest, ReloadUserInterfaceConfig +from ..ui import UserInterface, CommandMessage + import lib.prettyformat -import panels.commands -import panels.note -import panels.perspectives -import panels.playlist -import panels.plot -import panels.propertyeditor -import panels.results -import plugins - -global __version__ -global __codename__ -global __releasedate__ -__version__ = lh.HOOKE_VERSION[0] -__codename__ = lh.HOOKE_VERSION[1] -__releasedate__ = lh.HOOKE_VERSION[2] -__release_name__ = lh.HOOKE_VERSION[1] +import .panel as panel + + ID_About = wx.NewId() ID_Next = wx.NewId() diff --git a/hooke/ui/gui/libhooke.py b/hooke/ui/gui/libhooke.py index 3e48f92..17dbf6a 100644 --- a/hooke/ui/gui/libhooke.py +++ b/hooke/ui/gui/libhooke.py @@ -18,7 +18,7 @@ import numpy import scipy HOOKE_VERSION=['0.9.0_devel', 'Kenzo', '2010-01-31'] -WX_GOOD=['2.6','2.8'] + hookeDir='' #constants for 'special' curves diff --git a/hooke/ui/gui/panel/__init__.py b/hooke/ui/gui/panel/__init__.py new file mode 100644 index 0000000..26664e8 --- /dev/null +++ b/hooke/ui/gui/panel/__init__.py @@ -0,0 +1,12 @@ +# Copyright + +import .commands as commands +import .note as note +import .perspectives as perspectives +import .playlist as playlist +import .plot as plot +import .propertyeditor as propertyeditor +import .results as results + +__all__ = [commands, note, perspectives, playlist, plot, propertyeditor, + results] diff --git a/hooke/ui/gui/panels/commands.py b/hooke/ui/gui/panel/commands.py similarity index 100% rename from hooke/ui/gui/panels/commands.py rename to hooke/ui/gui/panel/commands.py diff --git a/hooke/ui/gui/panels/note.py b/hooke/ui/gui/panel/note.py similarity index 100% rename from hooke/ui/gui/panels/note.py rename to hooke/ui/gui/panel/note.py diff --git a/hooke/ui/gui/panels/perspectives.py b/hooke/ui/gui/panel/perspectives.py similarity index 100% rename from hooke/ui/gui/panels/perspectives.py rename to hooke/ui/gui/panel/perspectives.py diff --git a/hooke/ui/gui/panels/playlist.py b/hooke/ui/gui/panel/playlist.py similarity index 100% rename from hooke/ui/gui/panels/playlist.py rename to hooke/ui/gui/panel/playlist.py diff --git a/hooke/ui/gui/panels/plot.py b/hooke/ui/gui/panel/plot.py similarity index 100% rename from hooke/ui/gui/panels/plot.py rename to hooke/ui/gui/panel/plot.py diff --git a/hooke/ui/gui/panels/propertyeditor.py b/hooke/ui/gui/panel/propertyeditor.py similarity index 100% rename from hooke/ui/gui/panels/propertyeditor.py rename to hooke/ui/gui/panel/propertyeditor.py diff --git a/hooke/ui/gui/panels/results.py b/hooke/ui/gui/panel/results.py similarity index 100% rename from hooke/ui/gui/panels/results.py rename to hooke/ui/gui/panel/results.py diff --git a/hooke/ui/gui/panels/__init__.py b/hooke/ui/gui/panels/__init__.py deleted file mode 100644 index 803f29c..0000000 --- a/hooke/ui/gui/panels/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env python -- 2.26.2