
    Z+Qh                         d dl mZmZ d Zy)    )urlparse
urlunparsec                    t        |       }|j                  j                  d      }t        |      dkD  r|j	                          nt        d      dj                  |      dz   |z   }|j                  |      }t        |      }|S )N/   z%URL path has no components to replace)path)	r   r   splitlenpop
ValueErrorjoin_replacer   )urlnew_path
parsed_urlpath_componentsnew_parsed_urlnew_urls         G/server/volume/plugins/@scrypted/onnx/zip/unzipped/common/path_tools.pyreplace_last_path_componentr      s    #J !oo++C0O ?a@AA xx(3.9H  ((h(7N (GN    N)urllib.parser   r   r    r   r   <module>r      s    -r   