[Zope] How to use has_key function at python script

Water Leung lhsumhk@yahoo.com.hk
Fri, 18 Jan 2002 17:06:25 +0800 (CST)


i write some script to check website language.As
following:

// en is English Folder
// gb and big5 is chinese Folder


switch_type = 0
master_map_type = {}
map_type = {}
request = container.REQUEST    
master_map_type = {
'lang_version'		:	['en','gb','big5'],
'img_postfix'	:	['_en','_gb','_big5'],
'url_postfix'		:	['/en/','','/big5/']
}

//when i use xxx?language='en'
//zope error said me language is not define.
//Anybody can help me fix it?

if id == 'en' or (request.has_key(language)):
	switch_type = 0
elif id == 'big5':
	switch_type = 2
else:
	switch_type = 1


for key in master_map_type.keys():
	map_type[key] = master_map_type[key][switch_type]
return map_type


_________________________________________________________
Do you Yahoo!?
SMS Messenger 手機電腦互動新趨勢
Instant messaging between PC and mobile 
http://hk.mobile.yahoo.com/sms_msgr.html