tahoe-lafs/src/allmydata/__init__.py

67 lines
1.9 KiB
Python
Raw Normal View History

"""
Decentralized storage grid.
maintainer web site: U{http://allmydata.com/}
community web site: U{http://allmydata.org/}
"""
__version__ = "unknown"
try:
from _version import __version__
except ImportError:
# We're running in a tree that hasn't run "./setup.py darcsver", and didn't
# come with a _version.py, so we don't know what our version is. This should
# not happen very often.
pass
hush_pyflakes = __version__
del hush_pyflakes
try:
import pkg_resources
except ImportError:
# nevermind
pass
else:
pkg_resources.require("zfec >= 1.3.0")
pkg_resources.require("foolscap >= 0.2.3")
pkg_resources.require("simplejson >= 1.7.3")
pkg_resources.require("pycryptopp >= 0.2.9")
pkg_resources.require("nevow >= 0.6.0")
pkg_resources.require("zope.interface >= 3.1.0")
def get_package_versions():
import OpenSSL, allmydata, foolscap, nevow, pycryptopp, simplejson, twisted, zfec
setuptools_version = "unavailable"
try:
import setuptools
setuptools_version = setuptools.__version__
except ImportError:
pass
return {
'pyopenssl': OpenSSL.__version__,
'allmydata': allmydata.__version__,
'foolscap': foolscap.__version__,
'nevow': nevow.__version__,
'pycryptopp': pycryptopp.__version__,
'setuptools': setuptools_version,
'simplejson': simplejson.__version__,
'twisted': twisted.__version__,
'zfec': zfec.__version__,
}
def get_package_versions_string():
versions = get_package_versions()
res = []
for p in ["allmydata", "foolscap", "pycryptopp", "zfec", "twisted", "nevow"]:
if versions.has_key(p):
res.append(str(p) + ": " + str(versions[p]))
del versions[p]
else:
res.append(str(p) + ": UNKNOWN")
for p, v in versions.iteritems():
res.append(str(p) + ": " + str(v))
return ', '.join(res)