/src/vomun.py

https://github.com/AnonLEF/vomun
Python | 50 lines | 28 code | 12 blank | 10 comment | 2 complexity | 6a1a0a977b31675a5a50c8ebb63907e1 MD5 | raw file
  1. #! /usr/bin/env python
  2. '''Start the program. Load segments of the program that need to be started and
  3. run them.'''
  4. import sys
  5. import time
  6. import libs.globals
  7. print(libs.globals.global_vars['anon+']['banner'] %
  8. (libs.globals.global_vars['anon+']['VERSION'],
  9. libs.globals.global_vars['anon+']['BUILD']))
  10. import libs.threadmanager
  11. import libs.events
  12. import libs.logs
  13. import libs.config
  14. ## Startup
  15. if __name__ == '__main__':
  16. # Create the console. Later to be replaced with an extenal app
  17. from libs.console import console
  18. consoleO = console()
  19. libs.threadmanager.register(consoleO)
  20. consoleO.start()
  21. # Load and prepare our list of friends
  22. import libs.friends as friends
  23. friends.load_friends()
  24. # Load connection handlers and start
  25. import tunnels.directudp
  26. tunnels.directudp.start()
  27. # Start the web interface
  28. import uis.web.manager
  29. uis.web.manager.start()
  30. ## main loop
  31. while libs.globals.global_vars['running']:
  32. time.sleep(0.5)
  33. ## cleanup
  34. libs.threadmanager.killall()
  35. friends.save_friends()
  36. libs.config.save_config()
  37. libs.globals.global_vars['running'] = False
  38. exit()