1"""The Job Configuration 2 3The job configuration, holding configuration variable supplied to the job. 4 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 12""" 13 14__author__ = """Copyright Andy Whitcroft 2006""" 15 16import os 17 18class config(object): 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): 38 if name == "proxy": 39 os.environ['http_proxy'] = value 40 os.environ['ftp_proxy'] = value 41 42 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 49