
try:
	import re
	import sys
        from ConfigParser import SafeConfigParser
except ImportError,e:
        import sys
        sys.stdout.write("%s\n" %e)
        sys.exit(1)


class Config_Parser:

	result = {}

	@staticmethod
        def parse(config_file):

		if not Config_Parser.result:
			cmd_parser = SafeConfigParser()
			cmd_parser.read(config_file)


		for section_name in cmd_parser.sections():
                        if section_name == "mail":
                                for name, value in cmd_parser.items(section_name):
                                        if name == "domain":
                                                domain = value
						Config_Parser.result["domain"] = domain
                        elif section_name == "smtp":
                                for name,value in cmd_parser.items(section_name):
                                        if name == "server":
                                                server = value
						Config_Parser.result["server"] = value
                                        elif name == "time":
                                                wait_time = value
						Config_Parser.result["wait_time"] = value
                        elif section_name == "log":
                                for name, value in cmd_parser.items(section_name):
                                        if name == "type":
                                                mail_type = value
						Config_Parser.result["mail_type"] = value
                                        elif name == "log_path":
                                                mail_log = value
						Config_Parser.result["mail_log"] = value
                        else:
                                print >> sys.stderr, bcolors.OKBLUE + "Error : " + bcolors.ENDC + bcolors.FAIL + "Wrong Parametre Usage In The Config File: %s"% (self.config_file) + bcolors.ENDC
                                sys.exit(1)

		return Config_Parser.result	



@@ -357,16 +357,17 @@
 le)%0A%0A%0A%09%09
+%09
 for sect
@@ -425,16 +425,17 @@
         
+%09
 if secti
@@ -477,32 +477,33 @@
                 
+%09
 for name, value 
@@ -569,32 +569,33 @@
                 
+%09
 if name == %22doma
@@ -647,16 +647,17 @@
         
+%09
 domain =
@@ -655,32 +655,33 @@
 %09domain = value%0A
+%09
 %09%09%09%09%09%09Config_Par
@@ -726,32 +726,33 @@
                 
+%09
 elif section_nam
@@ -788,32 +788,33 @@
                 
+%09
 for name,value i
@@ -879,32 +879,33 @@
                 
+%09
 if name == %22serv
@@ -957,16 +957,17 @@
         
+%09
 server =
@@ -971,32 +971,33 @@
 r = value%0A%09%09%09%09%09%09
+%09
 Config_Parser.re
@@ -1051,32 +1051,33 @@
                 
+%09
 elif name == %22ti
@@ -1129,16 +1129,17 @@
         
+%09
 wait_tim
@@ -1140,32 +1140,33 @@
 it_time = value%0A
+%09
 %09%09%09%09%09%09Config_Par
@@ -1217,24 +1217,25 @@
             
+%09
 elif section
@@ -1282,16 +1282,17 @@
         
+%09
 for name
@@ -1374,16 +1374,17 @@
         
+%09
 if name 
@@ -1438,24 +1438,25 @@
             
+%09
 mail_type = 
@@ -1459,32 +1459,33 @@
 e = value%0A%09%09%09%09%09%09
+%09
 Config_Parser.re
@@ -1550,16 +1550,17 @@
         
+%09
 elif nam
@@ -1624,16 +1624,17 @@
         
+%09
 mail_log
@@ -1638,24 +1638,25 @@
 log = value%0A
+%09
 %09%09%09%09%09%09Config
@@ -1714,16 +1714,17 @@
         
+%09
 else:%0A  
@@ -1753,16 +1753,17 @@
         
+%09
 print %3E%3E
@@ -1941,32 +1941,33 @@
                 
+%09
 sys.exit(1)%0A%0A%09%09r
@@ -1962,17 +1962,120 @@
 exit(1)%0A
-%0A
+                                %09%0A                        return Config_Parser.result        %09%0A%09%09else:%0A%09
 %09%09return

Update config.py