[增强功能] 中信证券ETF期权接口更新;修复在线realod策略
This commit is contained in:
parent
739b075045
commit
83771b8e56
20333
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.cpp
Normal file
20333
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.cpp
Normal file
File diff suppressed because it is too large
Load Diff
188
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.pxd
Normal file
188
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.pxd
Normal file
@ -0,0 +1,188 @@
|
||||
# coding=utf-8
|
||||
# distutils: language = c++
|
||||
|
||||
cdef extern from "ufx_interface.h":
|
||||
cdef cppclass c_IF2UnPacker
|
||||
|
||||
cdef cppclass c_IF2Packer:
|
||||
c_IF2Packer() except+
|
||||
void SetBuffer(char* pBuf,int iBufSize,int iDataLen)
|
||||
void BeginPack()
|
||||
int NewDataset(char *szDatasetName, int iReturnCode)
|
||||
int AddField(char *szFieldName,char cFieldType,int iFieldWidth,int iFieldScale)
|
||||
int AddStr(char *szValue)
|
||||
int AddInt(int iValue)
|
||||
int AddDouble(double fValue)
|
||||
int AddChar(char* cValue)
|
||||
int AddRaw(char* lpBuff,int iLen)
|
||||
void EndPack()
|
||||
int* GetPackBuf()
|
||||
int GetPackLen()
|
||||
int GetPackBufSize()
|
||||
int GetVersion()
|
||||
void SetReturnCode(long dwRetCode)
|
||||
c_IF2UnPacker* UnPack()
|
||||
void FreeMem()
|
||||
void ClearValue()
|
||||
void BeginPackEx(char* szName)
|
||||
void ClearDataSet()
|
||||
void Release()
|
||||
|
||||
cdef cppclass c_IF2UnPacker:
|
||||
c_IF2UnPacker(char* lpBuffer,int iLen) except+
|
||||
c_IF2UnPacker(c_IF2Packer* lpPacker) except+
|
||||
int GetVersion()
|
||||
char* GetErrorInfo()
|
||||
int Open(char* lpBuffer,int iLen)
|
||||
int GetDatasetCount()
|
||||
int SetCurrentDatasetByIndex(int nIndex)
|
||||
int SetCurrentDataset(char *szDatasetName)
|
||||
char* GetPackBuf()
|
||||
int GetPackLen()
|
||||
int GetRowCount()
|
||||
void First()
|
||||
void Last()
|
||||
void Go(int nRow)
|
||||
char* GetDatasetName()
|
||||
int OpenAndCopy(char* lpBuffer,int iLen)
|
||||
char* GetColTypeByName(char* columnName)
|
||||
int GetColScaleByName(char* columnName)
|
||||
int GetColWidthByName(char* columnName)
|
||||
int GetColCount();
|
||||
char* GetColName(int column);
|
||||
char* GetColType(int column);
|
||||
int GetColScale(int column);
|
||||
int GetColWidth(int column);
|
||||
int FindColIndex(char * columnName);
|
||||
char* GetStrByIndex(int column);
|
||||
char* GetStr(char * columnName);
|
||||
char* GetCharByIndex(int column);
|
||||
char* GetChar(char * columnName);
|
||||
double GetDoubleByIndex( int column);
|
||||
double GetDouble(char * columnName);
|
||||
int GetIntByIndex(int column);
|
||||
int GetInt(char * columnName);
|
||||
char* GetRawByIndex(int column,int * lpRawLen);
|
||||
char* GetRaw(char * columnName,int * lpRawLen);
|
||||
int WasNull();
|
||||
void Next();
|
||||
int IsEOF();
|
||||
int IsEmpty();
|
||||
void Destroy();
|
||||
void Release()
|
||||
|
||||
cdef cppclass C_CConfigInterface:
|
||||
C_CConfigInterface() except+
|
||||
int Load(char *szFileName)
|
||||
int Save(char *szFileName)
|
||||
char * GetString(char *szSection, char *szEntry, char *szDefault)
|
||||
int GetInt(char *szSection, char *szEntry, int iDefault)
|
||||
int SetString(char *szSection, char *szEntry, char *szValue)
|
||||
int SetInt(char *szSection, char *szEntry, int iValue)
|
||||
void Release()
|
||||
|
||||
cdef cppclass c_IBizMessage:
|
||||
c_IBizMessage() except+
|
||||
void SetFunction(int nFUnctionNo)
|
||||
int GetFunction()
|
||||
void SetPacketType(int nPacketType)
|
||||
int GetPacketType()
|
||||
void SetBranchNo(int nBranchNo)
|
||||
int GetBranchNo()
|
||||
void SetSystemNo(int nSystemNo)
|
||||
int GetSystemNo()
|
||||
void SetSubSystemNo(int nSubSystemNo)
|
||||
int GetSubSystemNo()
|
||||
void SetSenderId(int nSenderId)
|
||||
int GetSenderId()
|
||||
void SetPacketId(int nPacketId)
|
||||
int GetPacketId()
|
||||
void SetErrorNo(int nErrorNo)
|
||||
int GetErrorNo()
|
||||
void SetErrorInfo(char* strErrorInfo)
|
||||
char* GetErrorInfo()
|
||||
void SetReturnCode(int nReturnCode)
|
||||
int GetReturnCode()
|
||||
void SetContent(char* lpContent,int iLen)
|
||||
char* GetContent(int& iLen)
|
||||
void SetIssueType(int nIssueType)
|
||||
int GetIssueType()
|
||||
void SetSequeceNo(int nSequeceNo)
|
||||
int GetSequeceNo()
|
||||
void SetKeyInfo(char* lpKeyData,int iLen)
|
||||
char* GetKeyInfo(int& iLen)
|
||||
void SetAppData(char* lpAppdata,int nAppLen)
|
||||
char* GetAppData(int& nAppLen)
|
||||
int ChangeReq2AnsMessage()
|
||||
char* GetBuff(int& nBuffLen)
|
||||
int SetBuff(char* lpBuff,int nBuffLen)
|
||||
void ReSet()
|
||||
void Release()
|
||||
|
||||
cdef cppclass c_CSubscribeParamInterface:
|
||||
c_CSubscribeParamInterface() except+
|
||||
void SetTopicName(char* szName)
|
||||
void SetAppData(char* lpData,int iLen)
|
||||
void SetFilter(char* filterName,char* filterValue)
|
||||
void SetReturnFiled(char* filedName)
|
||||
void SetFromNow(int bFromNow)
|
||||
void SetReplace(int bReplace)
|
||||
void SetSendInterval(int nSendInterval)
|
||||
char* GetTopicName()
|
||||
char* GetAppData(int *iLen)
|
||||
char* GetFilterNameByIndex(int index)
|
||||
char* GetFilterValueByIndex(int index)
|
||||
char* GetFilterValue(char* fileName)
|
||||
int GetFilterCount()
|
||||
char* GetReturnFiled()
|
||||
int GetFromNow()
|
||||
int GetReplace()
|
||||
int GetSendInterval()
|
||||
void Release()
|
||||
|
||||
cdef cppclass c_SubCallBack:
|
||||
c_SubCallBack(char *lpMould,char *lpClass) except+
|
||||
c_SubCallBack() except+
|
||||
int initInstance()
|
||||
|
||||
cdef cppclass c_CSubscribeInterface:
|
||||
int SubscribeTopic(c_CSubscribeParamInterface* lpSubscribeParamInter ,int uiTimeout,c_IF2UnPacker** lppBizUnPack,c_IF2Packer* lpBizPack);
|
||||
int CancelSubscribeTopic(int subscribeIndex)
|
||||
void GetSubcribeTopic(c_IF2Packer* lpPack)
|
||||
void Release();
|
||||
|
||||
cdef cppclass c_CCallbackInterface:
|
||||
c_CCallbackInterface(char* sMould,char* sClass) except+
|
||||
c_CCallbackInterface() except+
|
||||
int InitInstance()
|
||||
|
||||
cdef cppclass c_CConnectionInterface:
|
||||
c_CConnectionInterface(C_CConfigInterface* lpConfig) except+
|
||||
int Create(c_CCallbackInterface *lpCallback)
|
||||
int Connect(unsigned int uiTimeout)
|
||||
int Close()
|
||||
char* GetServerAddress(int *lpPort)
|
||||
int GetStatus()
|
||||
int GetServerLoad()
|
||||
char* GetErrorMsg(int nErrorCode)
|
||||
int GetConnectError()
|
||||
int SendBiz(int iFunID, c_IF2Packer *lpPacker, int nAsy, int iSystemNo, int nCompressID)
|
||||
int RecvBiz(int hSend, c_IF2UnPacker **lppUnPackerOrStr, int uiTimeout, int uiFlag)
|
||||
int SendBizEx(int iFunID, c_IF2Packer *lpPacker,char* svrName, int nAsy, int iSystemNo, int nCompressID,int branchNo)
|
||||
int RecvBizEx(int hSend, c_IF2UnPacker **lppUnpackerOrStr, unsigned uiTimeout, unsigned uiFlag)
|
||||
int CreateEx(c_CCallbackInterface *lpCallback)
|
||||
char* GetRealAddress()
|
||||
int Reserved8()
|
||||
int Reserved9()
|
||||
char* GetSelfAddress()
|
||||
char* GetSelfMac()
|
||||
c_CSubscribeInterface* NewSubscriber(c_SubCallBack *lpCallback,char* SubScribeName,int iTimeOut,
|
||||
int iInitRecvQLen=INIT_RECVQ_LEN,int iStepRecvQLen=STEP_RECVQ_LEN)
|
||||
c_IF2UnPacker* GetTopic(int byForce,int iTimeOut)
|
||||
char* GetMCLastError()
|
||||
int Create2BizMsg(c_CCallbackInterface *lpCallback)
|
||||
int SendBizMsg(c_IBizMessage* lpMsg,int nAsy)
|
||||
int RecvBizMsg(int hSend, c_IBizMessage* lpMsg, unsigned uiTimeout, unsigned uiFlag)
|
||||
int Reserved10()
|
||||
int Reserved11()
|
||||
char* GetLastAnsError(int bAsyError)
|
519
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.pyx
Normal file
519
vnpy/api/t2sdk/py_t2sdk/py_t2sdk.pyx
Normal file
@ -0,0 +1,519 @@
|
||||
# coding=utf-8
|
||||
# distutils: language = c++
|
||||
|
||||
cimport py_t2sdk
|
||||
from cpython.pycapsule cimport *
|
||||
from ctypes import *
|
||||
from libcpp.string cimport string
|
||||
from libc.stdlib cimport *
|
||||
|
||||
cdef class pyIF2UnPacker
|
||||
|
||||
cdef class pyIF2Packer:
|
||||
cdef c_IF2Packer* lpPacker
|
||||
def __cinit__(self):
|
||||
self.lpPacker = new c_IF2Packer()
|
||||
def __dealloc__(self):
|
||||
del self.lpPacker
|
||||
def BeginPack(self):
|
||||
self.lpPacker.BeginPack()
|
||||
def NewDataset(self,str szDatasetName, int iReturnCode):
|
||||
sName = bytes(szDatasetName,encoding='utf-8')
|
||||
return self.lpPacker.NewDataset(sName,iReturnCode)
|
||||
def AddField(self,str szFieldName,str cFieldType='S',int iFieldWidth=255,int iFieldScale=4):
|
||||
sName = bytes(szFieldName,encoding='utf-8')
|
||||
sType = bytes(cFieldType,encoding='utf-8')
|
||||
return self.lpPacker.AddField(sName,sType[0],iFieldWidth,iFieldScale)
|
||||
def AddStr(self,str szValue):
|
||||
sValue = bytes(szValue,encoding='utf-8')
|
||||
return self.lpPacker.AddStr(sValue)
|
||||
def AddInt(self,int iValue):
|
||||
return self.lpPacker.AddInt(iValue)
|
||||
def AddDouble(self,double fValue):
|
||||
return self.lpPacker.AddDouble(fValue)
|
||||
def AddChar(self,str cValue):
|
||||
sValue = bytes(cValue,encoding='utf-8')
|
||||
return self.lpPacker.AddChar(sValue[0])
|
||||
def AddRaw(self,list lpBuff,int iLen):
|
||||
cdef char* sBuff = <char*>malloc(iLen)
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
sBuff[iIndex] = lpBuff[iIndex]
|
||||
iIndex+=1
|
||||
iRet = self.lpPacker.AddRaw(sBuff,iLen)
|
||||
free(sBuff)
|
||||
return iRet
|
||||
def EndPack(self):
|
||||
return self.lpPacker.EndPack()
|
||||
def GetPackBuf(self):
|
||||
cdef int iLength = self.lpPacker.GetPackLen()
|
||||
cdef int* sBuff = self.lpPacker.GetPackBuf()
|
||||
lpBuff = []
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLength:
|
||||
lpBuff.append(sBuff[iIndex])
|
||||
iIndex +=1
|
||||
return lpBuff
|
||||
def GetPackLen(self):
|
||||
return self.lpPacker.GetPackLen()
|
||||
def GetPackBufSize(self):
|
||||
return self.lpPacker.GetPackBufSize()
|
||||
def GetVersion(self):
|
||||
return self.lpPacker.GetVersion()
|
||||
def SetReturnCode(self,long dwRetCode):
|
||||
self.lpPacker.SetReturnCode(dwRetCode)
|
||||
def UnPack(self):
|
||||
cdef c_IF2UnPacker* lpUnpacker = self.lpPacker.UnPack()
|
||||
lpPyUnpacker = pyIF2UnPacker()
|
||||
lpPyUnpacker.lpUnpacker = lpUnpacker
|
||||
return lpPyUnpacker
|
||||
def FreeMem(self):
|
||||
self.lpPacker.FreeMem()
|
||||
def ClearValue(self):
|
||||
self.lpPacker.ClearValue()
|
||||
def BeginPackEx(self,str szName):
|
||||
sName = bytes(szName,encoding='utf-8')
|
||||
self.lpPacker.BeginPackEx(sName)
|
||||
def ClearDataSet(self):
|
||||
self.lpPacker.ClearDataSet()
|
||||
def Release(self):
|
||||
self.lpPacker.Release()
|
||||
|
||||
cdef class pyIF2UnPacker:
|
||||
cdef c_IF2UnPacker* lpUnpacker
|
||||
def __cinit__(self):
|
||||
self.lpUnpacker = NULL
|
||||
def __dealloc__(self):
|
||||
if self.lpUnpacker != NULL:
|
||||
del self.lpUnpacker
|
||||
self.lpUnpacker = NULL
|
||||
def GetVersion(self):
|
||||
return self.lpUnpacker.GetVersion()
|
||||
def Open(self,list lpBuff,int iLen):
|
||||
cdef char* sBuff = <char*>malloc(iLen)
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
sBuff[iIndex] = lpBuff[iIndex]
|
||||
iIndex+=1
|
||||
if self.lpUnpacker == NULL:
|
||||
self.lpUnpacker = new c_IF2UnPacker(sBuff,iLen)
|
||||
iRet = 0
|
||||
else:
|
||||
iRet = self.lpUnpacker.Open(sBuff,iLen)
|
||||
free(sBuff)
|
||||
return iRet
|
||||
def GetDatasetCount(self):
|
||||
if self.lpUnpacker == NULL:
|
||||
return -1;
|
||||
return self.lpUnpacker.GetDatasetCount()
|
||||
def SetCurrentDatasetByIndex(self,int nIndex):
|
||||
self.lpUnpacker.SetCurrentDatasetByIndex(nIndex)
|
||||
def SetCurrentDataset(self,str szDatasetName):
|
||||
sName = bytes(szDatasetName,encoding='utf-8')
|
||||
self.lpUnpacker.SetCurrentDataset(sName)
|
||||
def GetPackBuf(self):
|
||||
cdef char* lpBuff = self.lpUnpacker.GetPackBuf()
|
||||
return lpBuff
|
||||
def GetPackLen(self):
|
||||
return self.lpUnpacker.GetPackLen()
|
||||
def GetRowCount(self):
|
||||
return self.lpUnpacker.GetRowCount()
|
||||
def First(self):
|
||||
self.lpUnpacker.First()
|
||||
def Last(self):
|
||||
self.lpUnpacker.Last()
|
||||
def Go(self,int nRow):
|
||||
self.lpUnpacker.Go(nRow)
|
||||
def GetDatasetName(self):
|
||||
cdef char* sName = self.lpUnpacker.GetDatasetName()
|
||||
return sName
|
||||
def GetColTypeByName(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
cdef char* sType = self.lpUnpacker.GetColTypeByName(sName)
|
||||
return sType.decode('gbk')
|
||||
def GetColScaleByName(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
return self.lpUnpacker.GetColScaleByName(sName)
|
||||
def GetColWidthByName(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
return self.lpUnpacker.GetColWidthByName(sName)
|
||||
def GetColCount(self):
|
||||
return self.lpUnpacker.GetColCount()
|
||||
def GetColName(self,int column):
|
||||
return self.lpUnpacker.GetColName(column).decode('gbk')
|
||||
def GetColType(self,int column):
|
||||
cdef char* sType = self.lpUnpacker.GetColType(column)
|
||||
return sType.decode('gbk')
|
||||
def GetColScale(self,int column):
|
||||
return self.lpUnpacker.GetColScale(column)
|
||||
def GetColWidth(self,int column):
|
||||
return self.lpUnpacker.GetColWidth(column)
|
||||
def FindColIndex(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
return self.lpUnpacker.FindColIndex(sName)
|
||||
def GetStrByIndex(self,int column):
|
||||
return self.lpUnpacker.GetStrByIndex(column).decode('GBK')
|
||||
def GetStr(self,str columnName):
|
||||
sName = bytes(columnName,encoding='UTF-8')
|
||||
return self.lpUnpacker.GetStr(sName).decode('GBK')
|
||||
def GetCharByIndex(self,int column):
|
||||
return self.lpUnpacker.GetCharByIndex(column).decode('UTF-8')
|
||||
def GetChar(self,str columnName):
|
||||
sName = bytes(columnName,encoding='UTF-8')
|
||||
return self.lpUnpacker.GetChar(sName).decode('UTF-8')
|
||||
def GetDoubleByIndex(self, int column):
|
||||
return self.lpUnpacker.GetDoubleByIndex(column)
|
||||
def GetDouble(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
return self.lpUnpacker.GetDouble(sName)
|
||||
def GetIntByIndex(self,int column):
|
||||
return self.lpUnpacker.GetIntByIndex(column)
|
||||
def GetInt(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
if self.lpUnpacker == NULL:
|
||||
return -1
|
||||
return self.lpUnpacker.GetInt(sName)
|
||||
def GetRawByIndex(self,int column):
|
||||
cdef int ilength = 0
|
||||
cdef char* sBuff = self.lpUnpacker.GetRawByIndex(column,&ilength)
|
||||
lpBuff = []
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLength:
|
||||
lpBuff.append(sBuff[iIndex])
|
||||
iIndex +=1
|
||||
return lpBuff,ilength
|
||||
def GetRaw(self,str columnName):
|
||||
sName = bytes(columnName,encoding='utf-8')
|
||||
cdef int ilength = 0
|
||||
cdef char* sBuff = self.lpUnpacker.GetRaw(sName,&ilength)
|
||||
lpBuff = []
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLength:
|
||||
lpBuff.append(sBuff[iIndex])
|
||||
iIndex +=1
|
||||
return lpBuff,ilength
|
||||
def WasNull(self):
|
||||
return self.lpUnpacker.WasNull()
|
||||
def Next(self):
|
||||
self.lpUnpacker.Next()
|
||||
def IsEOF(self):
|
||||
return self.lpUnpacker.IsEOF()
|
||||
def IsEmpty(self):
|
||||
return self.lpUnpacker.IsEmpty()
|
||||
def Destroy(self):
|
||||
self.lpUnpacker.Destroy()
|
||||
def Release(self):
|
||||
if self.lpUnpacker != NULL:
|
||||
self.lpUnpacker.Release()
|
||||
|
||||
cdef class pyCConfigInterface:
|
||||
cdef C_CConfigInterface* lpConfig
|
||||
def __cinit__(self):
|
||||
self.lpConfig = new C_CConfigInterface()
|
||||
def __dealloc__(self):
|
||||
del self.lpConfig
|
||||
def Load(self,str szFileName):
|
||||
sName = bytes(szFileName,encoding='utf-8')
|
||||
return self.lpConfig.Load(sName)
|
||||
def Save(self,str szFileName):
|
||||
sName = bytes(szFileName,encoding='utf-8')
|
||||
return self.lpConfig.Save(sName)
|
||||
def GetString(self,str szSection,str szEntry,str szDefault):
|
||||
sSection = bytes(szSection,encoding='utf-8')
|
||||
sEntry = bytes(szEntry,encoding='utf-8')
|
||||
sDefault = bytes(szDefault,encoding='utf-8')
|
||||
cdef char* sValue = self.lpConfig.GetString(sSection,sEntry,sDefault)
|
||||
return sValue
|
||||
def GetInt(self,str szSection,str szEntry, int iDefault):
|
||||
sSection = bytes(szSection,encoding='utf-8')
|
||||
sEntry = bytes(szEntry,encoding='utf-8')
|
||||
return self.lpConfig.GetInt(sSection,sEntry,iDefault)
|
||||
def SetString(self,str szSection,str szEntry,str szValue):
|
||||
sSection = bytes(szSection,encoding='utf-8')
|
||||
sEntry = bytes(szEntry,encoding='utf-8')
|
||||
sValue = bytes(szValue,encoding='utf-8')
|
||||
return self.lpConfig.SetString(sSection,sEntry,sValue)
|
||||
def SetInt(self,str szSection,str szEntry, int iValue):
|
||||
sSection = bytes(szSection,encoding='utf-8')
|
||||
sEntry = bytes(szEntry,encoding='utf-8')
|
||||
return self.lpConfig.SetInt(sSection,sEntry,iValue)
|
||||
def Release(self):
|
||||
self.lpConfig.Release()
|
||||
|
||||
cdef class pyIBizMessage:
|
||||
cdef c_IBizMessage* lpBizMessage
|
||||
def __cinit__(self):
|
||||
self.lpBizMessage = new c_IBizMessage()
|
||||
def __dealloc__(self):
|
||||
del self.lpBizMessage
|
||||
def SetFunction(self,int nFUnctionNo):
|
||||
self.lpBizMessage.SetFunction(nFUnctionNo)
|
||||
def GetFunction(self):
|
||||
return self.lpBizMessage.GetFunction()
|
||||
def SetPacketType(self,int nPacketType):
|
||||
self.lpBizMessage.SetPacketType(nPacketType)
|
||||
def GetPacketType(self):
|
||||
return self.lpBizMessage.GetPacketType()
|
||||
def SetBranchNo(self,int nBranchNo):
|
||||
self.lpBizMessage.SetBranchNo(nBranchNo)
|
||||
def GetBranchNo(self):
|
||||
return self.lpBizMessage.GetBranchNo()
|
||||
def SetSystemNo(self,int nSystemNo):
|
||||
self.lpBizMessage.SetSystemNo(nSystemNo)
|
||||
def GetSystemNo(self):
|
||||
return self.lpBizMessage.GetSystemNo()
|
||||
def SetSubSystemNo(self,int nSubSystemNo):
|
||||
self.lpBizMessage.SetSubSystemNo(nSubSystemNo)
|
||||
def GetSubSystemNo(self):
|
||||
return self.lpBizMessage.GetSubSystemNo()
|
||||
def SetSenderId(self,int nSenderId):
|
||||
self.lpBizMessage.SetSenderId(nSenderId)
|
||||
def GetSenderId(self):
|
||||
return self.lpBizMessage.GetSenderId()
|
||||
def SetPacketId(self,int nPacketId):
|
||||
self.lpBizMessage.SetPacketId(nPacketId)
|
||||
def GetPacketId(self):
|
||||
return self.lpBizMessage.GetPacketId()
|
||||
def SetErrorNo(self,int nErrorNo):
|
||||
self.lpBizMessage.SetErrorNo(nErrorNo)
|
||||
def GetErrorNo(self):
|
||||
return self.lpBizMessage.GetErrorNo()
|
||||
def SetErrorInfo(self,str strErrorInfo):
|
||||
sErrorInfo = bytes(strErrorInfo,encoding='utf-8')
|
||||
self.lpBizMessage.SetErrorInfo(sErrorInfo)
|
||||
def GetErrorInfo(self):
|
||||
cdef char* sErrInfo = self.lpBizMessage.GetErrorInfo()
|
||||
return sErrInfo
|
||||
def SetReturnCode(self,int nReturnCode):
|
||||
self.lpBizMessage.SetReturnCode(nReturnCode)
|
||||
def GetReturnCode(self):
|
||||
return self.lpBizMessage.GetReturnCode()
|
||||
def SetContent(self,list lpContent,int iLen):
|
||||
cdef char* sBuff = <char*>malloc(iLen)
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
sBuff[iIndex] = lpContent[iIndex]
|
||||
iIndex+=1
|
||||
self.lpBizMessage.SetContent(sBuff,iLen)
|
||||
free(sBuff)
|
||||
def GetContent(self):
|
||||
cdef int iLen = 0
|
||||
cdef char* sBuff = self.lpBizMessage.GetContent(iLen)
|
||||
lpBuff = []
|
||||
cdef iTemp = 0
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
iTemp = sBuff[iIndex]
|
||||
lpBuff.append(iTemp)
|
||||
iIndex +=1
|
||||
return lpBuff,iLen
|
||||
def SetIssueType(self,int nIssueType):
|
||||
self.lpBizMessage.SetIssueType(nIssueType)
|
||||
def GetIssueType(self):
|
||||
return self.lpBizMessage.GetIssueType()
|
||||
def SetSequeceNo(self,int nSequeceNo):
|
||||
self.lpBizMessage.SetSequeceNo(nSequeceNo)
|
||||
def GetSequeceNo(self):
|
||||
return self.lpBizMessage.GetSequeceNo()
|
||||
def SetKeyInfo(self,list lpKeyData,int iLen):
|
||||
cdef char* sBuff = <char*>malloc(iLen)
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
sBuff[iIndex] = lpKeyData[iIndex]
|
||||
iIndex+=1
|
||||
self.lpBizMessage.SetKeyInfo(sBuff,iLen)
|
||||
def GetKeyInfo(self):
|
||||
cdef int iLen = 0
|
||||
cdef int itemp = 0
|
||||
cdef char* sBuff = self.lpBizMessage.GetKeyInfo(iLen)
|
||||
lpBuff = []
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
lpBuff.append(sBuff[iIndex])
|
||||
iIndex +=1
|
||||
return lpBuff,iLen
|
||||
def SetAppData(self,str lpAppdata,int nAppLen):
|
||||
sAppData = bytes(lpAppdata,encoding='utf-8')
|
||||
self.lpBizMessage.SetAppData(sAppData,nAppLen)
|
||||
def GetAppData(self):
|
||||
cdef int iLen = 0
|
||||
cdef char* sAppData = self.lpBizMessage.GetAppData(iLen)
|
||||
return sAppData,iLen
|
||||
def ChangeReq2AnsMessage(self):
|
||||
self.lpBizMessage.ChangeReq2AnsMessage()
|
||||
def GetBuff(self):
|
||||
cdef int iLen = 0
|
||||
cdef iTemp = 0
|
||||
cdef char* sBuff = self.lpBizMessage.GetBuff(iLen)
|
||||
lpBuff = []
|
||||
cdef int iIndex = 0
|
||||
while iIndex < iLen:
|
||||
iTemp = sBuff[iIndex]
|
||||
lpBuff.append(iTemp)
|
||||
iIndex +=1
|
||||
return lpBuff,iLen
|
||||
def SetBuff(self,list lpBuff,int nBuffLen):
|
||||
cdef char* sBuff = <char*>malloc(nBuffLen)
|
||||
cdef int iIndex = 0
|
||||
while iIndex < nBuffLen:
|
||||
sBuff[iIndex] = lpBuff[iIndex]
|
||||
iIndex+=1
|
||||
self.lpBizMessage.SetBuff(sBuff,nBuffLen)
|
||||
def ReSet(self):
|
||||
self.lpBizMessage.ReSet()
|
||||
def Release(self):
|
||||
self.lpBizMessage.Release()
|
||||
|
||||
cdef class pySubscribeParamInterface:
|
||||
cdef c_CSubscribeParamInterface* lpSubscribeParam
|
||||
def __cinit__(self):
|
||||
self.lpSubscribeParam = new c_CSubscribeParamInterface()
|
||||
def __dealloc__(self):
|
||||
del self.lpSubscribeParam
|
||||
def SetTopicName(self,str szName):
|
||||
sName = bytes(szName,encoding='utf-8')
|
||||
self.lpSubscribeParam.SetTopicName(sName)
|
||||
def SetAppData(self,str lpData,int iLen):
|
||||
sData = bytes(lpData,encoding='utf-8')
|
||||
self.lpSubscribeParam.SetAppData(sData,iLen)
|
||||
def SetFilter(self,str filterName,str filterValue):
|
||||
sName = bytes(filterName,encoding='utf-8')
|
||||
sValue = bytes(filterValue,encoding='utf-8')
|
||||
self.lpSubscribeParam.SetFilter(sName,sValue)
|
||||
def SetReturnFiled(self,str filedName):
|
||||
sName = bytes(filedName,encoding='utf-8')
|
||||
self.lpSubscribeParam.SetReturnFiled(sName)
|
||||
def SetFromNow(self,int bFromNow):
|
||||
self.lpSubscribeParam.SetFromNow(bFromNow)
|
||||
def SetReplace(self,int bReplace):
|
||||
self.lpSubscribeParam.SetReplace(bReplace)
|
||||
def SetSendInterval(self,int nSendInterval):
|
||||
self.lpSubscribeParam.SetSendInterval(nSendInterval)
|
||||
def GetTopicName(self):
|
||||
cdef char* sName = self.lpSubscribeParam.GetTopicName()
|
||||
return sName
|
||||
def GetAppData(self):
|
||||
cdef int iLen = 0
|
||||
cdef char* sAppData = self.lpSubscribeParam.GetAppData(&iLen)
|
||||
return sAppData,iLen
|
||||
def GetFilterNameByIndex(self,int index):
|
||||
cdef char* sName = self.lpSubscribeParam.GetFilterNameByIndex(index)
|
||||
return sName
|
||||
def GetFilterValueByIndex(self,int index):
|
||||
cdef char* sName = self.lpSubscribeParam.GetFilterValueByIndex(index)
|
||||
return sName
|
||||
def GetFilterValue(self,str fileName):
|
||||
sName = bytes(fileName,encoding='utf-8')
|
||||
sValus = self.lpSubscribeParam.GetFilterValue(sName)
|
||||
return sValus
|
||||
def GetFilterCount(self):
|
||||
return self.lpSubscribeParam.GetFilterCount()
|
||||
def GetReturnFiled(self):
|
||||
cdef char* sFields = self.lpSubscribeParam.GetReturnFiled()
|
||||
return sFields
|
||||
def GetFromNow(self):
|
||||
cdef int bFromNow = self.lpSubscribeParam.GetFromNow()
|
||||
return bFromNow
|
||||
def GetReplace(self):
|
||||
cdef int bRep = self.lpSubscribeParam.GetReplace()
|
||||
return bRep
|
||||
def GetSendInterval(self):
|
||||
return self.lpSubscribeParam.GetSendInterval()
|
||||
def Release(self):
|
||||
return self.lpSubscribeParam.Release()
|
||||
|
||||
cdef class pySubCallBack:
|
||||
cdef c_SubCallBack* lpSubCallBack
|
||||
def __cinit__(self,str lpMould,str lpClass):
|
||||
sMould = bytes(lpMould,encoding='utf-8')
|
||||
sClass = bytes(lpClass,encoding='utf-8')
|
||||
self.lpSubCallBack = new c_SubCallBack(sMould,sClass)
|
||||
def initInstance(self):
|
||||
return self.lpSubCallBack.initInstance()
|
||||
|
||||
cdef class pySubscribeInterface:
|
||||
cdef c_CSubscribeInterface* lpSubcribe
|
||||
def __cinit__(self):
|
||||
self.lpSubcribe = NULL
|
||||
def __dealloc__(self):
|
||||
if self.lpSubcribe != NULL:
|
||||
del self.lpSubcribe
|
||||
self.lpSubcribe = NULL
|
||||
def SubscribeTopic(self,pySubscribeParamInterface lpSubParam,int uiTimeout,pyIF2UnPacker lpUnPack = None,pyIF2Packer lpPack = None):
|
||||
cdef c_IF2UnPacker** lppBizUnPack = NULL
|
||||
cdef c_IF2Packer* lpBizPack = NULL
|
||||
if lpUnPack != None and lpPack != None:
|
||||
lppBizUnPack = &(lpUnPack.lpUnpacker)
|
||||
lpBizPack = lpPack.lpPacker
|
||||
cdef int ret = self.lpSubcribe.SubscribeTopic(lpSubParam.lpSubscribeParam,uiTimeout,lppBizUnPack,lpBizPack)
|
||||
return ret
|
||||
def CancelSubscribeTopic(self,int subscribeIndex):
|
||||
return self.lpSubcribe.CancelSubscribeTopic(subscribeIndex)
|
||||
def GetSubcribeTopic(self,pyIF2Packer lpPack):
|
||||
return self.lpSubcribe.GetSubcribeTopic(lpPack.lpPacker)
|
||||
def Release(self):
|
||||
return self.lpSubcribe.Release()
|
||||
cdef class pyCallbackInterface:
|
||||
cdef c_CCallbackInterface* lpCallBack
|
||||
def __cinit__(self,str lpMould,str lpClass):
|
||||
sMould = bytes(lpMould,encoding='utf-8')
|
||||
sClass = bytes(lpClass,encoding='utf-8')
|
||||
self.lpCallBack = new c_CCallbackInterface(sMould,sClass)
|
||||
def InitInstance(self):
|
||||
return self.lpCallBack.InitInstance()
|
||||
|
||||
cdef class pyConnectionInterface:
|
||||
cdef c_CConnectionInterface* lpConnect
|
||||
def __cinit__(self,pyCConfigInterface pConfig):
|
||||
self.lpConnect = new c_CConnectionInterface(pConfig.lpConfig)
|
||||
def Connect(self,int uiTimeout):
|
||||
return self.lpConnect.Connect(uiTimeout)
|
||||
def Close(self):
|
||||
return self.lpConnect.Close()
|
||||
def GetServerAddress(self):
|
||||
cdef int iPort = 0
|
||||
cdef char* sAddress = self.lpConnect.GetServerAddress(&iPort)
|
||||
return sAddress,iPort
|
||||
def GetStatus(self):
|
||||
return self.lpConnect.GetStatus()
|
||||
def GetServerLoad(self):
|
||||
return self.lpConnect.GetServerLoad()
|
||||
def GetErrorMsg(self,int nErrorCode):
|
||||
cdef char* sErrMsg = self.lpConnect.GetErrorMsg(nErrorCode)
|
||||
return sErrMsg.decode('GBK')
|
||||
def GetConnectError(self):
|
||||
return self.lpConnect.GetConnectError()
|
||||
def GetRealAddress(self):
|
||||
cdef char* sAddress = self.lpConnect.GetRealAddress()
|
||||
return sAddress
|
||||
def GetSelfAddress(self):
|
||||
cdef char* sAddress = self.lpConnect.GetSelfAddress()
|
||||
return sAddress
|
||||
def GetSelfMac(self):
|
||||
cdef char* sMac = self.lpConnect.GetSelfMac()
|
||||
return sMac
|
||||
def NewSubscriber(self,pySubCallBack lppCallback,str SubScribeName,int iTimeOut):
|
||||
sName = bytes(SubScribeName,encoding='utf-8')
|
||||
cdef c_CSubscribeInterface* lpSub = self.lpConnect.NewSubscriber(lppCallback.lpSubCallBack,sName,iTimeOut)
|
||||
pSub = pySubscribeInterface()
|
||||
pSub.lpSubcribe = lpSub
|
||||
if lpSub == NULL:
|
||||
return -1,pSub
|
||||
else:
|
||||
return 0,pSub
|
||||
def GetMCLastError(self):
|
||||
cdef char* lpMcErr = self.lpConnect.GetMCLastError()
|
||||
return lpMcErr
|
||||
def Create2BizMsg(self,pyCallbackInterface lppCallback):
|
||||
return self.lpConnect.Create2BizMsg(lppCallback.lpCallBack)
|
||||
def SendBizMsg(self,pyIBizMessage lpMsg,int nAsy=0):
|
||||
return self.lpConnect.SendBizMsg(lpMsg.lpBizMessage,nAsy)
|
||||
def RecvBizMsg(self,int hSend, int uiTimeout=1000, int uiFlag=0):
|
||||
lpMsg = pyIBizMessage()
|
||||
ret = self.lpConnect.RecvBizMsg(hSend,lpMsg.lpBizMessage,uiTimeout,uiFlag)
|
||||
return ret,lpMsg
|
||||
def GetLastAnsError(self,int bAsyError=0):
|
||||
return self.lpConnect.GetLastAnsError(bAsyError)
|
||||
|
||||
|
||||
|
22
vnpy/api/t2sdk/py_t2sdk/setup.py
Normal file
22
vnpy/api/t2sdk/py_t2sdk/setup.py
Normal file
@ -0,0 +1,22 @@
|
||||
from distutils.core import setup
|
||||
from distutils.extension import Extension
|
||||
from Cython.Distutils import build_ext # noqa
|
||||
from Cython.Build import cythonize
|
||||
|
||||
setup(
|
||||
name="py_t2sdk",
|
||||
version="1.0.0",
|
||||
author="rdc@hundsun",
|
||||
author_email="",
|
||||
url="",
|
||||
ext_modules=cythonize(Extension(
|
||||
"py_t2sdk",
|
||||
sources=["py_t2sdk.pyx", "ufx_interface.cpp"],
|
||||
language="c++",
|
||||
include_dirs=[],
|
||||
library_dirs=[],
|
||||
libraries=["t2sdk"],
|
||||
extra_compile_args=[],
|
||||
extra_link_args=[]
|
||||
))
|
||||
)
|
BIN
vnpy/api/t2sdk/py_t2sdk/t2sdk.lib
Normal file
BIN
vnpy/api/t2sdk/py_t2sdk/t2sdk.lib
Normal file
Binary file not shown.
1812
vnpy/api/t2sdk/py_t2sdk/t2sdk_interface.h
Normal file
1812
vnpy/api/t2sdk/py_t2sdk/t2sdk_interface.h
Normal file
File diff suppressed because it is too large
Load Diff
1479
vnpy/api/t2sdk/py_t2sdk/ufx_interface.cpp
Normal file
1479
vnpy/api/t2sdk/py_t2sdk/ufx_interface.cpp
Normal file
File diff suppressed because it is too large
Load Diff
388
vnpy/api/t2sdk/py_t2sdk/ufx_interface.h
Normal file
388
vnpy/api/t2sdk/py_t2sdk/ufx_interface.h
Normal file
@ -0,0 +1,388 @@
|
||||
#ifndef _UFX_INTERFACE_H_
|
||||
#define _UFX_INTERFACE_H_
|
||||
#include "t2sdk_interface.h"
|
||||
#include "python.h"
|
||||
#include <thread>
|
||||
#include <Windows.h>
|
||||
#include <queue>
|
||||
#include <process.h>
|
||||
|
||||
|
||||
class c_IF2Packer;
|
||||
class c_IF2UnPacker;
|
||||
|
||||
struct CCallBackParam{
|
||||
int hSend;
|
||||
int iResult;
|
||||
int iCallFuncType; //»Øµ÷·½·¨
|
||||
IF2UnPacker* lpUnPacker;
|
||||
IBizMessage* lpBizMsg;
|
||||
char* sValue;
|
||||
CCallBackParam()
|
||||
{
|
||||
memset(this , 0, sizeof(CCallBackParam));
|
||||
}
|
||||
~CCallBackParam()
|
||||
{
|
||||
if (lpUnPacker)
|
||||
{
|
||||
lpUnPacker->Release();
|
||||
lpUnPacker = NULL;
|
||||
}
|
||||
if (lpBizMsg)
|
||||
{
|
||||
lpBizMsg->Release();
|
||||
lpBizMsg = NULL;
|
||||
}
|
||||
if (sValue)
|
||||
{
|
||||
free(sValue);
|
||||
sValue = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
struct CSubCalBackPara
|
||||
{
|
||||
char szTopicName[256];
|
||||
IBizMessage* lpBizMsg;
|
||||
CSubCalBackPara()
|
||||
{
|
||||
memset(this, 0, sizeof(CSubCalBackPara));
|
||||
}
|
||||
~CSubCalBackPara()
|
||||
{
|
||||
if (lpBizMsg)
|
||||
{
|
||||
lpBizMsg->Release();
|
||||
lpBizMsg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
class c_IF2Packer
|
||||
{
|
||||
private:
|
||||
IF2Packer* lpPacker;
|
||||
public:
|
||||
c_IF2Packer();
|
||||
~c_IF2Packer();
|
||||
void SetBuffer(char* pBuf,int iBufSize,int iDataLen);
|
||||
void BeginPack();
|
||||
int NewDataset(char *szDatasetName, int iReturnCode );
|
||||
int AddField(char *szFieldName,char cFieldType='S',int iFieldWidth=255,int iFieldScale=4);
|
||||
int AddStr(char *szValue);
|
||||
int AddInt(int iValue);
|
||||
int AddDouble(double fValue);
|
||||
int AddChar(char* cValue);
|
||||
int AddRaw(char* lpBuff,int iLen);
|
||||
void EndPack();
|
||||
int* GetPackBuf();
|
||||
int GetPackLen();
|
||||
int GetPackBufSize();
|
||||
int GetVersion();
|
||||
void SetReturnCode(long dwRetCode);
|
||||
c_IF2UnPacker* UnPack();
|
||||
void FreeMem();
|
||||
void ClearValue();
|
||||
void BeginPackEx(char* szName = NULL);
|
||||
void ClearDataSet();
|
||||
IF2Packer* GetInstance();
|
||||
void Release();
|
||||
};
|
||||
|
||||
class c_IF2UnPacker
|
||||
{
|
||||
private:
|
||||
IF2UnPacker* lpUnPacker;
|
||||
void * lpBuf;
|
||||
bool bRelease;
|
||||
public:
|
||||
c_IF2UnPacker(char* lpBuffer,int iLen);
|
||||
c_IF2UnPacker(IF2UnPacker* lpUnPack);
|
||||
~c_IF2UnPacker();
|
||||
int GetVersion(void);
|
||||
int Open(char* lpBuffer,int iLen);
|
||||
int GetDatasetCount();
|
||||
int SetCurrentDatasetByIndex(int nIndex);
|
||||
int SetCurrentDataset(char *szDatasetName);
|
||||
char* GetPackBuf();
|
||||
int GetPackLen();
|
||||
int GetRowCount();
|
||||
void First();
|
||||
void Last();
|
||||
void Go(int nRow);
|
||||
char* GetDatasetName();
|
||||
int OpenAndCopy(char* lpBuffer,int iLen);
|
||||
char* GetColTypeByName(char * columnName);
|
||||
int GetColScaleByName(char * columnName);
|
||||
int GetColWidthByName(char * columnName);
|
||||
IF2UnPacker* GetInstance();
|
||||
int GetColCount();
|
||||
char* GetColName(int column);
|
||||
char* GetColType(int column);
|
||||
int GetColScale(int column);
|
||||
int GetColWidth(int column);
|
||||
int FindColIndex(char * columnName);
|
||||
char* GetStrByIndex(int column);
|
||||
char* GetStr(char * columnName);
|
||||
char* GetCharByIndex(int column);
|
||||
char* GetChar(char * columnName);
|
||||
double GetDoubleByIndex( int column);
|
||||
double GetDouble(char * columnName);
|
||||
int GetIntByIndex(int column);
|
||||
int GetInt(char * columnName);
|
||||
char* GetRawByIndex(int column,int * lpRawLen);
|
||||
char* GetRaw(char * columnName,int * lpRawLen);
|
||||
int WasNull();
|
||||
void Next();
|
||||
int IsEOF();
|
||||
int IsEmpty();
|
||||
void Destroy();
|
||||
void Release();
|
||||
};
|
||||
|
||||
class C_CConfigInterface
|
||||
{
|
||||
private:
|
||||
CConfigInterface* lpConfig;
|
||||
public:
|
||||
C_CConfigInterface();
|
||||
~C_CConfigInterface();
|
||||
int Load( char *szFileName);
|
||||
int Save( char *szFileName);
|
||||
char * GetString( char *szSection, char *szEntry, char *szDefault);
|
||||
int GetInt( char *szSection, char *szEntry, int iDefault);
|
||||
int SetString( char *szSection, char *szEntry, char *szValue);
|
||||
int SetInt( char *szSection, char *szEntry, int iValue);
|
||||
CConfigInterface* GetInstance();
|
||||
void Release();
|
||||
};
|
||||
|
||||
class c_IBizMessage
|
||||
{
|
||||
private:
|
||||
IBizMessage* lpBizMessage;
|
||||
public:
|
||||
c_IBizMessage();
|
||||
~c_IBizMessage();
|
||||
void SetFunction(int nFUnctionNo);
|
||||
int GetFunction();
|
||||
void SetPacketType(int nPacketType);
|
||||
int GetPacketType();
|
||||
void SetBranchNo(int nBranchNo);
|
||||
int GetBranchNo();
|
||||
void SetSystemNo(int nSystemNo);
|
||||
int GetSystemNo();
|
||||
void SetSubSystemNo(int nSubSystemNo);
|
||||
int GetSubSystemNo();
|
||||
void SetSenderId(int nSenderId);
|
||||
int GetSenderId();
|
||||
void SetPacketId(int nPacketId);
|
||||
int GetPacketId();
|
||||
void SetErrorNo(int nErrorNo);
|
||||
int GetErrorNo();
|
||||
void SetErrorInfo(char* strErrorInfo);
|
||||
char* GetErrorInfo();
|
||||
void SetReturnCode(int nReturnCode);
|
||||
int GetReturnCode();
|
||||
void SetContent(char* lpContent,int iLen);
|
||||
char* GetContent(int& iLen);
|
||||
void SetIssueType(int nIssueType);
|
||||
int GetIssueType();
|
||||
void SetSequeceNo(int nSequeceNo);
|
||||
int GetSequeceNo();
|
||||
void SetKeyInfo(char* lpKeyData,int iLen);
|
||||
char* GetKeyInfo(int& iLen);
|
||||
void SetAppData(char* lpAppdata,int nAppLen);
|
||||
char* GetAppData(int& nAppLen);
|
||||
int ChangeReq2AnsMessage();
|
||||
char* GetBuff(int& nBuffLen);
|
||||
int SetBuff(char* lpBuff,int nBuffLen);
|
||||
void ReSet();
|
||||
IBizMessage* GetInstance();
|
||||
void Release();
|
||||
};
|
||||
|
||||
class c_CSubscribeParamInterface
|
||||
{
|
||||
private:
|
||||
CSubscribeParamInterface* lpSubParam;
|
||||
public:
|
||||
c_CSubscribeParamInterface();
|
||||
~c_CSubscribeParamInterface();
|
||||
void SetTopicName(char* szName);
|
||||
void SetAppData(char* lpData,int iLen);
|
||||
void SetFilter(char* filterName,char* filterValue);
|
||||
void SetReturnFiled(char* filedName);
|
||||
void SetFromNow(int bFromNow);
|
||||
void SetReplace(int bReplace);
|
||||
void SetSendInterval(int nSendInterval);
|
||||
char* GetTopicName();
|
||||
char* GetAppData(int *iLen);
|
||||
char* GetFilterNameByIndex(int index);
|
||||
char* GetFilterValueByIndex(int index);
|
||||
char* GetFilterValue(char* fileName);
|
||||
int GetFilterCount();
|
||||
char* GetReturnFiled();
|
||||
int GetFromNow();
|
||||
int GetReplace();
|
||||
int GetSendInterval();
|
||||
CSubscribeParamInterface* GetInstance();
|
||||
void Release();
|
||||
};
|
||||
|
||||
class c_SubCallBack: public CSubCallbackInterface
|
||||
{
|
||||
private:
|
||||
PyObject* pModule;
|
||||
PyObject* pDict;
|
||||
PyObject* pClass;
|
||||
PyObject* pObject;
|
||||
PyObject* pOnReceiveFunc;
|
||||
char lpCallMould[50];
|
||||
char lpCallClass[50];
|
||||
PyGILState_STATE state;
|
||||
HANDLE EventHandle[2];
|
||||
std::thread* Thread;
|
||||
std::queue<CSubCalBackPara*>* DealMsgQueue;
|
||||
CRITICAL_SECTION* gMsgQueueSection;
|
||||
bool IsRun;
|
||||
void operator()() {
|
||||
run();
|
||||
}
|
||||
void run();
|
||||
public:
|
||||
c_SubCallBack(char *lpMould,char *lpClass);
|
||||
c_SubCallBack();
|
||||
~c_SubCallBack();
|
||||
|
||||
int initInstance();
|
||||
unsigned long FUNCTION_CALL_MODE QueryInterface(const char *iid, IKnown **ppv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long FUNCTION_CALL_MODE AddRef()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long FUNCTION_CALL_MODE Release()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void FUNCTION_CALL_MODE OnReceived(CSubscribeInterface *lpSub,int subscribeIndex, const void *lpData, int nLength,LPSUBSCRIBE_RECVDATA lpRecvData);
|
||||
void FUNCTION_CALL_MODE OnRecvTickMsg(CSubscribeInterface *lpSub,int subscribeIndex,const char* TickMsgInfo);
|
||||
};
|
||||
|
||||
class c_CSubscribeInterface
|
||||
{
|
||||
private:
|
||||
CSubscribeInterface* lpSubscribe;
|
||||
public:
|
||||
c_CSubscribeInterface(CSubscribeInterface* lpSub);
|
||||
~c_CSubscribeInterface();
|
||||
int SubscribeTopic(c_CSubscribeParamInterface* lpSubscribeParamInter ,unsigned int uiTimeout,c_IF2UnPacker** lppBizUnPack=NULL,c_IF2Packer* lpBizPack=NULL);
|
||||
int CancelSubscribeTopic(int subscribeIndex);
|
||||
int CancelSubscribeTopicEx(char* topicName,CFilterInterface* lpFilterInterface);
|
||||
void GetSubcribeTopic(c_IF2Packer* lpPack);
|
||||
void Release();
|
||||
};
|
||||
|
||||
class c_CCallbackInterface: public CCallbackInterface
|
||||
{
|
||||
private:
|
||||
PyObject* pModuleT2;
|
||||
PyObject* pT2Class;
|
||||
PyObject* pModule;
|
||||
PyObject* pDict;
|
||||
PyObject* pClass;
|
||||
PyObject* pObject;
|
||||
//PyObject* pConnectFunc;
|
||||
//PyObject* pSafeConnectFunc;
|
||||
PyObject* pRegisterFunc;
|
||||
PyObject* pCloseFunc;
|
||||
//PyObject* pSendFunc;
|
||||
//PyObject* pReceivedBizFunc;
|
||||
//PyObject* pReceivedBizExFunc;
|
||||
PyObject* pReceivedBizMsgFunc;
|
||||
PyGILState_STATE state;
|
||||
char sMouldName[50];
|
||||
char sClassName[50];
|
||||
HANDLE EventHandle[2];
|
||||
std::thread* Thread;
|
||||
std::queue<CCallBackParam*>* DealMsgQueue;
|
||||
CRITICAL_SECTION* gMsgQueueSection;
|
||||
bool IsRun;
|
||||
void operator()() {
|
||||
run();
|
||||
}
|
||||
void run();
|
||||
public:
|
||||
c_CCallbackInterface(char* sMould,char* sClass);
|
||||
c_CCallbackInterface();
|
||||
~c_CCallbackInterface();
|
||||
int InitInstance();
|
||||
unsigned long FUNCTION_CALL_MODE QueryInterface(const char *iid, IKnown **ppv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long FUNCTION_CALL_MODE AddRef()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long FUNCTION_CALL_MODE Release()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void FUNCTION_CALL_MODE OnConnect(CConnectionInterface *lpConnection);
|
||||
void FUNCTION_CALL_MODE OnSafeConnect(CConnectionInterface *lpConnection);
|
||||
void FUNCTION_CALL_MODE OnRegister(CConnectionInterface *lpConnection);
|
||||
void FUNCTION_CALL_MODE OnClose(CConnectionInterface *lpConnection);
|
||||
void FUNCTION_CALL_MODE OnSent(CConnectionInterface *lpConnection, int hSend, void *reserved1, void *reserved2, int nQueuingData);
|
||||
void FUNCTION_CALL_MODE Reserved1(void *a, void *b, void *c, void *d);
|
||||
void FUNCTION_CALL_MODE Reserved2(void *a, void *b, void *c, void *d);
|
||||
int FUNCTION_CALL_MODE Reserved3();
|
||||
void FUNCTION_CALL_MODE Reserved4();
|
||||
void FUNCTION_CALL_MODE Reserved5();
|
||||
void FUNCTION_CALL_MODE Reserved6();
|
||||
void FUNCTION_CALL_MODE Reserved7();
|
||||
void FUNCTION_CALL_MODE OnReceivedBiz(CConnectionInterface *lpConnection, int hSend, const void *lpUnPackerOrStr, int nResult);
|
||||
void FUNCTION_CALL_MODE OnReceivedBizEx(CConnectionInterface *lpConnection, int hSend, LPRET_DATA lpRetData, const void *lpUnpackerOrStr, int nResult);
|
||||
void FUNCTION_CALL_MODE OnReceivedBizMsg(CConnectionInterface *lpConnection, int hSend, IBizMessage* lpMsg);
|
||||
};
|
||||
|
||||
class c_CConnectionInterface
|
||||
{
|
||||
private:
|
||||
CConnectionInterface* lpConnect;
|
||||
public:
|
||||
c_CConnectionInterface(C_CConfigInterface* lpConfig);
|
||||
~c_CConnectionInterface();
|
||||
int Connect(unsigned int uiTimeout);
|
||||
int Close();
|
||||
char * GetServerAddress(int *lpPort);
|
||||
int GetStatus();
|
||||
int GetServerLoad();
|
||||
char * GetErrorMsg(int nErrorCode);
|
||||
int GetConnectError();
|
||||
char* GetRealAddress();
|
||||
char* GetSelfAddress();
|
||||
char* GetSelfMac();
|
||||
c_CSubscribeInterface* NewSubscriber(c_SubCallBack *lpCallback,char* SubScribeName,int iTimeOut,
|
||||
int iInitRecvQLen=INIT_RECVQ_LEN,int iStepRecvQLen=STEP_RECVQ_LEN);
|
||||
c_IF2UnPacker* GetTopic(int byForce,int iTimeOut);
|
||||
char* GetMCLastError();
|
||||
int Create2BizMsg(c_CCallbackInterface *lpCallback);
|
||||
int SendBizMsg(c_IBizMessage* lpMsg,int nAsy = 0);
|
||||
int RecvBizMsg(int hSend, c_IBizMessage* lpMsg, unsigned uiTimeout = 1000, unsigned uiFlag = 0);
|
||||
char * GetLastAnsError(int bAsyError = 0);
|
||||
void Release();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@ import traceback
|
||||
import zlib
|
||||
import json
|
||||
from abc import ABC
|
||||
from copy import copy
|
||||
from copy import copy,deepcopy
|
||||
from typing import Any, Callable, List, Dict
|
||||
from logging import INFO, ERROR
|
||||
from datetime import datetime
|
||||
@ -385,7 +385,6 @@ class StockPolicy(CtaPolicy):
|
||||
last_signal_time = None
|
||||
self.signals.update({k: {'last_signal': last_signal, 'last_signal_time': last_signal_time}})
|
||||
|
||||
|
||||
def to_json(self):
|
||||
"""转换至json文件"""
|
||||
j = super().to_json()
|
||||
@ -394,12 +393,13 @@ class StockPolicy(CtaPolicy):
|
||||
d = {}
|
||||
for kline_name, signal in self.signals.items():
|
||||
last_signal_time = signal.get('last_signal_time', None)
|
||||
d.update({kline_name:
|
||||
{'last_signal': signal.get('last_signal', ''),
|
||||
c_signal = {}
|
||||
c_signal.update(signal)
|
||||
c_signal.update({'last_signal': signal.get('last_signal', ''),
|
||||
'last_signal_time': last_signal_time.strftime(
|
||||
'%Y-%m-%d %H:%M:%S') if last_signal_time is not None else ""
|
||||
}
|
||||
})
|
||||
d.update({kline_name: c_signal})
|
||||
j['signals'] = d
|
||||
return j
|
||||
|
||||
|
@ -1211,7 +1211,8 @@ class CtaEngine(BaseEngine):
|
||||
if module_name:
|
||||
new_class_name = module_name + '.' + class_name
|
||||
self.write_log(u'转换策略为全路径:{}'.format(new_class_name))
|
||||
|
||||
old_strategy_class = self.classes[class_name]
|
||||
self.write_log(f'旧策略ID:{id(old_strategy_class)}')
|
||||
strategy_class = import_module_by_str(new_class_name)
|
||||
if strategy_class is None:
|
||||
err_msg = u'加载策略模块失败:{}'.format(new_class_name)
|
||||
@ -1219,7 +1220,10 @@ class CtaEngine(BaseEngine):
|
||||
return False, err_msg
|
||||
|
||||
self.write_log(f'重新加载模块成功,使用新模块:{new_class_name}')
|
||||
self.write_log(f'新策略ID:{id(strategy_class)}')
|
||||
self.classes[class_name] = strategy_class
|
||||
else:
|
||||
self.write_log(f'没有{class_name}的module_name,无法重新加载模块')
|
||||
|
||||
# 停止当前策略实例的运行,撤单
|
||||
self.stop_strategy(strategy_name)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# 套利模板
|
||||
# 套利模板
|
||||
# 华富资产 @ 李来佳
|
||||
|
||||
import os
|
||||
@ -43,6 +43,8 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
cancel_seconds = 120
|
||||
allow_trading_open = True # 允许开仓
|
||||
force_trading_close = False # 强制平仓
|
||||
history_orders = {}
|
||||
|
||||
|
||||
# 逻辑过程日志
|
||||
dist_fieldnames = ['datetime', 'symbol', 'volume', 'price',
|
||||
@ -386,6 +388,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
def on_stop(self):
|
||||
"""停止策略(必须由用户继承实现)"""
|
||||
self.active_orders.clear()
|
||||
self.history_orders.clear()
|
||||
self.pos = 0
|
||||
self.entrust = 0
|
||||
|
||||
@ -399,8 +402,12 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
trade.__dict__))
|
||||
|
||||
# 找到委托单记录
|
||||
order_info = None
|
||||
if trade.vt_orderid in self.active_orders.keys():
|
||||
order_info = self.active_orders.get(trade.vt_orderid)
|
||||
if order_info:
|
||||
if trade.vt_orderid in self.history_orders.keys():
|
||||
order_info = self.history_orders.get(trade.vt_orderid)
|
||||
if order_info is not None:
|
||||
# 委托单记录 =》 找到 Grid
|
||||
grid = order_info.get('grid')
|
||||
if grid:
|
||||
@ -648,7 +655,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.write_log(f'剩余委托单号:{grid.order_ids}')
|
||||
|
||||
# 在策略得活动订单中,移除
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
self.gt.save()
|
||||
if len(self.active_orders) < 1:
|
||||
self.entrust = 0
|
||||
@ -690,7 +697,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.write_error(msg)
|
||||
|
||||
self.write_log(u'移除:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
return
|
||||
|
||||
order_price = old_order['price']
|
||||
@ -720,7 +727,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.write_log(u'网格信息更新:{}'.format(grid.__dict__))
|
||||
|
||||
self.write_log(u'移除:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
return
|
||||
|
||||
order_retry += 1
|
||||
@ -767,7 +774,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.gt.save()
|
||||
# 删除旧的委托记录
|
||||
self.write_log(u'移除旧的委托记录:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
|
||||
elif old_order['direction'] == Direction.SHORT and order_type == OrderType.FAK:
|
||||
|
||||
@ -810,7 +817,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.gt.save()
|
||||
# 删除旧的委托记录
|
||||
self.write_log(u'移除旧的委托记录:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
else:
|
||||
pre_status = old_order.get('status', Status.NOTTRADED)
|
||||
old_order.update({'status': Status.CANCELLED})
|
||||
@ -855,7 +862,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.write_error(msg)
|
||||
self.send_wechat(msg)
|
||||
self.write_log(u'活动订单移除:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
return
|
||||
|
||||
order_price = old_order['price']
|
||||
@ -877,7 +884,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.write_log(u'更新网格=>{}'.format(grid.__dict__))
|
||||
|
||||
self.write_log(u'移除活动订单:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
return
|
||||
|
||||
order_retry += 1
|
||||
@ -917,7 +924,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
grid.order_ids.remove(order.vt_orderid)
|
||||
self.gt.save()
|
||||
self.write_log(u'移除活动订单:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
|
||||
elif old_order['direction'] == Direction.SHORT and order_type == OrderType.FAK:
|
||||
self.write_log(u'FAK模式,需要重新发送sell委托.grid:{}'.format(grid.__dict__))
|
||||
@ -956,7 +963,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
self.gt.save()
|
||||
|
||||
self.write_log(u'移除活动订单:{}'.format(order.vt_orderid))
|
||||
self.active_orders.pop(order.vt_orderid, None)
|
||||
self.history_orders[order.vt_orderid] = self.active_orders.pop(order.vt_orderid, None)
|
||||
|
||||
else:
|
||||
pre_status = old_order.get('status', Status.NOTTRADED)
|
||||
@ -1110,7 +1117,7 @@ class CtaSpreadTemplate(CtaTemplate):
|
||||
# 删除撤单的订单
|
||||
for vt_orderid in canceled_ids:
|
||||
self.write_log(u'删除orderID:{0}'.format(vt_orderid))
|
||||
self.active_orders.pop(vt_orderid, None)
|
||||
self.history_orders[vt_orderid] = self.active_orders.pop(vt_orderid, None)
|
||||
|
||||
if len(self.active_orders) == 0:
|
||||
self.entrust = 0
|
||||
|
@ -50,7 +50,7 @@ CHAIN_UNDERLYING_MAP = {
|
||||
|
||||
|
||||
class InstrumentData:
|
||||
""""""
|
||||
"""期权合约数据"""
|
||||
|
||||
def __init__(self, contract: ContractData):
|
||||
""""""
|
||||
|
@ -58,7 +58,7 @@ class OptionEngine(BaseEngine):
|
||||
super().__init__(main_engine, event_engine, APP_NAME)
|
||||
|
||||
self.portfolios: Dict[str, PortfolioData] = {}
|
||||
self.instruments: Dict[str, InstrumentData] = {}
|
||||
self.instruments: Dict[str, InstrumentData] = {} # vt_symbol: 合约
|
||||
self.active_portfolios: Dict[str, PortfolioData] = {}
|
||||
|
||||
self.timer_count: int = 0
|
||||
|
@ -1007,8 +1007,8 @@ class CtpTdApi(TdApi):
|
||||
pricetick=data["PriceTick"],
|
||||
gateway_name=self.gateway_name
|
||||
)
|
||||
# 保证金费率
|
||||
contract.margin_rate = max(data.get('LongMarginRatio', 0), data.get('ShortMarginRatio', 0))
|
||||
# 保证金费率(期权合约的保证金比例数值可能不对,所以设置个0.2的最大值)
|
||||
contract.margin_rate = min(0.2,max(data.get('LongMarginRatio', 0), data.get('ShortMarginRatio', 0)))
|
||||
if contract.margin_rate == 0:
|
||||
contract.margin_rate = 0.1
|
||||
|
||||
|
BIN
vnpy/gateway/hsoption/(20130403)ZXZQ-TESTsfjrt-ALL-0001_3rd.dat
Normal file
BIN
vnpy/gateway/hsoption/(20130403)ZXZQ-TESTsfjrt-ALL-0001_3rd.dat
Normal file
Binary file not shown.
1
vnpy/gateway/hsoption/__init__.py
Normal file
1
vnpy/gateway/hsoption/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .hsoption_gateway import HsoptionGateway
|
27
vnpy/gateway/hsoption/citic.ini
Normal file
27
vnpy/gateway/hsoption/citic.ini
Normal file
@ -0,0 +1,27 @@
|
||||
[t2sdk]
|
||||
license_file=(20130403)ZXZQ-TESTsfjrt-ALL-0001_3rd.dat
|
||||
;servers=118.192.134.94:29112
|
||||
;电信请使用这个地址:
|
||||
servers=124.207.9.94:29112
|
||||
login_name=syn_send
|
||||
lang=2052
|
||||
;lang=2052
|
||||
;send_queue_size=100
|
||||
license_pwd=999999
|
||||
init_recv_buf_size=5120
|
||||
init_send_buf_size=5120
|
||||
send_queue_size=1000
|
||||
errormsg=errormsg.ini
|
||||
writedata=1
|
||||
[proxy]
|
||||
proxy_type=
|
||||
ip=127.0.0.1
|
||||
port=
|
||||
user_name=guest
|
||||
password=888888
|
||||
[safe]
|
||||
safe_level=ssl
|
||||
client_id=
|
||||
comm_pwd=
|
||||
cert_file=s2013.pfx
|
||||
cert_pwd=999999
|
1139
vnpy/gateway/hsoption/hsoption_gateway.py
Normal file
1139
vnpy/gateway/hsoption/hsoption_gateway.py
Normal file
File diff suppressed because it is too large
Load Diff
BIN
vnpy/gateway/hsoption/s2013.pfx
Normal file
BIN
vnpy/gateway/hsoption/s2013.pfx
Normal file
Binary file not shown.
@ -282,12 +282,12 @@ class SoptGateway(BaseGateway):
|
||||
self.td_api.close()
|
||||
self.md_api.close()
|
||||
|
||||
def write_error(self, msg: str, error: dict):
|
||||
""""""
|
||||
error_id = error["ErrorID"]
|
||||
error_msg = error["ErrorMsg"]
|
||||
msg = f"{msg},代码:{error_id},信息:{error_msg}"
|
||||
self.write_log(msg)
|
||||
#def write_error(self, msg: str, error: dict):
|
||||
# """"""
|
||||
# error_id = error["ErrorID"]
|
||||
# error_msg = error["ErrorMsg"]
|
||||
# msg = f"{msg},代码:{error_id},信息:{error_msg}"
|
||||
# self.write_log(msg)
|
||||
|
||||
def process_timer_event(self, event):
|
||||
""""""
|
||||
@ -597,7 +597,7 @@ class SoptTdApi(TdApi):
|
||||
)
|
||||
self.gateway.on_order(order)
|
||||
|
||||
self.gateway.write_error("交易委托失败", error)
|
||||
self.gateway.write_error(f"交易委托失败:{symbol} {order.direction.value} {order.offset.value} {order.price}, {order.volume}", error)
|
||||
|
||||
def onRspOrderAction(self, data: dict, error: dict, reqid: int, last: bool):
|
||||
""""""
|
||||
@ -630,6 +630,7 @@ class SoptTdApi(TdApi):
|
||||
position = PositionData(
|
||||
accountid=self.userid,
|
||||
symbol=data["InstrumentID"],
|
||||
name=symbol_name_map[data["InstrumentID"]],
|
||||
exchange=symbol_exchange_map[data["InstrumentID"]],
|
||||
direction=DIRECTION_SOPT2VT[data["PosiDirection"]],
|
||||
gateway_name=self.gateway_name
|
||||
@ -805,7 +806,7 @@ class SoptTdApi(TdApi):
|
||||
|
||||
timestamp = f"{data['InsertDate']} {data['InsertTime']}"
|
||||
dt = datetime.strptime(timestamp, "%Y%m%d %H:%M:%S")
|
||||
dt = CHINA_TZ.localize(dt)
|
||||
#dt = CHINA_TZ.localize(dt)
|
||||
|
||||
order = OrderData(
|
||||
accountid=self.userid,
|
||||
|
@ -57,6 +57,7 @@ class Product(Enum):
|
||||
FOREX = "外汇"
|
||||
SPOT = "现货"
|
||||
ETF = "ETF"
|
||||
LOF = "LOF"
|
||||
BOND = "债券"
|
||||
WARRANT = "权证"
|
||||
SPREAD = "价差"
|
||||
|
@ -413,14 +413,14 @@ def import_module_by_str(import_module_name):
|
||||
mod = import_module(loaded_modules)
|
||||
|
||||
comp = modules[-1]
|
||||
if not hasattr(mod, comp):
|
||||
loaded_modules = '.'.join([loaded_modules, comp])
|
||||
#if not hasattr(mod, comp):
|
||||
# loaded_modules = '.'.join([loaded_modules, comp])
|
||||
print('realod {}'.format(loaded_modules))
|
||||
mod = reload(loaded_modules)
|
||||
else:
|
||||
print('from {} import {}'.format(loaded_modules, comp))
|
||||
mod = getattr(mod, comp)
|
||||
return mod
|
||||
mod = reload(mod)
|
||||
#else:
|
||||
# print('from {} import {}'.format(loaded_modules, comp))
|
||||
comp = getattr(mod, comp)
|
||||
return comp
|
||||
|
||||
except Exception as ex:
|
||||
print('import {} fail,{},{}'.format(import_module_name, str(ex), traceback.format_exc()))
|
||||
|
Loading…
Reference in New Issue
Block a user