Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jacob Kaplan-Moss authored September 27, 2005
3  django/conf/global_settings.py
@@ -109,6 +109,9 @@
109 109
 # loudly.
110 110
 SECRET_KEY = ''
111 111
 
  112
+# Path to the "jing" executable -- needed to validate XMLFields
  113
+JING_PATH = "/usr/bin/jng"
  114
+
112 115
 ##############
113 116
 # MIDDLEWARE #
114 117
 ##############
8  django/core/validators.py
@@ -23,7 +23,7 @@
23 23
 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
24 24
 url_re = re.compile(r'^http://\S+$')
25 25
 
26  
-JING = '/usr/bin/jing'
  26
+from django.conf.settings import JING_PATH
27 27
 
28 28
 class ValidationError(Exception):
29 29
     def __init__(self, message):
@@ -435,9 +435,9 @@ def __call__(self, field_data, all_data):
435 435
         fp = open(filename, 'w')
436 436
         fp.write(field_data)
437 437
         fp.close()
438  
-        if not os.path.exists(JING):
439  
-            raise Exception, "%s not found!" % JING
440  
-        p = os.popen('%s -c %s %s' % (JING, self.schema_path, filename))
  438
+        if not os.path.exists(JING_PATH):
  439
+            raise Exception, "%s not found!" % JING_PATH
  440
+        p = os.popen('%s -c %s %s' % (JING_PATH, self.schema_path, filename))
441 441
         errors = [line.strip() for line in p.readlines()]
442 442
         p.close()
443 443
         os.unlink(filename)

0 notes on commit cd34c16

Please sign in to comment.
Something went wrong with that request. Please try again.