(self, config, thedir, ports,
                 auth=[], ver=2, group_readable=0)
config is the TorConfig to which this will belong, thedir
        corresponds to 'HiddenServiceDir' and will ultimately contain
        a 'hostname' and 'private_key' file, ports is a list of lines
        corresponding to HiddenServicePort (like '80 127.0.0.1:1234'
        to advertise a hidden service at port 80 and redirect it
        internally on 127.0.0.1:1234). auth corresponds to the
        HiddenServiceAuthenticateClient lines and can be either a
        string or a list of strings (like 'basic client0,client1' or
        'stealth client5,client6') and ver corresponds to
        HiddenServiceVersion and is always 2 right now.

        XXX FIXME can we avoid having to pass the config object
        somehow? Like provide a factory-function on TorConfig for
        users instead?
config is the TorConfig to which this will belong, thedir
        corresponds to 'HiddenServiceDir' and will ultimately contain
        a 'hostname' and 'private_key' file, ports is a list of lines
        corresponding to HiddenServicePort (like '80 127.0.0.1:1234'
        to advertise a hidden service at port 80 and redirect it
        internally on 127.0.0.1:1234). auth corresponds to the
        HiddenServiceAuthenticateClient lines and can be either a
        string or a list of strings (like 'basic client0,client1' or
        'stealth client5,client6') and ver corresponds to
        HiddenServiceVersion and is always 2 right now.
config is the TorConfig to which this will belong thedir corresponds to HiddenServiceDir and will ultimately contain a hostname and private_key file ports is a list of lines corresponding to HiddenServicePort ( like 80 127 . 0 . 0 . 1 : 1234 to advertise a hidden service at port 80 and redirect it internally on 127 . 0 . 0 . 1 : 1234 ) . auth corresponds to the HiddenServiceAuthenticateClient lines and can be either a string or a list of strings ( like basic client0 client1 or stealth client5 client6 ) and ver corresponds to HiddenServiceVersion and is always 2 right now .
def __init__(self, config, thedir, ports,
                 auth=[], ver=2, group_readable=0):
        """
        config is the TorConfig to which this will belong, thedir
        corresponds to 'HiddenServiceDir' and will ultimately contain
        a 'hostname' and 'private_key' file, ports is a list of lines
        corresponding to HiddenServicePort (like '80 127.0.0.1:1234'
        to advertise a hidden service at port 80 and redirect it
        internally on 127.0.0.1:1234). auth corresponds to the
        HiddenServiceAuthenticateClient lines and can be either a
        string or a list of strings (like 'basic client0,client1' or
        'stealth client5,client6') and ver corresponds to
        HiddenServiceVersion and is always 2 right now.

        XXX FIXME can we avoid having to pass the config object
        somehow? Like provide a factory-function on TorConfig for
        users instead?
        """

        self.conf = config
        self.dir = thedir
        self.version = ver
        self.group_readable = group_readable

        # lazy-loaded if the @properties are accessed
        self._private_key = None
        self._clients = None
        self._hostname = None
        self._client_keys = None

        # HiddenServiceAuthorizeClient is a list
        # in case people are passing '' for the auth
        if not auth:
            auth = []
        elif not isinstance(auth, list):
            auth = [auth]
        self.authorize_client = _ListWrapper(
            auth, functools.partial(
                self.conf.mark_unsaved, 'HiddenServices'
            )
        )

        # there are three magic attributes, "hostname" and
        # "private_key" are gotten from the dir if they're still None
        # when accessed. "client_keys" parses out any client
        # authorizations. Note that after a SETCONF has returned '250
        # OK' it seems from tor code that the keys will always have
        # been created on disk by that point

        if not isinstance(ports, list):
            ports = [ports]
        self.ports = _ListWrapper(ports, functools.partial(
            self.conf.mark_unsaved, 'HiddenServices'))
def __init__ ( self , config , thedir , ports , auth = [ ] , ver = 2 , group_readable = 0 ) : self . conf = config self . dir = thedir self . version = ver self . group_readable = group_readable # lazy-loaded if the @properties are accessed self . _private_key = None self . _clients = None self . _hostname = None self . _client_keys = None # HiddenServiceAuthorizeClient is a list # in case people are passing '' for the auth if not auth : auth = [ ] elif not isinstance ( auth , list ) : auth = [ auth ] self . authorize_client = _ListWrapper ( auth , functools . partial ( self . conf . mark_unsaved , 'HiddenServices' ) ) # there are three magic attributes, "hostname" and # "private_key" are gotten from the dir if they're still None # when accessed. "client_keys" parses out any client # authorizations. Note that after a SETCONF has returned '250 # OK' it seems from tor code that the keys will always have # been created on disk by that point if not isinstance ( ports , list ) : ports = [ ports ] self . ports = _ListWrapper ( ports , functools . partial ( self . conf . mark_unsaved , 'HiddenServices' ) )