X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt-p2p.py;h=8d69b06faee658b52c2fdade8455d0b85b634b15;hp=277cd76a93e25747165669f8fa1214c09e41bb23;hb=96ea4dd2eaf55c5e94f1a9f13ec36fac10387158;hpb=e848bee6cd8bd9ba754a21c3aff835f86d9c1aee diff --git a/apt-p2p.py b/apt-p2p.py index 277cd76..8d69b06 100644 --- a/apt-p2p.py +++ b/apt-p2p.py @@ -1,13 +1,14 @@ -#!/usr/bin/env python +#!/usr/bin/python -# Load apt-p2p application -# -# There are two ways apt-p2p can be started: -# 1. twistd -y apt-p2p -# - twistd will load this file and execute the app -# in 'application' variable -# 2. from command line -# - __name__ will be '__main__' +"""Load the apt-p2p application. + +There are two ways apt-p2p can be started: + 1. twistd -y apt-p2p + - twistd will load this file and execute the app + in 'application' variable + 2. from command line + - __name__ will be '__main__' +""" import pwd,sys @@ -15,7 +16,7 @@ from twisted.application import service, internet, app, strports from twisted.internet import reactor from twisted.python import usage, log -from apt_p2p.apt_p2p_conf import config, version, DEFAULT_CONFIG_FILES +from apt_p2p.apt_p2p_conf import config, version, versionID, DEFAULT_CONFIG_FILES from apt_p2p.interfaces import IDHT, IDHTStatsFactory config_file = '' @@ -52,6 +53,7 @@ if __name__ == '__main__': log.msg("Loading config files: '%s'" % "', '".join(DEFAULT_CONFIG_FILES + [config_file])) config_read = config.read(DEFAULT_CONFIG_FILES + [config_file]) +config.set(config.get('DEFAULT', 'DHT'), 'VERSION', versionID) log.msg("Successfully loaded config files: '%s'" % "', '".join(config_read)) try: uid,gid = pwd.getpwnam(config.get('DEFAULT', 'USERNAME'))[2:4]