From: W. Trevor King Date: Sat, 24 Jul 2010 11:18:57 +0000 (-0400) Subject: Rework gui/__init__.py imports X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71974c94810c869c3d2093ec917b26d12b4947bc;p=hooke.git Rework gui/__init__.py imports --- 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