Commit 60941151 by willmcgugan

Fixed getmeta for rpcfs

parent 838d94c3
...@@ -42,6 +42,17 @@ class RPCFSInterface(object): ...@@ -42,6 +42,17 @@ class RPCFSInterface(object):
"""Decode paths arriving over the wire.""" """Decode paths arriving over the wire."""
return path.decode("base64").decode("utf8") return path.decode("base64").decode("utf8")
def getmeta(self, meta_name):
meta = self.fs.getmeta(meta_name)
return meta
def getmeta_default(self, meta_name, default):
meta = self.fs.getmeta(meta_name, default)
return xmlrpclib.Binary(meta)
def hasmeta(self, meta_name):
return self.fs.hasmeta(meta_name)
def get_contents(self, path): def get_contents(self, path):
path = self.decode_path(path) path = self.decode_path(path)
data = self.fs.getcontents(path) data = self.fs.getcontents(path)
......
...@@ -145,13 +145,14 @@ class RPCFS(FS): ...@@ -145,13 +145,14 @@ class RPCFS(FS):
return path.decode("base64").decode("utf8") return path.decode("base64").decode("utf8")
def getmeta(self, meta_name, default=NoDefaultMeta): def getmeta(self, meta_name, default=NoDefaultMeta):
if meta_name in self._meta: try:
return self._meta[meta_name] return self.proxy.getmeta(meta_name)
return self.proxy.getmeta(meta_name, default) except NoMetaError:
if default is not NoDefaultMeta:
return default
raise
def hasmeta(self, meta_name): def hasmeta(self, meta_name):
if meta_name in self._meta:
return True
return self.proxy.hasmeta(meta_name) return self.proxy.hasmeta(meta_name)
def open(self, path, mode="r"): def open(self, path, mode="r"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment