wxversion.select(WX_GOOD)\r
\r
import copy\r
+import logging\r
import os\r
import os.path\r
import platform\r
"""\r
def __init__(self, gui, commands, inqueue, outqueue, *args, **kwargs):\r
super(HookeFrame, self).__init__(*args, **kwargs)\r
+ self.log = logging.getLogger('hooke')\r
self.gui = gui\r
self.commands = commands\r
self.inqueue = inqueue\r
dialog.Destroy()\r
\r
def _on_close(self, *args):\r
+ self.log.info('closing GUI framework')\r
# apply changes\r
self.gui.config['main height'] = str(self.GetSize().GetHeight())\r
self.gui.config['main left'] = str(self.GetPosition()[0])\r
for name,value in self._c['property editor'].get_values().items():\r
if name in arg_names:\r
args[name] = value\r
- print 'executing', command.name, args\r
+ self.log.debug('executing %s with %s' % (command.name, args))\r
self.inqueue.put(CommandMessage(command, args))\r
results = []\r
while True:\r
\r
def _on_panel_visibility(self, _class, method, panel_name, visible):\r
pane = self._c['manager'].GetPane(panel_name)\r
- print visible\r
pane.Show(visible)\r
#if we don't do the following, the Folders pane does not resize properly on hide/show\r
if pane.caption == 'Folders' and pane.IsShown() and pane.IsDocked():\r
\r
def _delete_perspectives(self, perspective_dir, names,\r
extension=None):\r
- print 'pop', names\r
+ self.log.debug('remove perspectives %s from %s'\r
+ % (names, perspective_dir))\r
for name in names:\r
path = os.path.join(perspective_dir, name)\r
if extension != None:\r
\r
def _restore_perspective(self, name, force=False):\r
if name != self.gui.config['active perspective'] or force == True:\r
- print 'restoring perspective:', name\r
+ self.log.debug('restore perspective %s' % name)\r
self.gui.config['active perspective'] = name # TODO: push to engine's Hooke\r
self._c['manager'].LoadPerspective(self._perspectives[name])\r
self._c['manager'].Update()\r
\r
def _setup_splash_screen(self):\r
if self.gui.config['show splash screen'] == 'True': # HACK: config should decode\r
- print 'splash', self.gui.config['show splash screen']\r
path = self.gui.config['splash screen image']\r
if os.path.isfile(path):\r
duration = int(self.gui.config['splash screen duration']) # HACK: config should decode types\r
:class:`~hooke.plugin.playlist.PlaylistPlugin`.\r
"""\r
\r
+import logging\r
import types\r
\r
import wx\r
""":class:`wx.TreeCtrl` subclass handling playlist and curve selection.\r
"""\r
def __init__(self, *args, **kwargs):\r
+ self.log = logging.getLogger('hooke')\r
self._panel = kwargs['parent']\r
self._callbacks = self._panel._callbacks # TODO: CallbackClass.set_callback{,s}()\r
super(Tree, self).__init__(*args, **kwargs)\r
def set_selected_curve(self, playlist, curve):\r
"""Make the curve the playlist's current curve.\r
"""\r
- print 'expanding', playlist.name\r
+ self.log.debug('playlist tree expanding %s' % playlist.name)\r
self.Expand(self._id_for_name[playlist.name])\r
self.Unbind(wx.EVT_TREE_SEL_CHANGED)\r
- print 'selecting', curve.name\r
+ self.log.debug('playlist tree selecting %s' % curve.name)\r
self.SelectItem(self._id_for_name[(playlist.name, curve.name)])\r
self.Bind(wx.EVT_TREE_SEL_CHANGED, self._on_select)\r
\r