예제 #1
0
 def _get_star(self):
     if self.callables:
         for key in self.callables:
             yield (key, self.callables[key])
     for key in dir(self.module):
         if key[0] != '_':
             callable_ = getattr(self.module, key)
             if compat.callable(callable_):
                 yield key, compat.partial(callable_, self.context)
예제 #2
0
파일: runtime.py 프로젝트: 1025ryu/sns
 def _get_star(self):
     if self.callables:
         for key in self.callables:
             yield (key, self.callables[key])
     for key in dir(self.module):
         if key[0] != '_':
             callable_ = getattr(self.module, key)
             if compat.callable(callable_):
                 yield key, compat.partial(callable_, self.context)
예제 #3
0
파일: runtime.py 프로젝트: jchalex/xcat
 def __getattr__(self, key):
     if key in self.callables:
         val = self.callables[key]
     elif hasattr(self.module, key):
         callable_ = getattr(self.module, key)
         val = compat.partial(callable_, self.context)
     elif self.inherits:
         val = getattr(self.inherits, key)
     else:
         raise AttributeError("Namespace '%s' has no member '%s'" % (self.name, key))
     setattr(self, key, val)
     return val
예제 #4
0
 def __getattr__(self, key):
     if key in self.callables:
         val = self.callables[key]
     elif hasattr(self.module, key):
         callable_ = getattr(self.module, key)
         val = compat.partial(callable_, self.context)
     elif self.inherits:
         val = getattr(self.inherits, key)
     else:
         raise AttributeError("Namespace '%s' has no member '%s'" % (self.name, key))
     setattr(self, key, val)
     return val
예제 #5
0
파일: runtime.py 프로젝트: 10sr/hue
    def __init__(self, buffer, **data):
        self._buffer_stack = [buffer]

        self._data = data

        self._kwargs = data.copy()
        self._with_template = None
        self._outputting_as_unicode = None
        self.namespaces = {}

        # "capture" function which proxies to the
        # generic "capture" function
        self._data['capture'] = compat.partial(capture, self)

        # "caller" stack used by def calls with content
        self.caller_stack = self._data['caller'] = CallerStack()
예제 #6
0
    def __init__(self, buffer, data):
        self._buffer_stack = [buffer]

        self._data = data

        self._kwargs = data.copy()
        self._with_template = None
        self._outputting_as_unicode = None
        self.namespaces = {}

        # "capture" function which proxies to the
        # generic "capture" function
        self._data['capture'] = compat.partial(mako_runtime.capture, self)

        # "caller" stack used by def calls with content
        self.caller_stack = self._data['caller'] = mako_runtime.CallerStack()
예제 #7
0
파일: runtime.py 프로젝트: 10sr/hue
 def get(key):
     callable_ = getattr(self.module, key)
     return compat.partial(callable_, self.context)
예제 #8
0
파일: runtime.py 프로젝트: 10sr/hue
 def get(key):
     callable_ = self.template._get_def_callable(key)
     return compat.partial(callable_, self.context)
예제 #9
0
 def get(key):
     callable_ = getattr(self.module, key)
     return compat.partial(callable_, self.context)
예제 #10
0
 def get(key):
     callable_ = self.template._get_def_callable(key)
     return compat.partial(callable_, self.context)