# Simulator for the pyuipc module #------------------------------------------------------------------------------ import time #------------------------------------------------------------------------------ # Version constants SIM_ANY=0 SIM_FS98=1 SIM_FS2K=2 SIM_CFS2=3 SIM_CFS1=4 SIM_FLY=5 SIM_FS2K2=6 SIM_FS2K4=7 #------------------------------------------------------------------------------ # Error constants ERR_OK=0 ERR_OPEN=1 ERR_NOFS=2 ERR_REGMSG=3 ERR_ATOM=4 ERR_MAP=5 ERR_VIEW=6 ERR_VERSION=7 ERR_WRONGFS=8 ERR_NOTOPEN=9 ERR_NODATA=10 ERR_TIMEOUT=11 ERR_SENDMSG=12 ERR_DATA=13 ERR_RUNNING=14 ERR_SIZE=15 #------------------------------------------------------------------------------ # The version of FSUIPC fsuipc_version=0x0401 lib_version=0x0302 fs_version=SIM_FS2K4 #------------------------------------------------------------------------------ class FSUIPCException(Exception): """FSUIPC exception class. It contains a member variable named errorCode. The string is a text describing the error.""" errors=["OK", "Attempt to Open when already Open", "Cannot link to FSUIPC or WideClient", "Failed to Register common message with Windows", "Failed to create Atom for mapping filename", "Failed to create a file mapping object", "Failed to open a view to the file map", "Incorrect version of FSUIPC, or not FSUIPC", "Sim is not version requested", "Call cannot execute, link not Open", "Call cannot execute: no requests accumulated", "IPC timed out all retries", "IPC sendmessage failed all retries", "IPC request contains bad data", "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC", "Read or Write request cannot be added, memory for Process is full"] def __init__(self, errorCode): """ Construct the exception """ if errorCode