From 992339b97ed5ae520f4bf3b0f13ca313cdeca2b8 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Mon, 22 Sep 2008 17:03:51 -0700 Subject: [PATCH] setup: when using the foolscap "what versions are here?" feature, use allmydata.get_package_versions() instead of specifically importing allmydata, pycryptopp, and zfec --- src/allmydata/node.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index f7c74872..b671cabd 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -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]*))?$") -- 2.45.2