Example #1
0
    def __init__(self, host, port, jid, password):
        self.host = host
        self.port = port

        factory = component.componentFactory(jid, password)

        StreamManager.__init__(self, factory)
Example #2
0
    def __init__(self, host, port, jid, password):
        self.host = host
        self.port = port

        factory = component.componentFactory(jid, password)

        StreamManager.__init__(self, factory)
Example #3
0
def main():
	print("Hangouts to XMPP transport")

	config = Config()

	h2xComponent = h2x.h2xComponent(reactor, config)
	f = component.componentFactory(config.JID, config.PASSWORD)
	connector = component.buildServiceManager(config.JID, config.PASSWORD, "tcp:%s:%s" % (config.HOST, config.PORT))
	h2xComponent.setServiceParent(connector)
	connector.startService()
	reactor.run()
    def __init__(self, host, port, domain, password, extra_handlers=[]):
        self.host = host
        self.port = port
        self._state = None
        factory = component.componentFactory(domain, password)

        StreamManager.__init__(self, factory)
        for handler in extra_handlers:
            handler.setHandlerParent(self)

        self._state = u'connecting'
        zr = getUtility(IZopeReactor)
        zr.reactor.callFromThread(self.connect)
    def __init__(self, host, port, domain, password, extra_handlers=[]):
        self.host = host
        self.port = port
        self._state = None
        factory = component.componentFactory(domain, password)

        StreamManager.__init__(self, factory)
        for handler in extra_handlers:
            handler.setHandlerParent(self)

        self._state = u'connecting'
        zr = getUtility(IZopeReactor)
        zr.reactor.callFromThread(self.connect)
Example #6
0
def main():
    version = '0.3'
    config = ConfigParser.ConfigParser()
    config.read('weather.conf')
  
    jid = config.get('component', 'jid')
    password = config.get('component', 'password')
    host = config.get('component', 'host')
    port = config.get('component', 'port')
    path = config.get('component', 'basepath')
    c = gweather.WeatherComponent(reactor, version, config, jid)
    f = component.componentFactory(jid, password)
    connector = component.buildServiceManager(jid, password,
                                     "tcp:%s:%s" % (host, port))
    c.setServiceParent(connector)
    connector.startService()
    reactor.run() 
Example #7
0
    def connect(self, port, secret, host=None):
        """ Connect component to an XMPP-server to make it works.

        :param port: port to connect to. Needs to be set the same as in XMPP
        server config.

        :param secret: a secret to connect to XMPP server.

        :param host: a host to connect to XMPP server. It's needed only
        if host to connect is differ from jid."""

        if host is None:
            host = unicode(self.myjid)
        f = component.componentFactory(unicode(self.myjid), secret)
        connector = component.buildServiceManager(unicode(self.myjid), secret,
                                         "tcp:%s:%s" % (host, port))
        self.setServiceParent(connector)
        connector.startService()
Example #8
0
    def connect(self, port, secret, host=None):
        """ Connect component to an XMPP-server to make it works.

        :param port: port to connect to. Needs to be set the same as in XMPP
        server config.

        :param secret: a secret to connect to XMPP server.

        :param host: a host to connect to XMPP server. It's needed only
        if host to connect is differ from jid."""

        if host is None:
            host = unicode(self.myjid)
        f = component.componentFactory(unicode(self.myjid), secret)
        connector = component.buildServiceManager(unicode(self.myjid), secret,
                                                  "tcp:%s:%s" % (host, port))
        self.setServiceParent(connector)
        connector.startService()