blob: 59b8279f175e279b4e8a7f1b108a95dbcd4b392c [file] [log] [blame]
apw059e1b12006-10-12 17:18:26 +00001"""The Job Configuration
2
3The job configuration, holding configuration variable supplied to the job.
apw8ad56be2006-11-06 17:49:54 +00004
5The config should be viewed as a hierachical namespace. The elements
6of the hierachy are separated by periods (.) and where multiple words
7are required at a level they should be separated by underscores (_).
8Please no StudlyCaps.
9
10For example:
11 boot.default_args
apw059e1b12006-10-12 17:18:26 +000012"""
13
14__author__ = """Copyright Andy Whitcroft 2006"""
15
apw0c01f072006-11-02 00:21:26 +000016import os
17
apw059e1b12006-10-12 17:18:26 +000018class config:
19 """The BASIC job configuration
20
21 Properties:
22 job
23 The job object for this job
24 config
25 The job configuration dictionary
26 """
27
28 def __init__(self, job):
29 """
30 job
31 The job object for this job
32 """
33 self.job = job
34 self.config = {}
35
36
37 def set(self, name, value):
apw0c01f072006-11-02 00:21:26 +000038 if name == "proxy":
39 os.environ['http_proxy'] = value
40 os.environ['ftp_proxy'] = value
41
apw059e1b12006-10-12 17:18:26 +000042 self.config[name] = value
43
44 def get(self, name):
45 if name in self.config:
46 return self.config[name]
47 else:
48 return None