parameters: (self, path, toserver, Verbose)
return_statement: return newpath
docstring: Missing DocString
  
  		:param path:
  		:param toserver:
  		:param Verbose:
  		:return:
docstring_summary: Missing DocString
docstring_tokens: Missing DocString
function: def translatePath(self, path, toserver, Verbose):
  		"""Missing DocString
  
  		:param path:
  		:param toserver:
  		:param Verbose:
  		:return:
  		"""
  		newpath = cgruutils.toStr(path)
  		if len(newpath) < 1:
  			return newpath
  
  		if not self.initialized:
  			return newpath
  
  		position = 0
  
  		while newpath[position] in PathSeparators:
  			position += 1
  			if position >= len(newpath):
  				return newpath
  
  		maxcycles = len(newpath)
  		cycle = 0
  		while position != -1:
  			path_search = newpath[position:]
  			# print('position # %d/%d : "%s"' % (position, len(newpath), path_search))
  			for i in range(0, len(self.PathServer)):
  				if toserver:
  					path_from = self.PathClient[i]
  					path_to = self.PathServer[i]
  				else:
  					path_from = self.PathServer[i]
  					path_to = self.PathClient[i]
  
  				path_found = False
  
  				if 'windows' in cgruconfig.VARS['platform'] and toserver:
  					path_search = path_search.lower()
  					path_from = path_from.replace('/', '\\').lower()
  
  				if path_search.find(path_from) == 0:
  					path_found = True
  				else:
  					path_from = path_from.replace('\\', '/')
  					if path_search.find(path_from) == 0:
  						path_found = True
  
  				if path_found:
  					part1 = newpath[:position]
  					part2 = newpath[position + len(path_from):]
  					if not self.UnixSeparators:
  						if 'windows' in cgruconfig.VARS['platform'] \
  								and not toserver:
  							path_to = path_to.replace('/', '\\')
  					part2 = replaceSeparators(part2, path_from, path_to)
  					position = len(part1 + path_to)
  					newpath = part1 + path_to + part2
  					if Verbose:
  						print('Paths mapped:')
  						print(path)
  						print(newpath)
  					break
  
  			old_position = position
  			position = findNextPosition(position, newpath)
  			if position != -1 and position <= old_position:
  				print('Path translation error: Eldless cycle, '
  					  'position = %d.' % position)
  				break
  
  			cycle += 1
  
  			if cycle > maxcycles:
  				print(
  					'Path translation error: Cycle > maxcycles (%d>%d).' %
  					(cycle, maxcycles)
  				)
  				break
  
  		return newpath
function_tokens: def translatePath ( self , path , toserver , Verbose ) : newpath = cgruutils . toStr ( path ) if len ( newpath ) < 1 : return newpath if not self . initialized : return newpath position = 0 while newpath [ position ] in PathSeparators : position += 1 if position >= len ( newpath ) : return newpath maxcycles = len ( newpath ) cycle = 0 while position != - 1 : path_search = newpath [ position : ] # print('position # %d/%d : "%s"' % (position, len(newpath), path_search)) for i in range ( 0 , len ( self . PathServer ) ) : if toserver : path_from = self . PathClient [ i ] path_to = self . PathServer [ i ] else : path_from = self . PathServer [ i ] path_to = self . PathClient [ i ] path_found = False if 'windows' in cgruconfig . VARS [ 'platform' ] and toserver : path_search = path_search . lower ( ) path_from = path_from . replace ( '/' , '\\' ) . lower ( ) if path_search . find ( path_from ) == 0 : path_found = True else : path_from = path_from . replace ( '\\' , '/' ) if path_search . find ( path_from ) == 0 : path_found = True if path_found : part1 = newpath [ : position ] part2 = newpath [ position + len ( path_from ) : ] if not self . UnixSeparators : if 'windows' in cgruconfig . VARS [ 'platform' ] and not toserver : path_to = path_to . replace ( '/' , '\\' ) part2 = replaceSeparators ( part2 , path_from , path_to ) position = len ( part1 + path_to ) newpath = part1 + path_to + part2 if Verbose : print ( 'Paths mapped:' ) print ( path ) print ( newpath ) break old_position = position position = findNextPosition ( position , newpath ) if position != - 1 and position <= old_position : print ( 'Path translation error: Eldless cycle, ' 'position = %d.' % position ) break cycle += 1 if cycle > maxcycles : print ( 'Path translation error: Cycle > maxcycles (%d>%d).' % ( cycle , maxcycles ) ) break return newpath