Back to index

moin  1.9.0~rc2
Namespaces | Classes | Functions | Variables
MoinMoin.theme Namespace Reference

Namespaces

namespace  classic
namespace  modern
namespace  modernized
namespace  modernized_cms
namespace  rightsidebar

Classes

class  ThemeBase
class  ThemeNotFound

Functions

def load_theme
def load_theme_fallback

Variables

tuple modules = pysupport.getPackageModules(__file__)
list rss_supported = sys.version_info[:3]

Class Documentation

class MoinMoin::theme::ThemeNotFound
Thrown if the supplied theme could not be found anywhere 

Definition at line 1883 of file __init__.py.


Function Documentation

def MoinMoin.theme.load_theme (   request,
  theme_name = None 
)
Load a theme for this request.

@param request: moin request
@param theme_name: the name of the theme
@type theme_name: str
@rtype: Theme
@return: a theme initialized for the request

Definition at line 1886 of file __init__.py.

01886 
01887 def load_theme(request, theme_name=None):
01888     """ Load a theme for this request.
01889 
01890     @param request: moin request
01891     @param theme_name: the name of the theme
01892     @type theme_name: str
01893     @rtype: Theme
01894     @return: a theme initialized for the request
01895     """
01896     if theme_name is None or theme_name == '<default>':
01897         theme_name = request.cfg.theme_default
01898 
01899     try:
01900         Theme = wikiutil.importPlugin(request.cfg, 'theme', theme_name, 'Theme')
01901     except wikiutil.PluginMissingError:
01902         raise ThemeNotFound(theme_name)
01903 
01904     return Theme(request)

Here is the caller graph for this function:

def MoinMoin.theme.load_theme_fallback (   request,
  theme_name = None 
)
Try loading a theme, falling back to defaults on error.

@param request: moin request
@param theme_name: the name of the theme
@type theme_name: str
@rtype: int
@return: A statuscode for how successful the loading was
         0 - theme was loaded
         1 - fallback to default theme
         2 - serious fallback to builtin theme

Definition at line 1905 of file __init__.py.

01905 
01906 def load_theme_fallback(request, theme_name=None):
01907     """ Try loading a theme, falling back to defaults on error.
01908 
01909     @param request: moin request
01910     @param theme_name: the name of the theme
01911     @type theme_name: str
01912     @rtype: int
01913     @return: A statuscode for how successful the loading was
01914              0 - theme was loaded
01915              1 - fallback to default theme
01916              2 - serious fallback to builtin theme
01917     """
01918     fallback = 0
01919     try:
01920         request.theme = load_theme(request, theme_name)
01921     except ThemeNotFound:
01922         fallback = 1
01923         try:
01924             request.theme = load_theme(request, request.cfg.theme_default)
01925         except ThemeNotFound:
01926             fallback = 2
01927             from MoinMoin.theme.modern import Theme
01928             request.theme = Theme(request)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

tuple MoinMoin.theme.modules = pysupport.getPackageModules(__file__)

Definition at line 16 of file __init__.py.

list MoinMoin.theme.rss_supported = sys.version_info[:3]

Definition at line 22 of file __init__.py.