Esempio n. 1
0
		def _find_(K,V):
			s=re.compile('\[(.*?)\]').search(V)
			if s: 
				V=V.replace(s.group(), config.get(s.group(1), K))
				_find_(K,V)
			return V
Esempio n. 2
0


# hosts.ini is only for Windows platform 
if HOST==None or DB==None: 
	HOSTS_INI = "hosts.ini"
	if os.path.exists(HOSTS_INI): 
		config = ConfigParser.ConfigParser()
		config.read(HOSTS_INI)
		
		if not all(map(config.has_section, ['HOST','DB'])): 
			sys.stderr.write(" XXX Fatal Error XXX\n ")
			sys.exit(1)
		
		if HOST==None: 
			HOST = config.get('HOST','host')
		if DB==None: 
			DB = config.get('DB','db',None)
	
	if HOST==None or DB==None: 
		sys.stderr.write(" XXX Fatal Error XXX\n ")
		sys.exit(1)
# End of hosts.ini

	
	
def seed_sequence_list(l):
	import random
	random.shuffle(l)	
	return l