def populate(self, recurse): if self.children is not None: return self.children = {} for i, (name, data) in enumerate(self.children_d.items()): self.progressfunc("examining %d of %d" % (i, len(self.children_d))) if data[0] == "filenode": mutable = data[1].get("mutable", False) writecap = to_str(data[1].get("rw_uri")) readcap = to_str(data[1].get("ro_uri")) self.children[name] = TahoeFileSource(self.nodeurl, mutable, writecap, readcap) elif data[0] == "dirnode": writecap = to_str(data[1].get("rw_uri")) readcap = to_str(data[1].get("ro_uri")) if writecap and writecap in self.cache: child = self.cache[writecap] elif readcap and readcap in self.cache: child = self.cache[readcap] else: child = TahoeDirectorySource(self.nodeurl, self.cache, self.progressfunc) child.init_from_grid(writecap, readcap) if writecap: self.cache[writecap] = child if readcap: self.cache[readcap] = child if recurse: child.populate(True) self.children[name] = child else: # TODO: there should be an option to skip unknown nodes. raise TahoeError("Cannot copy unknown nodes (ticket #839). " "You probably need to use a later version of " "Tahoe-LAFS to copy this directory.")
def __init__(self, msg, resp): TahoeError.__init__(self, format_http_error(msg, resp))
def __init__(self, name): TahoeError.__init__( self, "No such file or directory %s" % quote_output(name))
def __init__(self, absname): quoted = quote_local_unicode_path(absname) TahoeError.__init__( self, "source '%s' is neither a file nor a directory, I can't handle it" % quoted)
def __init__(self, name, quotefn=quote_output): TahoeError.__init__( self, "source '%s' is not a directory, but ends with a slash" % quotefn(name))
def __init__(self, absname): quoted = quote_local_unicode_path(absname) TahoeError.__init__(self, "source '%s' is neither a file nor a directory, I can't handle it" % quoted)
def __init__(self, name, quotefn=quote_output): TahoeError.__init__(self, "source '%s' is not a directory, but ends with a slash" % quotefn(name))
def __init__(self, name, quotefn=quote_output): TahoeError.__init__(self, "No such file or directory %s" % quotefn(name))