Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved JING from django.core.validators into settings where it belongs…

…. Fixes #568.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cd34c163cc862113da5b27bf9f5ff452f538fb2c 1 parent 8b67f5f
@jacobian jacobian authored
Showing with 7 additions and 4 deletions.
  1. +3 −0  django/conf/global_settings.py
  2. +4 −4 django/core/validators.py
View
3  django/conf/global_settings.py
@@ -109,6 +109,9 @@
# loudly.
SECRET_KEY = ''
+# Path to the "jing" executable -- needed to validate XMLFields
+JING_PATH = "/usr/bin/jng"
+
##############
# MIDDLEWARE #
##############
View
8 django/core/validators.py
@@ -23,7 +23,7 @@
phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
url_re = re.compile(r'^http://\S+$')
-JING = '/usr/bin/jing'
+from django.conf.settings import JING_PATH
class ValidationError(Exception):
def __init__(self, message):
@@ -435,9 +435,9 @@ def __call__(self, field_data, all_data):
fp = open(filename, 'w')
fp.write(field_data)
fp.close()
- if not os.path.exists(JING):
- raise Exception, "%s not found!" % JING
- p = os.popen('%s -c %s %s' % (JING, self.schema_path, filename))
+ if not os.path.exists(JING_PATH):
+ raise Exception, "%s not found!" % JING_PATH
+ p = os.popen('%s -c %s %s' % (JING_PATH, self.schema_path, filename))
errors = [line.strip() for line in p.readlines()]
p.close()
os.unlink(filename)
Please sign in to comment.
Something went wrong with that request. Please try again.