def doTranFunc(funcs): typeManager = StdTypeManger() input = "e:/server5/counter/trunk/Protocol/rpc/Counter.rpc" desc = parseFile(input, typeManager) tryTranFunc(desc, typeManager, funcs)
def doTranStruct(structs): typeManager = StdTypeManger() #input = "e:/server5/counter/trunk/Protocol/rpc/CounterStructs.rpc" input = "e:/server5/counter/trunk/Protocol/rpc/Structs.rpc" desc = parseFile(input, typeManager) tryTranStruct(desc, typeManager, structs)
sys.argv = [ "", "E:\\SVN\\ttservice\\branches\\traderapi_20131114\\libs\\traderbase\\src\\Protocol\\rpc", "E:\\SVN\\ttservice\\branches\\traderapi_20131114\\src\\XtTraderApi", ] dir = sys.argv[1] basePath = dir + "/Structs.rpc" ftPath = dir + "/FtCommon.rpc" stockPath = dir + "/StockCommon.rpc" clientTraderPath = dir + "/ClientTraderCommon.rpc" outDir = sys.argv[2] typeManager = StdTypeManger() base_desc = parseFile(basePath, typeManager) ft_desc = parseFile(ftPath, typeManager) stock_desc = parseFile(stockPath, typeManager) clientTrader_desc = parseFile(clientTraderPath, typeManager) total_desc = base_desc total_desc.structs = base_desc.structs + ft_desc.structs + stock_desc.structs + clientTrader_desc.structs desc = total_desc desc = RPCDescript() for name in NEED_STRUCTS: for astruct in total_desc.structs: print astruct.name, name if astruct.name == name: desc.structs.append(astruct) break