示例#1
0
def get_db_password(db_name):
    from webnotes import defs
    if hasattr(defs, 'get_db_password'):
        return defs.get_db_password(db_name)

    elif hasattr(defs, 'db_password'):
        return defs.db_password

    else:
        return db_name
示例#2
0
def get_db_password(db_name):
	from webnotes import defs
	if hasattr(defs, 'get_db_password'):
		return defs.get_db_password(db_name)
		
	elif hasattr(defs, 'db_password'):
		return defs.db_password
		
	else:
		return db_name
示例#3
0
def get_db_password(db_name):
	"""
		Get db password from defs
	"""
	from webnotes import defs
	if hasattr(defs, 'get_db_password'):
		return defs.get_db_password(db_name)

	if hasattr(defs, 'db_password'):
		return defs.db_password
示例#4
0
def get_db_password(db_name):
	"""
		Get db password from defs
	"""
	from webnotes import defs
	if hasattr(defs, 'get_db_password'):
		return defs.get_db_password(db_name)

	if hasattr(defs, 'db_password'):
		return defs.db_password
示例#5
0
	def get_db_password(self, db_name, password):
		"""
			Return db password. order of importance:
			
				1. password
				2. defs.get_db_password()
				3. defs.db_password
		"""
		# password can be empty string
		if password:
			return password
		
		if hasattr(defs, 'get_db_password'):
			return defs.get_db_password(db_name)

		if hasattr(defs, 'db_password'):
			return defs.db_password

		else: 
			return ''
示例#6
0
    def get_db_password(self, db_name, password):
        """
			Return db password. order of importance:
			
				1. password
				2. defs.get_db_password()
				3. defs.db_password
		"""
        # password can be empty string
        if password:
            return password

        if hasattr(defs, 'get_db_password'):
            return defs.get_db_password(db_name)

        if hasattr(defs, 'db_password'):
            return defs.db_password

        else:
            return ''