def replaceNamespaceOnChar(self, nSpace='', quiet=False):
		''' replace namespace on character or add if none
			Params:
				nSpace: namespace to add/replace with
				quiet: suppress message
			Returns: True/False
		'''
		
		success = True
		
		# get selected reference or find it
		selected = self.getSelected(_type='all', found=True)
		if not selected:
			# try to select
			selected = self.getReference(namespace='', pyMB=False)
			if not selected:
				# run again
				if not quiet:
					moBuLogger.errorDialog("Select a node from the character")
				else:
					moBuLogger.error("Select a node from the character")
				return False
		
		# get the FBSet associated with the character
		if isinstance(selected, FBSet):
			charSet = selected
		else:
			charSet = mbSets.findSetFromObject(pObject=selected, quiet=quiet)
		if not charSet:
			return False
	
		# iterate through all items in set		
		for item in charSet.Items:
			# check if already has namespaces
			currentNS = None
			if mbNamespace.getNamespace(node=item):
				for ns in mbNamespace.getNamespace(node=item):
					# do NOT replace '*_Template' Namespaces
					if not '_Template' in ns:
						currentNS = ns
						
						# check for replace or add
						if not mbNamespace.replaceNamespace(node=item, nsOrig=currentNS, nsReplace=nSpace, hier=False):
							moBuLogger.debug("Failed to replaceNamespace on: '%s'" % item.LongName)
							success = False
					else:	#_Template Namespace
						# check for existence of new nSpace
						if not nSpace in mbNamespace.getNamespace(node=item):
							# add
							if not mbNamespace.addNamespace(node=item, ns=nSpace, hier=False):
								moBuLogger.debug("Failed to addNamespace on: '%s'" % item.LongName)
								success = False
			else:
				if not mbNamespace.addNamespace(node=item, ns=nSpace, hier=False):
					moBuLogger.debug("Failed to addNamespace on: '%s'" % item.LongName)
					success = False
			
		# add nameSpace to set as well
		if not mbNamespace.addNamespace(node=charSet, ns=nSpace, hier=False):
			moBuLogger.debug("Failed to addNamespace on: '%s'" % charSet.LongName)
			# no need to report False, already getting added
		
		return success
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/moBu/core/moBuNamespace.py/MoBuNamespace.replaceNamespaceOnChar/original