コード例 #1
0
    def _init_check (self) :
        url   = self._url

        if url.port :
            raise rs.BadParameter("Cannot handle url %s (has fragment)" % url)
        if url.query :
            raise rs.BadParameter("Cannot handle url %s (has query)"    % url)
        if url.username :
            raise rs.BadParameter("Cannot handle url %s (has username)" % url)
        if url.password :
            raise rs.BadParameter("Cannot handle url %s (has password)" % url)

        self._path = url.path
コード例 #2
0
    def copy_self (self, target, flags) :

        tgt_url = rs.url.Url (target)
        tgt     = tgt_url.path
        src     = self._url.path

        if tgt_url.schema :
            if not tgt_url.schema.lower() in _ADAPTOR_SCHEMAS:
                raise rs.BadParameter("Cannot handle schema for %s" % target)

        if tgt[0] != '/' :
            tgt = "%s/%s"   % (os.path.dirname (src), tgt)

        print " copy %s %s" % (self._url, tgt)
        shutil.copy2 (src, tgt)