askbot.skins.utils

utilities dealing with resolution of skin components

the lookup resolution process for templates and media works as follows: * look up item in selected skin * if not found look in ‘default’ * the look in ‘common’ * raise an exception

exception askbot.skins.utils.MediaNotFound

Bases: exceptions.Exception

raised when media file is not found

askbot.skins.utils.get_available_skins(selected=None)

selected is a name of preferred skin if it’s None, then information about all skins will be returned otherwise, only data about selected, default and common skins will be returned

selected skin is guaranteed to be the first item in the dictionary

askbot.skins.utils.get_media_url(url)

returns url prefixed with the skin name of the first skin that contains the file directories are searched in this order: askbot_settings.ASKBOT_DEFAULT_SKIN, then ‘default’, then ‘commmon’ if file is not found - returns None and logs an error message

askbot.skins.utils.get_path_to_skin(skin)

returns path to directory in the list of available skin directories that contains another directory called skin

it is assumed that all skins are named uniquely

askbot.skins.utils.get_skin_choices()

returns a tuple for use as a set of choices in the form

askbot.skins.utils.get_skins_from_dir(directory)

returns sorted dict with skin data, like get_available_skins but from a specific directory

askbot.skins.utils.resolve_skin_for_media(media=None, preferred_skin=None)

This Page