src/tablemate/config.py
def version_info(ctx=None):
    """Return version information just like --version does."""
    from . import __version__

    prog = ctx.find_root().info_name if ctx else APP_NAME
    version = __version__
    try:
        import pkg_resources
    except ImportError:
        pass
    else:
        for dist in pkg_resources.working_set:
            scripts = dist.get_entry_map().get('console_scripts') or {}
            for _, entry_point in iteritems(scripts):
                if entry_point.module_name == (__package__ + '.__main__'):
                    version = dist.version
                    break

    return VERSION_INFO % dict(prog=prog, version=version)
Return version information just like --version does.
Return version information just like --version does.
Return version information just like -- version does .
def version_info(ctx=None):
    from . import __version__
    prog = ctx.find_root().info_name if ctx else APP_NAME
    version = __version__
    try:
        import pkg_resources
    except ImportError:
        pass
    else:
        for dist in pkg_resources.working_set:
            scripts = dist.get_entry_map().get('console_scripts') or {}
            for _, entry_point in iteritems(scripts):
                if entry_point.module_name == (__package__ + '.__main__'):
                    version = dist.version
                    break
    return VERSION_INFO % dict(prog=prog, version=version)
def version_info ( ctx = None ) : from . import __version__ prog = ctx . find_root ( ) . info_name if ctx else APP_NAME version = __version__ try : import pkg_resources except ImportError : pass else : for dist in pkg_resources . working_set : scripts = dist . get_entry_map ( ) . get ( 'console_scripts' ) or { } for _ , entry_point in iteritems ( scripts ) : if entry_point . module_name == ( __package__ + '.__main__' ) : version = dist . version break return VERSION_INFO % dict ( prog = prog , version = version )
Return version information just like --version does.
Return version information just like -- version does .
"""Return version information just like --version does."""
ctx