Logo Search packages:      
Sourcecode: zine version File versions  Download package

def zine::application::Zine::add_theme (   self,
  name,
  template_path = None,
  metadata = None,
  settings = None,
  configuration_page = None 
)

Add a theme. You have to provide the shortname for the theme
which will be used in the admin panel etc. Then you have to provide
the path for the templates. Usually this path is relative to the
directory of the plugin's `__file__`.

The metadata can be ommited but in that case some information in
the admin panel is not available.

Alternatively a custom :class:`Theme` object can be passed to this
function as only argument.  This makes it possible to register
custom theme subclasses too.

Definition at line 878 of file application.py.

                                                         :
        """Add a theme. You have to provide the shortname for the theme
        which will be used in the admin panel etc. Then you have to provide
        the path for the templates. Usually this path is relative to the
        directory of the plugin's `__file__`.

        The metadata can be ommited but in that case some information in
        the admin panel is not available.

        Alternatively a custom :class:`Theme` object can be passed to this
        function as only argument.  This makes it possible to register
        custom theme subclasses too.
        """
        if isinstance(name, Theme):
            if template_path is not metadata is not settings \
               is not configuration_page is not None:
                raise TypeError('if a theme instance is provided extra '
                                'arguments must be ommited or None.')
            theme = name
        else:
            theme = Theme(name, template_path, metadata,
                          settings, configuration_page)
        if theme.app is not None:
            raise TypeError('theme is already registered to an application.')
        theme.app = self
        self.themes[theme.name] = theme

    @setuponly
    def add_shared_exports(self, name, path):


Generated by  Doxygen 1.6.0   Back to index