X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt-dht.py;h=1d9933b47d39b280dbd205e347c0479d06fb8add;hp=c8d007982cad455ca9e5dba42bcb601fee170072;hb=83cdadb09382187318c9a281ebc0e4b10c32cf17;hpb=d1a2027b26e3791e7e05f1247f00c279ce46ce99 diff --git a/apt-dht.py b/apt-dht.py index c8d0079..1d9933b 100644 --- a/apt-dht.py +++ b/apt-dht.py @@ -16,10 +16,10 @@ from twisted.internet import reactor from twisted.python import usage, log from twisted.web2 import channel -from apt_dht.apt_dht_conf import config, version +from apt_dht.apt_dht_conf import config, version, DEFAULT_CONFIG_FILES from apt_dht.interfaces import IDHT -config_file = [] +config_file = '' if __name__ == '__main__': # Parse command line parameters when started on command line @@ -28,7 +28,7 @@ if __name__ == '__main__': ['help', 'h', 'Print this help message'], ] optParameters = [ - ['config-file', 'c', [], "Configuration file"], + ['config-file', 'c', '', "Configuration file"], ['log-file', 'l', '-', "File to log to, - for stdout"], ] longdesc="apt-dht is a peer-to-peer downloader for apt users" @@ -51,7 +51,9 @@ if __name__ == '__main__': f = open(log_file, 'w') log.startLogging(f, setStdout=1) -config.read(config_file) +log.msg("Loading config files: '%s'" % "', '".join(DEFAULT_CONFIG_FILES + [config_file])) +config_read = config.read(DEFAULT_CONFIG_FILES + [config_file]) +log.msg("Successfully loaded config files: '%s'" % "', '".join(config_read)) if config.has_option('DEFAULT', 'username') and config.get('DEFAULT', 'username'): uid,gid = pwd.getpwnam(config.get('DEFAULT', 'username'))[2:4] else: