No Description
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.

manager.py 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Copyright 2010 Maurizio Porrato <maurizio.porrato@gmail.com>
  5. # See LICENSE.txt for copyright info
  6. from twisted.internet import reactor
  7. from frn.protocol.manager import FRNManagerServer, FRNManagerServerFactory
  8. from twisted.enterprise.adbapi import ConnectionPool
  9. from frn.manager.dummy import DummyManager
  10. from frn.manager.remote import RemoteManager
  11. from frn.manager.database import DatabaseManager
  12. from frn.user import FRNUser
  13. from twisted.python import log
  14. if __name__ == '__main__':
  15. import sys
  16. log.startLogging(sys.stderr)
  17. def dummyManagerFactory():
  18. log.msg("Building DummyManager")
  19. return DummyManager()
  20. def remoteManagerFactory():
  21. log.msg("Building RemoteManager")
  22. return RemoteManager(reactor)
  23. pool = ConnectionPool("sqlite3", "/dev/shm/frnmanager.sqlite3", check_same_thread=False, cp_noisy=True)
  24. def databaseManagerFactory():
  25. log.msg("Building DatabaseManager")
  26. return DatabaseManager(pool)
  27. reactor.listenTCP(10025, FRNManagerServerFactory(
  28. databaseManagerFactory
  29. ))
  30. reactor.run()
  31. # vim: set et ai sw=4 ts=4 sts=4: