Permalink
Browse files

Eliminate make_map in favor of a simpler map property.

  • Loading branch information...
1 parent f3b3fcb commit ca61e30d8f2b2a794374ab3f424df9d5337e778a @ebroder committed Feb 26, 2009
Showing with 12 additions and 9 deletions.
  1. +5 −5 routefs/__init__.py
  2. +2 −1 routefs/dictfs.py
  3. +3 −2 routefs/examples/homefs.py
  4. +2 −1 routefs/examples/pyhesiodfs.py
View
@@ -43,13 +43,13 @@ class RouteFS(fuse.Fuse):
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):
+
+ @property
+ def map(self):
"""
- This method should be overridden by descendents of RouteFS to
- define the routing for the filesystem
+ This property should be overridden by descendents of RouteFS
+ to define the routing for the filesystem
"""
m = routes.Mapper()
View
@@ -24,7 +24,8 @@ def files(self):
"""
return dict()
- def make_map(self):
+ @property
+ def map(self):
m = Mapper()
m.connect('*path', controller='handler')
@@ -17,8 +17,9 @@ class HomeFS(routefs.RouteFS):
def __init__(self, *args, **kwargs):
super(HomeFS, self).__init__(*args, **kwargs)
self.cache = {}
-
- def make_map(self):
+
+ @property
+ def map(self):
m = Mapper()
m.connect('', controller='getList')
m.connect(':action', controller='getUser')
@@ -12,7 +12,8 @@ def __init__(self, *args, **kwargs):
self.cache = {}
- def make_map(self):
+ @property
+ def map(self):
m = Mapper()
m.connect('', controller='getList')
m.connect('README.txt', controller='getReadme')

0 comments on commit ca61e30

Please sign in to comment.