Show
Ignore:
Timestamp:
11/07/08 16:05:38 (5 years ago)
Author:
Nicolas ?vrard <nicoe@…>
Branch:
default
Message:

Do not use the entrypoint stuff anymore.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • relatorio/templates/__init__.py

    r62 r72  
    1919############################################################################### 
    2020 
    21 __metaclass__ = type 
     21import warnings 
    2222 
    23 import genshi.core 
     23plugins = ['opendocument', 'pdf', 'chart'] 
    2424 
    25  
    26 class RelatorioStream(genshi.core.Stream): 
    27     "Base class for the relatorio streams." 
    28  
    29     def render(self, method=None, encoding='utf-8', out=None, **kwargs): 
    30         "calls the serializer to render the template" 
    31         return self.serializer(self.events) 
    32  
    33     def serialize(self, method='xml', **kwargs): 
    34         "generates the bitstream corresponding to the template" 
    35         return self.render(method, **kwargs) 
    36  
    37     def __or__(self, function): 
    38         "Support for the bitwise operator" 
    39         return RelatorioStream(self.events | function, self.serializer) 
     25for name in plugins: 
     26    try: 
     27        __import__('relatorio.templates.%s' % name) 
     28    except: 
     29        warnings.warn("Unable to load plugin '%s', you will not be able " 
     30                      "to use it" % name)