ConfigGetter.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # -*- coding: utf-8 -*-
  2. """
  3. -------------------------------------------------
  4. File Name: ConfigGetter
  5. Description : 读取配置
  6. Author : JHao
  7. date: 2019/2/15
  8. -------------------------------------------------
  9. Change Activity:
  10. 2019/2/15:
  11. -------------------------------------------------
  12. """
  13. __author__ = 'JHao'
  14. from util.utilClass import LazyProperty
  15. from config.setting import *
  16. class ConfigGetter(object):
  17. """
  18. get config
  19. """
  20. def __init__(self):
  21. pass
  22. # @LazyProperty
  23. # def db_type(self):
  24. # return DATABASES.get("default", {}).get("TYPE", "SSDB")
  25. #
  26. # @LazyProperty
  27. # def db_name(self):
  28. # return DATABASES.get("default", {}).get("NAME", "proxy")
  29. #
  30. # @LazyProperty
  31. # def db_host(self):
  32. # return DATABASES.get("default", {}).get("HOST", "127.0.0.1")
  33. #
  34. # @LazyProperty
  35. # def db_port(self):
  36. # return DATABASES.get("default", {}).get("PORT", 8888)
  37. #
  38. # @LazyProperty
  39. # def db_password(self):
  40. # return DATABASES.get("default", {}).get("PASSWORD", "")
  41. #
  42. # @LazyProperty
  43. # def proxy_getter_functions(self):
  44. # return PROXY_GETTER
  45. #
  46. # @LazyProperty
  47. # def host_ip(self):
  48. # return SERVER_API.get("HOST", "127.0.0.1")
  49. #
  50. # @LazyProperty
  51. # def host_port(self):
  52. # return SERVER_API.get("PORT", 5010)
  53. #
  54. # @LazyProperty
  55. # def verify_host(self):
  56. # return VERIFY_HOST
  57. config = ConfigGetter()
  58. if __name__ == '__main__':
  59. print(config.db_type)
  60. print(config.db_name)
  61. print(config.db_host)
  62. print(config.db_port)
  63. print(config.proxy_getter_functions)
  64. print(config.host_ip)
  65. print(config.host_port)
  66. print(config.db_password)