# -*- coding: utf-8 -*-
import os,  crypt

from log import log

translateTable = {
"stock_id":u"代码",
"stock_name":u"名称",
"stockname":u"名称",
"name":u"名称", 
"created":u"日期",
"growth_ratio":u"涨幅",
"current_price":u"现价",
"daily_up_down":u"日涨跌",
"bought_price":u"买入价",
"sold_price":u"卖出价",
"total_deal_amount":u"总量",
"last_deal_amount":u"现量",
"growth_speed":u"涨速",
"turnover_ratio":u"换手",
"today_begin_price":u"今开",
"ytd_end_price":u"昨收",
"pe_ratio":u"市盈率",
"max":u"最高",
"min":u"最低",
"total_money":u"总金额",
"amplitude_ratio":u"振幅",
"cir_of_cap_stock":u"流通股本",
"upordown_per_deal":u"笔涨跌",
"volume_ratio":u"量比",
"avg_price":u"均价",
"DaPanWeiBi":u"委比",
"sell":u"内盘",
"buy":u"外盘",
"sb_ratio":u"内外比",
"DaPanWeiCha":u"委量差",
"num1_buy":u"买量一",
"num1_sell":u"卖量一",
"num1_buy_price":u"买价一",
"num1_sell_price":u"卖价一",
"num2_buy":u"买量二",
"num2_sell":u"卖量二",
"num2_buy_price":u"买价二",
"num2_sell_price":u"卖价二",
"num3_buy":u"买量三",
"num3_sell":u"卖量三",
"num3_buy_price":u"买价三",
"num3_sell_price":u"卖价三",
"circulation_value":u"流通市值",
"bbi_balance":u"多空平衡",
"bull_profit":u"多头获利",
"bull_stop_losses":u"多头止损",
"short_covering":u"空头回补",
"bear_stop_losses":u"空头止损",
"relative_strength_index":u"强弱度",
"activity":u"活跃度",
"num_per_deal":u"每笔均量",
"turn_per_deal":u"每笔换手",
"update_date":u"更新日期",
"total_stock":u"总股本",
"max_circulation_value":u"最高价流通市值",
"current_circulation_value":u"现价流通市值",
"min_circulation_value":u"最低价流通市值",
"avg_circulation_value":u"均价流通市值",
"total_value":u"总市值", 
"stockid":u"代码",  
"listdate":u"日期", 
"onemonthsum":u"1月和", 
"twomonthsum":u"2月和", 
"threemonthsum":u"3月和", 
"fourmonthsum":u"4月和", 
"fivemonthsum":u"5月和", 
"sixmonthsum":u"6月和", 
"sevenmonthsum":u"7月和", 
"eightmonthsum":u"8月和", 
"ninemonthsum":u"9月和", 
"tenmonthsum":u"10月和", 
"elevenmonthsum":u"11月和", 
"twelvemonthsum":u"12月和", 
"threesum":u"3日和",
"foursum":u"4日和",
"fivesum":u"5日和",
"sixsum":u"6日和",
"sevensum":u"7日和",
"eightsum":u"8日和",
"ninesum":u"9日和",
"tensum":u"10日和",
"elevensum":u"11日和",
"twelvesum":u"12日和",
"thirteensum":u"13日和",
"fourteensum":u"14日和",
"fifteensum":u"15日和",
"sixteensum":u"16日和",
"seventeensum":u"17日和",
"eighteensum":u"18日和",
"nineteensum":u"19日和",
"twentysum":u"20日和",
"twenty1sum":u"21日和",
"twenty2sum":u"22日和",
"twenty3sum":u"23日和",
"twenty4sum":u"24日和",
"twenty5sum":u"25日和",
"twenty6sum":u"26日和",
"twenty7sum":u"27日和",
"twenty8sum":u"28日和",
"twenty9sum":u"29日和",
"thirtysum":u"30日和",
"oneweeksum":u"1周和",
"twoweeksum":u"2周和",
"threeweeksum":u"3周和",
"fourweeksum":u"4周和",
"fiveweeksum":u"5周和",
"sixweeksum":u"6周和",
"growthcount":u"涨幅总数", 
"ampcount":u"振幅总数", 
"g0":u"涨幅小于-9个数,%",
"g1":u"涨幅[-9~-8)个数,%",
"g2":u"涨幅[-8~-7)个数,%",
"g3":u"涨幅[-7~-6)个数,%",
"g4":u"涨幅[-6~-5)个数,%",
"g5":u"涨幅[-5~-4)个数,%",
"g6":u"涨幅[-4~-3)个数,%",
"g7":u"涨幅[-3~-2)个数,%",
"g8":u"涨幅[-2~-1)个数,%",
"g9":u"涨幅[-1~0)个数,%",
"g10":u"涨幅[0~1)个数,%",
"g11":u"涨幅[1~2)个数,%",
"g12":u"涨幅[2~3)个数,%",
"g13":u"涨幅[3~4)个数,%",
"g14":u"涨幅[4~5)个数,%",
"g15":u"涨幅[5~6)个数,%",
"g16":u"涨幅[6~7)个数,%",
"g17":u"涨幅[7~8)个数,%",
"g18":u"涨幅[8~9)个数,%",
"g19":u"涨幅大于9个数,%",
"a0":u"振幅[0~1)个数,%",
"a1":u"振幅[1~2)个数,%",
"a2":u"振幅[2~3)个数,%",
"a3":u"振幅[3~4)个数,%",
"a4":u"振幅[4~5)个数,%",
"a5":u"振幅[5~6)个数,%",
"a6":u"振幅[6~7)个数,%",
"a7":u"振幅[7~8)个数,%",
"a8":u"振幅[8~9)个数,%",
"a9":u"振幅[9~10)个数,%",
"a10":u"振幅[10~11)个数,%",
"a11":u"振幅[11~12)个数,%",
"a12":u"振幅[12~13)个数,%",
"a13":u"振幅[13~14)个数,%",
"a14":u"振幅[14~15)个数,%",
"a15":u"振幅[15~16)个数,%",
"a16":u"振幅[16~17)个数,%",
"a17":u"振幅[17~18)个数,%",
"a18":u"振幅[18~19)个数,%",
"a19":u"振幅大于19个数,%",
'startvalue':u"起始时间的值", 
'endvalue':u"结束时间的值", 
'maxdate':u"最大值日期", 
'mindate':u"最小值日期", 
'maxvalue':u"最大值", 
'minvalue':u"最小值", 
'startdate':u"开始日期", 
'enddate':u"结束日期", 
'avg':u"均值", 
'difference':u"差异", 
'crosstype':u"跨区类型", 
'endlistdate':u"结束-上市(天)", 
'startlistdate':u"开始-上市(天)", 
}
def translate(s):
    if s in translateTable:
        return translateTable[s]
    else:
        log('unKnown name',  s)
        return "###Unknown###"
