import wx
import operator
import imp
-from wx.lib.wordwrap import wordwrap
+from lib.wordwrap import wordwrap
from gui.boldstatictext import BoldStaticText
import viewers
import gui.fields
+# this two are only to satisfy some plugins requirements
+import gui.plugin
+import shutil
+
+#import viewers.raw
+#import viewers.simple
+#import viewers.rfx
+#import viewers.flexpaper
+#import viewers.technoargia
+
class Viewers:
def __init__(self):
+ #self.viewers = [
+ # 'raw',
+ # 'simple',
+ # 'rfx',
+ # 'flexpaper',
+ # 'technoargia',
+ #]
self.viewers = []
+ #self.modules = [
+ # viewers.raw,
+ # viewers.simple,
+ # viewers.rfx,
+ # viewers.flexpaper,
+ # viewers.technoargia,
+ #]
self.modules = []
+
self.list_viewers()
self.import_viewers()
def import_viewers(self):
for file in self.viewers:
- _temp = imp.load_source("viewers.%s" % file, os.path.join(os.getcwdu(), "viewers/%s.py" % file))
- self.modules.append(_temp)
+ try:
+ _temp = imp.load_source("viewers.%s" % file, os.path.join(os.getcwdu(), "viewers/%s.py" % file))
+ self.modules.append(_temp)
+ except Exception, e:
+ print "Could not load %s (%s)" % (file, e)
class ViewerBook(wx.Listbook):
def __init__(self, parent):
wx.Listbook.__init__(self, parent, wx.ID_ANY, style=
- wx.BK_DEFAULT
+ wx.LB_DEFAULT
)
self.__mod = []
win = self.makePanel(mod)
self.AddPage(win, mod, imageId=idx)
+ if hasattr(mod, "default"):
+ self.SetSelection(idx)
- # A hack to avoid having the scrollbar be on bottom
- # the first time the control is created
- self.ListView.Select(self.ListView.GetItemCount()-1)
- self.ListView.Select(0)
def makePanel(self, mod):
p = wx.Panel(self)