3d-dart/server/system/Utils.py
def RenameFilepath(inputfile,path=None,basename=None,extension=None):

	"""Rename a filepath in several ways: path, basename and/or extension"""
	
	orpath = os.path.dirname(inputfile)
	orbasename = os.path.splitext(os.path.basename(inputfile))[0] 
	orextension = os.path.splitext(os.path.basename(inputfile))[1] 
	
	newfile = ""
	
	if path == None:	# Set path
		newfile = orpath+"/"
	else:
		newfile = path+"/"
	if basename == None:	# Set file basename
		newfile = newfile+orbasename
	else:
		newfile = newfile+basename
	if extension == None:	# Set file extension
		newfile = newfile+orextension
	else:
		newfile = newfile+extension
		
	return newfile
Rename a filepath in several ways: path, basename and/or extension
Rename a filepath in several ways: path, basename and/or extension
Rename a filepath in several ways : path basename and / or extension
def RenameFilepath(inputfile,path=None,basename=None,extension=None):
	orpath = os.path.dirname(inputfile)
	orbasename = os.path.splitext(os.path.basename(inputfile))[0] 
	orextension = os.path.splitext(os.path.basename(inputfile))[1] 
	newfile = ""
	if path == None:	
		newfile = orpath+"/"
	else:
		newfile = path+"/"
	if basename == None:	
		newfile = newfile+orbasename
	else:
		newfile = newfile+basename
	if extension == None:	
		newfile = newfile+orextension
	else:
		newfile = newfile+extension
	return newfile
def RenameFilepath ( inputfile , path = None , basename = None , extension = None ) : orpath = os . path . dirname ( inputfile ) orbasename = os . path . splitext ( os . path . basename ( inputfile ) ) [ 0 ] orextension = os . path . splitext ( os . path . basename ( inputfile ) ) [ 1 ] newfile = "" if path == None : newfile = orpath + "/" else : newfile = path + "/" if basename == None : newfile = newfile + orbasename else : newfile = newfile + basename if extension == None : newfile = newfile + orextension else : newfile = newfile + extension return newfile
Rename a filepath in several ways: path, basename and/or extension
Rename a filepath in several ways : path basename and / or extension
"""Rename a filepath in several ways: path, basename and/or extension""" # Set path # Set file basename # Set file extension
inputfile
path
basename
extension