Automatically convert strs and lists to Files and Directories
authorEvan Broder <broder@mit.edu>
Tue, 12 Aug 2008 07:30:52 +0000 (00:30 -0700)
committerEvan Broder <broder@mit.edu>
Tue, 12 Aug 2008 07:30:52 +0000 (00:30 -0700)
routefs/__init__.py

index 9e2c6cc..5137256 100644 (file)
@@ -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):