Commit d9372743 by rfkelly0

wrap_fs_methods: allow the list of wrapped method names to be modified

parent e832689f
...@@ -273,13 +273,8 @@ def wrap_fs_methods(decorator, cls=None, exclude=[]): ...@@ -273,13 +273,8 @@ def wrap_fs_methods(decorator, cls=None, exclude=[]):
... ...
""" """
methods = ("open","exists","isdir","isfile","listdir","makedir","remove",
"setcontents","removedir","rename","getinfo","copy","move",
"copydir","movedir","close","getxattr","setxattr","delxattr",
"listxattrs","getsyspath","createfile")
def apply_decorator(cls): def apply_decorator(cls):
for method_name in methods: for method_name in wrap_fs_methods.method_names:
if method_name in exclude: if method_name in exclude:
continue continue
method = getattr(cls,method_name,None) method = getattr(cls,method_name,None)
...@@ -291,3 +286,9 @@ def wrap_fs_methods(decorator, cls=None, exclude=[]): ...@@ -291,3 +286,9 @@ def wrap_fs_methods(decorator, cls=None, exclude=[]):
else: else:
return apply_decorator return apply_decorator
wrap_fs_methods.method_names = ["open","exists","isdir","isfile","listdir",
"makedir","remove","setcontents","removedir","rename","getinfo","copy",
"move","copydir","movedir","close","getxattr","setxattr","delxattr",
"listxattrs","getsyspath","createfile"]
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