Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xmpproutertap.py 781B

1 year ago
1234567891011121314151617181920212223242526272829
  1. # -*- test-case-name: twisted.words.test.test_xmpproutertap -*-
  2. #
  3. # Copyright (c) Twisted Matrix Laboratories.
  4. # See LICENSE for details.
  5. from twisted.application import strports
  6. from twisted.python import usage
  7. from twisted.words.protocols.jabber import component
  8. class Options(usage.Options):
  9. optParameters = [
  10. ("port", None, "tcp:5347:interface=127.0.0.1", "Port components connect to"),
  11. ("secret", None, "secret", "Router secret"),
  12. ]
  13. optFlags = [
  14. ("verbose", "v", "Log traffic"),
  15. ]
  16. def makeService(config):
  17. router = component.Router()
  18. factory = component.XMPPComponentServerFactory(router, config["secret"])
  19. if config["verbose"]:
  20. factory.logTraffic = True
  21. return strports.service(config["port"], factory)