make server file configurable

This commit is contained in:
Mickaël Serneels
2019-04-04 00:15:31 +02:00
parent c729bf666e
commit 003a9074d2

View File

@@ -4,7 +4,8 @@ class Config(ComboParser):
def load(self):
super(Config, self).load()
self.torhosts = [ str(i).strip() for i in self.common.tor_hosts.split(',') ]
with open('servers.txt', 'r') as handle:
#with open('servers.txt', 'r') as handle:
with open(self.watchd.source_file, 'r') as handle:
self.servers = [x.strip() for x in handle.readlines() if len(x.strip()) > 0]
def __init__(self):
super(Config, self).__init__('config.ini')
@@ -25,6 +26,7 @@ class Config(ComboParser):
self.add_item(section, 'oldies', bool, False, 're-test old proxies as well ? (default: False)', False)
self.add_item(section, 'oldies_checktime', int, 43200, 'base checking interval for *old* proxies in seconds (default: 43200)', False)
self.add_item(section, 'oldies_multi', int, 100, 'fetch threads*multi rows when testing oldies (default: 100)', False)
self.add_item(section, 'source_file', str, 'servers.txt', 'server/url list to read from (default: servers.txt)', False)
section = 'ppf'
self.add_item(section, 'debug', bool, False, 'whether to print additional debug info', False)