From: Evan Broder Date: Tue, 12 Aug 2008 07:30:52 +0000 (-0700) Subject: Automatically convert strs and lists to Files and Directories X-Git-Tag: 1.0.0~13 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-routefs.git/commitdiff_plain/e655b0b5c616a5e0732e68c2e2578f02ae4c84c5 Automatically convert strs and lists to Files and Directories --- diff --git a/routefs/__init__.py b/routefs/__init__.py index 9e2c6cc..5137256 100644 --- a/routefs/__init__.py +++ b/routefs/__init__.py @@ -86,6 +86,10 @@ class RouteFS(fuse.Fuse): return controller = match.pop('controller') result = getattr(self, controller)(**match) + if type(result) is str: + result = File(result) + if type(result) is list: + result = Directory(result) return result def readdir(self, path, offset):