Exemplo n.º 1
0
 def carbonlink(self):
     """Return a carbonlink."""
     with self._lock:
         if not self._carbonlink:
             if callable(carbonlink.CarbonLink):
                 self._carbonlink = carbonlink.CarbonLink()
             else:
                 self._carbonlink = carbonlink.CarbonLink
     return self._carbonlink
Exemplo n.º 2
0
 def carbonlink(self):
     """Return a carbonlink."""
     with self._lock:
         if not self._carbonlink:
             from django.conf import settings as django_settings
             if not django_settings.CARBONLINK_HOSTS:
                 self._carbonlink = _DISABLED
             elif callable(carbonlink.CarbonLink):
                 self._carbonlink = carbonlink.CarbonLink()
             else:
                 self._carbonlink = carbonlink.CarbonLink
     if self._carbonlink == _DISABLED:
         return None
     return self._carbonlink