;-*-Doctest-*-

===========================
ClueMapperThemer Code Usage
===========================


Themes
======

Themes can be selected on a per project basis and equate to
deliverance themes.

  >>> from clue.themer.theme import ThemeManager

By default the only theme we'll get is the default theme since the
themes directory doesn't actually exist.

  >>> tmanager = ThemeManager('')
  >>> tmanager.themes
  [<Theme id=.DEFAULT_THEME; name=Default Theme>]

But creating a themes directory should fix this.

  >>> import os
  >>> from clue.tools import testing
  >>> workingtempdir = testing.gen_tempdir()
  >>> for x in range(1, 3):
  ...     os.makedirs(os.path.join(workingtempdir, 'etc', 'themes',
  ...                              'theme-%i' % x))
  >>> tmanager = ThemeManager(workingtempdir)
  >>> tmanager.themes
  [<Theme id=.DEFAULT_THEME; name=Default Theme>, <Theme id=theme-2; name=theme-2>, <Theme id=theme-1; name=theme-1>]

Creating a directory with a leading period should mean it gets
ignored.  Also using _lookup_themes directly here since the themes
property is cached.

  >>> os.makedirs(os.path.join(workingtempdir, 'etc', 'themes', '.foo'))
  >>> tmanager._lookup_themes()
  {'.DEFAULT_THEME': <Theme id=.DEFAULT_THEME; name=Default Theme>, 'theme-2': <Theme id=theme-2; name=theme-2>, 'theme-1': <Theme id=theme-1; name=theme-1>}
