11 from sys
import version_info
12 if version_info >= (2, 6, 0):
13 def swig_import_helper():
14 from os.path
import dirname
18 fp, pathname, description = imp.find_module(
'_bsNull', [dirname(__file__)])
24 _mod = imp.load_module(
'_bsNull', fp, pathname, description)
28 _bsNull = swig_import_helper()
29 del swig_import_helper
34 _swig_property = property
39 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
40 if (name ==
"thisown"):
41 return self.this.own(value)
43 if type(value).__name__ ==
'SwigPyObject':
44 self.__dict__[name] = value
46 method = class_type.__swig_setmethods__.get(name,
None)
48 return method(self, value)
51 object.__setattr__(self, name, value)
53 self.__dict__[name] = value
55 raise AttributeError(
"You cannot add attributes to %s" % self)
58 def _swig_setattr(self, class_type, name, value):
59 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
62 def _swig_getattr_nondynamic(self, class_type, name, static=1):
63 if (name ==
"thisown"):
64 return self.this.own()
65 method = class_type.__swig_getmethods__.get(name,
None)
69 return object.__getattr__(self, name)
71 raise AttributeError(name)
73 def _swig_getattr(self, class_type, name):
74 return _swig_getattr_nondynamic(self, class_type, name, 0)
79 strthis =
"proxy of " + self.this.__repr__()
82 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
87 except AttributeError:
94 _bsNull.BS_NULL_DEV_NAME_swigconstant(_bsNull)
95 BS_NULL_DEV_NAME = _bsNull.BS_NULL_DEV_NAME
97 _bsNull.BS_NULL_SERVER_MOD_swigconstant(_bsNull)
98 BS_NULL_SERVER_MOD = _bsNull.BS_NULL_SERVER_MOD
100 _bsNull.BS_NULL_CLIENT_LIB_swigconstant(_bsNull)
101 BS_NULL_CLIENT_LIB = _bsNull.BS_NULL_CLIENT_LIB
103 def bsNullGetMsgName(pClient, hndVConn, uMsgId):
104 return _bsNull.bsNullGetMsgName(pClient, hndVConn, uMsgId)
105 bsNullGetMsgName = _bsNull.bsNullGetMsgName
107 def bsNullReqOpen(pClient, bInitTrace):
108 return _bsNull.bsNullReqOpen(pClient, bInitTrace)
109 bsNullReqOpen = _bsNull.bsNullReqOpen
111 def bsNullReqClose(pClient, hndVConn):
112 return _bsNull.bsNullReqClose(pClient, hndVConn)
113 bsNullReqClose = _bsNull.bsNullReqClose
115 def bsNullReqWrite(pClient, hndVConn, wbuf, uWriteLen):
116 return _bsNull.bsNullReqWrite(pClient, hndVConn, wbuf, uWriteLen)
117 bsNullReqWrite = _bsNull.bsNullReqWrite
121 BotSense DevNull Python Inline Extensions and Wrappers. 137 import BotSenseCore
as bsCore
138 import BotSenseError
as bsError
139 import BotSenseTypes
as bsTypes
143 """ Get the DevNull message name. 145 For each (virtual connection, message id) 2-tuple, there can be a known 146 name string (provided the id is valid and an application provides the 150 client - BotSenseTypes.BsClient instance. 151 hndVConn - Virtual connection handle (ignored). 152 msgId - DevNull message id. 155 Returns message name string if it can be determined. 156 Otherwise returns 'unknown'. 158 bsTypes.BsClient.ChkClient(client)
159 return bsNullGetMsgName(client.pClient, hndVConn, msgId)
162 """ Proxy server request to establish a virtual connection to the /dev/null 165 Raises a BotSenseError exception on failure. 168 client - BotSenseTypes.BsClient instance. 169 trace - Initial message tracing enable(true)/disable(false) state. 172 New virtual connection handle. 174 bsTypes.BsClient.ChkClient(client)
175 hndVConn = bsNullReqOpen(client.pClient, trace)
176 bsError.ChkReturnIsNonNeg(hndVConn,
177 "Client %s: DevNull Open request failed." % (client.AttrGetName()))
181 """ Proxy server request to close client's proxied /dev/null device virtual 184 Raises a BotSenseError exception on failure. 187 client - BotSenseTypes.BsClient instance. 188 hndVConn - Virtual connection handle. 190 bsTypes.BsClient.ChkClient(client)
191 rc = bsNullReqClose(client.pClient, hndVConn)
192 bsError.ChkReturnIsOk(rc,
193 "Client %s: DevNull Close request failed." % (client.AttrGetName()))
196 """ DevNull request to write /dev/null. 198 Raises a BotSenseError exception on failure. 201 client - BotSenseTypes.BsClient instance. 202 hndVConn - Virtual connection handle. 206 Number of bytes written. 208 bsTypes.BsClient.ChkClient(client)
209 wbytebuf = bsTypes.ByteBuf.Clone(wbuf)
210 wbytebuf.copyToSwigObj(len(wbytebuf))
211 n = bsNullReqWrite(client.pClient, hndVConn, wbytebuf.getSwigObj(),
213 bsError.ChkReturnIsNonNeg(n,
214 "Client %s: DevNull Write request failed." % (client.AttrGetName()))
def NullReqOpen(client, trace=False)
def NullGetMsgName(client, hndVConn, msgId)
def NullReqWrite(client, hndVConn, wbuf)
def NullReqClose(client, hndVConn)