# 
# File Name    : compref
# Creator      : liangfen
# Created Date : 2017/4/8
# Comment      : 
#
import os
from log import logger
log = logger.getLogger(__name__)


class ComPref:
    __scriptRootPath = ''

    def __init__(self):
        self.__logger = log

    def getScriptRootPath(self):
        return self.__scriptRootPath

    def setScriptRootPath(self, path):
        if not os.path.exists(path):
            self.__logger.warning('script root path is not valid: ' + path)
        self.__scriptRootPath = path

    def getDatabaseDefaultConfigFile(self):
        path = self.getScriptRootPath()
        path = os.path.join(path, 'files/dbconfig.properties')
        return path
