__init__.py 593 Bytes
Newer Older
juga's avatar
juga committed
1
__version__ = '1.0.3-dev0'
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

from . import globals  # noqa


class Settings:
    def __init__(self):
        # update this dict from globals (but only for ALL_CAPS settings)
        for setting in dir(globals):
            if setting.isupper():
                setattr(self, setting, getattr(globals, setting))

    def init_http_headers(self, nickname, uuid, tor_version):
        self.HTTP_HEADERS['Tor-Bandwidth-Scanner-Nickname'] = nickname
        self.HTTP_HEADERS['Tor-Bandwidth-Scanner-UUID'] = uuid
        self.HTTP_HEADERS['User-Agent'] += tor_version

settings = Settings()  # noqa