mirror of
https://github.com/ansible/awx.git
synced 2026-04-07 02:59:21 -02:30
Moved API code into separate Django app.
This commit is contained in:
2
awx/lib/__init__.py
Normal file
2
awx/lib/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
31
awx/lib/compat.py
Normal file
31
awx/lib/compat.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
'''
|
||||
Compability library for support of both Django 1.4.x and Django 1.5.x.
|
||||
'''
|
||||
|
||||
try:
|
||||
from django.utils.html import format_html
|
||||
except ImportError:
|
||||
from django.utils.html import conditional_escape
|
||||
from django.utils.safestring import mark_safe
|
||||
def format_html(format_string, *args, **kwargs):
|
||||
args_safe = map(conditional_escape, args)
|
||||
kwargs_safe = dict([(k, conditional_escape(v)) for (k, v) in
|
||||
kwargs.items()])
|
||||
return mark_safe(format_string.format(*args_safe, **kwargs_safe))
|
||||
|
||||
try:
|
||||
from django.utils.log import RequireDebugTrue
|
||||
except ImportError:
|
||||
import logging
|
||||
from django.conf import settings
|
||||
class RequireDebugTrue(logging.Filter):
|
||||
def filter(self, record):
|
||||
return settings.DEBUG
|
||||
|
||||
try:
|
||||
from django.utils.text import slugify
|
||||
except ImportError:
|
||||
from django.template.defaultfilters import slugify
|
||||
Reference in New Issue
Block a user