Home | History | Annotate | Download | only in bin
      1 """The Job Configuration
      2 
      3 The job configuration, holding configuration variable supplied to the job.
      4 
      5 The config should be viewed as a hierachical namespace.  The elements
      6 of the hierachy are separated by periods (.) and where multiple words
      7 are required at a level they should be separated by underscores (_).
      8 Please no StudlyCaps.
      9 
     10 For example:
     11         boot.default_args
     12 """
     13 
     14 __author__ = """Copyright Andy Whitcroft 2006"""
     15 
     16 import os
     17 
     18 class 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