~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/config/__init__.py

  • Committer: William Grant
  • Date: 2009-04-07 03:48:23 UTC
  • mfrom: (1165.1.46 submissions)
  • Revision ID: grantw@unimelb.edu.au-20090407034823-snd6wa5p6otzq073
Allow students to submit projects from personal or group repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
def search_confdir():
40
40
    """
41
 
    Search for the config file, and return the directory it is in.
 
41
    Search for the config file, and return it as a filename.
42
42
    1. Environment var IVLECONF (path to directory)
43
 
    2. /etc/ivle
 
43
    2. /etc/ivle/ivle.conf
44
44
    Raises a ConfigError on error.
45
45
    """
46
46
    if 'IVLECONF' in os.environ:
82
82
            confdir = search_confdir()
83
83
            conffile = os.path.join(confdir, 'ivle.conf')
84
84
            super(Config, self).__init__(infile=conffile, configspec=specfile,
85
 
                                         interpolation='template',
86
85
                                         *args, **kwargs)
87
86
            # XXX This doesn't raise errors if it doesn't validate
88
87
            self.validate(Validator())