1 #=======================================================================
3 __version__
= '''0.0.01'''
4 __sub_version__
= '''20071106153539'''
5 __copyright__
= '''(c) Alex A. Naanou 2003'''
8 #-----------------------------------------------------------------------
9 #-----------------------------------------------------------taggerfor---
10 def taggerfor(tagset
):
12 this will create a decorator for tagging objects within a given tagset.
15 tag = taggerfor(sometagset)
24 soemtagset.tag(func, 'a', 'b', 'c')
28 tagset
.tag(func
, *tags
)
31 tag
.__doc
__ = 'decorator, will tag the function with tags within tagset (%s).' % (tagset
,)
35 #--------------------------------------------------TagByPathDecorator---
36 class TagByPathDecorator(object):
38 path tagging decorator generator.
41 tags = TagByPathDecorator(soemtagset)
47 # the above is the same as...
57 soemtagset.tag(func, 'a', 'b', 'c')
59 def __init__(self
, tagset
, path
=()):
64 def __getattr__(self
, name
):
67 return self
.__class
__(self
._tagset
, self
._path
+ (name
,))
68 def __call__(self
, func
):
71 self
._tagset
.tag(func
, *self
._path
)
76 #=======================================================================
77 # vim:set ts=4 sw=4 nowrap :