setup: when using the foolscap "what versions are here?" feature, use allmydata.get_package_versions() instead of specifically importing allmydata, pycryptopp, and zfec

This commit is contained in:
Zooko O'Whielacronx 2008-09-22 17:03:51 -07:00
parent 5075c12725
commit 992339b97e

View File

@ -7,21 +7,17 @@ from twisted.application import service
from twisted.internet import defer, reactor
from foolscap import Tub, eventual
import foolscap.logging.log
from allmydata import get_package_versions_string
from allmydata import get_package_versions, get_package_versions_string
from allmydata.util import log
from allmydata.util import fileutil, iputil, observer, humanreadable
from allmydata.util.assertutil import precondition
# Just to get their versions:
import allmydata, pycryptopp, zfec
from foolscap.logging import app_versions
# Add our application versions to the data that Foolscap's LogPublisher
# reports. Our __version__ attributes are actually instances of a "Version"
# class, so convert them into strings first.
app_versions.add_version('allmydata', str(allmydata.__version__))
app_versions.add_version('zfec', str(zfec.__version__))
app_versions.add_version('pycryptopp', str(pycryptopp.__version__))
# reports.
for thing, things_version in get_package_versions():
app_versions.add_version(thing, str(things_version))
# group 1 will be addr (dotted quad string), group 3 if any will be portnum (string)
ADDR_RE=re.compile("^([1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*)(:([1-9][0-9]*))?$")