/src/CassandraMonitor/mycassandramanager/cassandramanager.py

https://github.com/chrischeyne/Cassandra-Monitor
Python | 55 lines | 35 code | 3 blank | 17 comment | 0 complexity | 6ade3f70d348c8bca7f35f61a79e163a MD5 | raw file
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  5. # not use this file except in compliance with the License. You may obtain
  6. # a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. # License for the specific language governing permissions and limitations
  14. # under the License.
  15. #Thu Dec 15 15:45:21 GMT 2011
  16. """
  17. this instigates the web2py framework, instigates the handlers
  18. and starts the main application 'loop' on each node
  19. """
  20. __author__ = "Chris T. Cheyne"
  21. __copyright__ = "Copyright 2011, The Cassandra Manager Project"
  22. __credits__ = ["Chris Cheyne"]
  23. __license__ = "GPL"
  24. __version__ = "0.0.1"
  25. __maintainer__ = "Chris T. Cheyne"
  26. __email__ = "maintainer@cassandra-manager.org"
  27. __status__ = "Alpha"
  28. import sys
  29. import os
  30. import imp
  31. import mylogger.logger as loggingsystem
  32. SYSLOG = loggingsystem.MyLogger()
  33. SYSLOG.l.debug('booting....')
  34. import myconfig.config as config
  35. SYSCONFIG = config.MyConfig()
  36. SYSLOG.l.info('mysql host is %s ' % SYSCONFIG.conf['mysql']['host'])
  37. # MAIN LOOP
  38. class CassandraManager():
  39. def __init__(self):
  40. self.main()
  41. def main(self):
  42. """ our default bootstrapper. calls each module in turn. """
  43. # note we should be called from cassandramonitor.py
  44. if __name__ == "__main__":
  45. main()