Пример #1
0
    def localize(self, thing, *args, **kw):
        '''
        local settings from thing and its base classes plus any custom settings

        @param thing: some thing with local settings
        '''
        return twoq([type.mro(getcls(thing)), [thing]]).smash().pick('Meta'
        ).members().tap(lambda x: not x[0].startswith('__')).filter().reup(
        ).wrap(stuf).map().invoke('update', *args, **kw).value()
Пример #2
0
 def links(self):
     '''sequence of all links'''
     return self._links(self, getcls(self))
Пример #3
0
 def nodes(self):
     '''connector to all nodes linked to this node'''
     return self._nodes(self, getcls(self))
Пример #4
0
 def reset(self):
     '''reset previously accessed `lazybase` attributes'''
     this = vars(self)
     t = lambda x, y: x in this and isinstance(y, lazybase)
     exhaustmap(items(vars(getcls(self))), delattr, t)