def _resolveDotSegments(path):
 segs = []
 for seg in path:
  if (seg == u'.'):
   pass
  elif (seg == u'..'):
   if segs:
    segs.pop()
  else:
   segs.append(seg)
 if (list(path[(-1):]) in ([u'.'], [u'..'])):
  segs.append(u'')
 return segs

def _resolveDotSegments ( path ) : segs = [ ] for seg in path : if ( seg == u'.' ) : pass elif ( seg == u'..' ) : if segs : segs . pop ( ) else : segs . append ( seg ) if ( list ( path [ ( - 1 ) : ] ) in ( [ u'.' ] , [ u'..' ] ) ) : segs . append ( u'' ) return segs
normalise the url path by resolving segments of .