PyXWF.Sitleton – One instance per site

class PyXWF.Sitleton.Sitleton(site, **kwargs)[source]

Note

If you want to create a sitleton, you probably want to be able to configure it. For that purpose, TweakSitleton is the correct baseclass.

This is a pretty dumb baseclass which does nothing more than storing the value of site as site.

However, this is useful when doing multiple inheritance to bring the diamond shape together at the right point (namely at Sitleton), which doesn’t break calling super() on init.

classmethod at_site(site)[source]

Return the sitleton instance of the class at which this method is called which has been instanciated at the Site site.

Raises SitletonNotAvailable if the sitleton has not been instanciated with exactly the class this method was called on at the given site.

Previous topic

PyXWF.Registry – Metaclass magic for registering plugins

Next topic

PyXWF.Tweaks – Obtaining and using site-wide configuration

This Page