From: W. Trevor King Date: Mon, 9 Aug 2010 12:15:19 +0000 (-0400) Subject: Allow hooke.ui to load with missing hooke.license submodule. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d017ba9b01933922466d8538b3283f28b0e174c;p=hooke.git Allow hooke.ui to load with missing hooke.license submodule. This is like similar code in hooke/__init__.py, and allows you to run Hooke from a snapshot without generating the license.py file. hooke/license.py is generated as needed by update_copyright.py, so it's not tracked by the version control system. However, running update_copyright.py requires a working Mercurial repository, which users may not have if they installed from a VCS tarball, etc. This code allows those users to run Hooke from such snapshots. Official releases should bundle a generates license.py file, so in that case this code is superfluous. --- diff --git a/hooke/ui/__init__.py b/hooke/ui/__init__.py index d70bd41..6a76b82 100644 --- a/hooke/ui/__init__.py +++ b/hooke/ui/__init__.py @@ -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',