| 12345678910111213141516171819202122232425262728293031323334353637 |
- # -*- coding: utf-8 -*-
- """
- -------------------------------------------------
- File Name: configHandler
- Description :
- Author : JHao
- date: 2020/6/22
- -------------------------------------------------
- Change Activity:
- 2020/6/22:
- -------------------------------------------------
- """
- __author__ = 'JHao'
- import os
- import setting
- from util.singleton import Singleton
- from util.lazyProperty import LazyProperty
- class ConfigHandler(object):
- __metaclass__ = Singleton
- def __init__(self):
- pass
- @LazyProperty
- def serverHost(self):
- return os.environ.get("HOST", setting.HOST)
- @LazyProperty
- def serverPort(self):
- return os.environ.get("PORT", setting.PORT)
- @LazyProperty
- def dbConn(self):
- return os.getenv("DB_CONN", setting.DB_CONN)
|