def getLogger(file):
    if logwrapper:
        return logwrapper.defaultLogger(file)
    return logging.getLogger(file)
Esempio n. 2
0
"""

from django import template
from django.conf import settings
from django.template import loader_tags
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
import time
from django.template.base import Variable
from django import forms
from django.utils.datastructures import SortedDict
register = template.Library()

try:
    from common import logwrapper
    log = logwrapper.defaultLogger(__file__)
except ImportError:
    import logging
    log = logging.getLogger(__name__)

INSERT_TAG_KEY = 'insert-demands'
DEBUG = getattr(settings, 'IA_DEBUG', False)
MEDIA_URL = getattr(settings, 'IA_MEDIA_PREFIX', None)
if MEDIA_URL is None:
    MEDIA_URL = getattr(settings, 'STATIC_URL', None)
if MEDIA_URL is None:
    MEDIA_URL = getattr(settings, 'MEDIA_URL', None)
if MEDIA_URL is None:
    MEDIA_URL = '/media/'
USE_MEDIA_PREFIX = getattr(settings, 'IA_USE_MEDIA_PREFIX', True)
JS_FORMAT = getattr(settings, 'IA_JS_FORMAT',
"""

from django import template
from django.conf import settings
from django.template import loader_tags
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
import time
from django.template.base import Variable
from django import forms
from django.utils.datastructures import SortedDict
register = template.Library()

try:
    from common import logwrapper
    log = logwrapper.defaultLogger(__file__)
except ImportError:
    import logging
    log = logging.getLogger(__name__)

INSERT_TAG_KEY = 'insert-demands'
DEBUG = getattr(settings, 'IA_DEBUG', False)
MEDIA_URL = getattr(settings, 'IA_MEDIA_PREFIX', None)
if MEDIA_URL is None:
    MEDIA_URL = getattr(settings, 'STATIC_URL', None)
if MEDIA_URL is None:
    MEDIA_URL = getattr(settings, 'MEDIA_URL', None)
if MEDIA_URL is None:
    MEDIA_URL = '/media/'
USE_MEDIA_PREFIX = getattr(settings, 'IA_USE_MEDIA_PREFIX', True)
JS_FORMAT = getattr(settings, 'IA_JS_FORMAT', "<script type='text/javascript' src='{URL}'></script>")