Lines Matching refs:self

63     def __init__(self, conn):  argument
64 self.conn = conn
65 def __del__(self): argument
66 self.conn.close()
67 def run(self): argument
68 header = self.readI32()
74 nParam = self.readI32()
77 cmdFunction = self.readI32()
80 nameLen = self.readI32()
81 self.functionName = self.readRaw(nameLen)
82 print "Processing function:", self.functionName
86 cmd = self.readI32()
88 dataLen = self.readI32()
89 data = self.readI16Array(dataLen / 2)
97 i64 = self.readI64()
101 val = self.readDouble()
105 self.protocolError("unknown command " + str(cmd))
112 if not self.functionName in builtinFunctions:
113 mod = __import__(self.functionName)
114 output = getattr(mod, self.functionName)(inputData, inputTypes)
116 output = globals()[self.functionName](inputData, inputTypes)
118 self.sendI32(CMD_HEADER)
119 self.sendI32(nOutputParams + 1) # 1 for result
120 self.sendI32(CMD_RESULT)
121 self.sendI32(output[0])
127 self.sendI32(CMD_INT64)
128 self.sendI64(outputData[i])
130 self.sendI32(CMD_DOUBLE)
131 self.sendDouble(outputData[i])
133 self.sendI32(CMD_AUDIO_STEREO)
134 self.sendI32(len(outputData[i]) * 2)
135 self.sendI16Array(outputData[i])
137 self.sendI32(CMD_AUDIO_MONO)
138 self.sendI32(len(outputData[i]) * 2)
139 self.sendI16Array(outputData[i])
142 " returned from funcion ", self.functionName
145 def readRaw(self, length): argument
149 raw = self.conn.recv(length - totalRead)
157 def readI32(self): argument
158 raw = self.readRaw(4)
162 def readI64(self): argument
163 raw = self.readRaw(8)
167 def readDouble(self): argument
168 raw = self.readRaw(8)
172 def readI16Array(self, length): argument
173 raw = self.readRaw(length * 2)
177 def sendI32(self, i32): argument
179 self.sendRaw(raw)
181 def sendI64(self, i64): argument
183 self.sendRaw(raw)
185 def sendDouble(self, val): argument
187 self.sendRaw(raw)
189 def sendI16Array(self, arry): argument
191 self.sendRaw(raw)
193 def sendRaw(self, rawString): argument
197 sent = self.conn.send(rawString[totalSent:])
200 def protocolError(self, message): argument