コード例 #1
0
ファイル: url.py プロジェクト: vokac/pilot
    def _renew_url (self, scheme='', netloc='', path='', 
                          params='', query='',  fragment='') :

        # always normalize the path
        if  path :
            path = os.path.normpath (path)

        newurl = urlparse.urlunparse ((scheme   or self._urlobj.scheme,
                                       netloc   or self._urlobj.netloc,
                                       path     or self._urlobj.path,
                                       params   or self._urlobj.params,
                                       query    or self._urlobj.query,
                                       fragment or self._urlobj.fragment))

        self._urlobj = urlparse.urlparse (newurl)
コード例 #2
0
    def _renew_url (self, scheme='', netloc='', path='', 
                          params='', query='',  fragment='', force_path=False) :

        # always normalize the path.  
        path = self.normpath(path)

        if  force_path :
            forced_path = path or ''
        else :
            forced_path = path or self._urlobj.path


        newurl = urlparse.urlunparse ((scheme   or self._urlobj.scheme,
                                       netloc   or self._urlobj.netloc,
                                       forced_path,
                                       params   or self._urlobj.params,
                                       query    or self._urlobj.query,
                                       fragment or self._urlobj.fragment))

        self._urlobj = urlparse.urlparse (newurl, allow_fragments=True)
コード例 #3
0
    def _renew_url (self, scheme='', netloc='', path='', 
                          params='', query='',  fragment='', force_path=False) :

        # always normalize the path.  
        path = self.normpath(path)

        if  force_path :
            forced_path = path or ''
        else :
            forced_path = path or self._urlobj.path


        newurl = urlparse.urlunparse ((scheme   or self._urlobj.scheme,
                                       netloc   or self._urlobj.netloc,
                                       forced_path,
                                       params   or self._urlobj.params,
                                       query    or self._urlobj.query,
                                       fragment or self._urlobj.fragment))

        self._urlobj = urlparse.urlparse (newurl, allow_fragments=True)