Django

Code

Changeset 712

Show
Ignore:
Timestamp:
09/27/05 11:34:10 (3 years ago)
Author:
jacob
Message:

Moved JING from django.core.validators into settings where it belongs. Fixes #568.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r710 r712  
    110110SECRET_KEY = '' 
    111111 
     112# Path to the "jing" executable -- needed to validate XMLFields 
     113JING_PATH = "/usr/bin/jng" 
     114 
    112115############## 
    113116# MIDDLEWARE # 
  • django/trunk/django/core/validators.py

    r671 r712  
    2424url_re = re.compile(r'^http://\S+$') 
    2525 
    26 JING = '/usr/bin/jing' 
     26from django.conf.settings import JING_PATH 
    2727 
    2828class ValidationError(Exception): 
     
    436436        fp.write(field_data) 
    437437        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)) 
    441441        errors = [line.strip() for line in p.readlines()] 
    442442        p.close()