Esempio n. 1
0
    def __init__(self, cache=10, monitor=True, **options):
        """Initialize a templating/serialization engine.
        
        The cache integer argument defines the number of templates to cache; use 0 to disable.
        
        The monitor boolean argument enables or disables file modification monitoring and template reloading.
        
        The mimetype string argument defines the default mimetype for this engine.
        """

        super(Engine, self).__init__()

        self.cache = Cache(
            cache if cache is not None and self.__cache__ else 0)

        self.monitor = monitor
        self.options = options
Esempio n. 2
0
    def setUp(self):
        self.cache = Cache(3)

        self.cache['A'] = 0
        self.cache['B'] = 1
        self.cache['C'] = 2