X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=hooke%2Fui%2F__init__.py;h=28e523f713e360908d4509236d8b609d5a886b7f;hb=2080ad015e7239890d4bd77239016910299c2687;hp=cdb220e625ef7ace3b37e30c2a487cc0aff9e9f7;hpb=bf293ebc6a54c65097f3c10fe716d90d38ac317e;p=hooke.git diff --git a/hooke/ui/__init__.py b/hooke/ui/__init__.py index cdb220e..28e523f 100644 --- a/hooke/ui/__init__.py +++ b/hooke/ui/__init__.py @@ -2,15 +2,15 @@ # # This file is part of Hooke. # -# Hooke is free software: you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, either -# version 3 of the License, or (at your option) any later version. +# Hooke is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # -# Hooke is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# Hooke is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with Hooke. If not, see @@ -22,10 +22,18 @@ import ConfigParser as configparser from .. import version -from ..license import short_license from ..config import Setting from ..util.pluggable import IsSubclass, construct_odict +try: + from ..license import short_license +except ImportError, e: + import logging + logging.warn('Could not load short_license from hooke.license') + from .. import __license__ + def short_license(extra_info, **kwargs): + return __license__ + USER_INTERFACE_MODULES = [ 'commandline', @@ -39,25 +47,6 @@ USER_INTERFACE_SETTING_SECTION = 'user interfaces' """ -class QueueMessage (object): - def __str__(self): - return self.__class__.__name__ - -class CloseEngine (QueueMessage): - pass - -class CommandMessage (QueueMessage): - """A message storing a command to run, `command` should be a - :class:`hooke.command.Command` instance, and `arguments` should be - a :class:`dict` with `argname` keys and `value` values to be - passed to the command. - """ - def __init__(self, command, arguments=None): - self.command = command - if arguments == None: - arguments = {} - self.arguments = arguments - class UserInterface (object): """A user interface to drive the :class:`hooke.engine.CommandEngine`. """ @@ -93,17 +82,17 @@ class UserInterface (object): # Assorted useful tidbits for subclasses - def _splash_text(self, extra_info): + def _splash_text(self, extra_info, **kwargs): return (""" Hooke version %s %s ---- -""" % (version(), short_license(extra_info))).strip() +""" % (version(), short_license(extra_info, **kwargs))).strip() def _playlist_status(self, playlist): if len(playlist) > 0: - return '%s (%s/%s)' % (playlist.name, playlist._index + 1, + return '%s (%s/%s)' % (playlist.name, playlist.index() + 1, len(playlist)) return 'The playlist %s does not contain any valid force curve data.' \ % self.name