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.
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',