class RouteFS(fuse.Fuse):
"""
RouteFS: Web 2.0 for filesystems
-
- Any method that will be used as the controller in a Routes mapping
- (either by explicitly specifying the controller or by using the
- ':controller' variable) must be added to RouteFS.controllers
"""
- controllers = []
def __init__(self, *args, **kwargs):
super(RouteFS, self).__init__(*args, **kwargs)
self.map = self.make_map()
- self.map.create_regs(self.controllers)
def make_map(self):
"""
"""
m = routes.Mapper()
- m.connect(':controller')
+ m.connect('{controller}')
return m
class DictFS(routefs.RouteFS):
- controllers = ['handler']
-
@property
def files(self):
"""
class HomeFS(routefs.RouteFS):
- controllers = ['getList', 'getUser']
def __init__(self, *args, **kwargs):
super(HomeFS, self).__init__(*args, **kwargs)
self.cache = {}
class PyHesiodFS(routefs.RouteFS):
- controllers = ['getList', 'getReadme', 'getLocker']
def __init__(self, *args, **kwargs):
super(PyHesiodFS, self).__init__(*args, **kwargs)
self.fuse_args.add("allow_other", True)