Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
py_test_component Namespace Reference

Classes

class  PythonTestComponent

Functions

def MultiplyEachItemInIntegerArray
 def do_nsISupportsIs2(self, iid, interface):

void do_nsISupportsIs2(inout nsIIDRef iid, [iid_is(iid),retval] inout nsQIResult result);

return iid, interface def do_nsISupportsIs3(self, interface):

void do_nsISupportsIs3(out nsIIDRef iid, [iid_is(iid)] inout nsQIResult result);

return self._com_interfaces_, interface def do_nsISupportsIs4(self):

void do_nsISupportsIs4(out nsIIDRef iid, [iid_is(iid)] out nsQIResult result);

return self._com_interfaces_, self
def MultiplyEachItemInIntegerArrayAndAppend
def DoubleStringArray
def ReverseStringArray
def CompareStringArrays
def DoubleString
def DoubleString2
def DoubleString3
def DoubleString4
def UpString
def GetFixedString
def DoubleWideString
def DoubleWideString2
def DoubleWideString3
def DoubleWideString4
def UpWideString
def CopyUTF8String
def CopyUTF8String2
def GetFixedWideString
def GetStrings
def UpOctetArray
def UpOctetArray2
def CheckInterfaceArray
def CopyInterfaceArray
def GetInterfaceArray
def ExtendInterfaceArray
def CheckIIDArray
def GetIIDArray
def ExtendIIDArray
def SumArrays
def GetArrays
def GetFixedArray
def CopyArray
def CopyAndDoubleArray
def AppendArray
def AppendVariant
def CopyVariant
def GetDOMStringResult
def GetDOMStringOut
def GetDOMStringLength
def GetDOMStringRefLength
def GetDOMStringPtrLength
def ConcatDOMStrings
def get_domstring_value
def set_domstring_value
def get_domstring_value_ro

Variables

 UpString2 = UpString
 UpWideString2 = UpWideString
 domstring_value

Function Documentation

def py_test_component.AppendArray (   self,
  array1,
  array2 
)

Definition at line 341 of file py_test_component.py.

00341 
00342     def AppendArray(self, array1, array2):
00343         # void AppendArray(inout PRUint32 count, [array, size_is(count)]in array1, [array, size_is(count)]inout array2);
00344         rc = array1
00345         if array2 is not None:
00346             rc.extend(array2)
        return rc
def py_test_component.AppendVariant (   self,
  invar,
  inresult 
)

Definition at line 348 of file py_test_component.py.

00348 
00349     def AppendVariant(self, invar, inresult):
00350         if type(invar)==type([]):
00351             invar_use = invar[0]
00352             for v in invar[1:]:
00353                 invar_use += v
00354         else:
00355             invar_use = invar
00356         if type(inresult)==type([]):
00357             inresult_use = inresult[0]
00358             for v in inresult[1:]:
00359                 inresult_use += v
00360         else:
00361             inresult_use = inresult
00362         if inresult_use is None and invar_use is None:
00363             return None
00364         return inresult_use + invar_use

def py_test_component.CheckIIDArray (   self,
  data 
)

Definition at line 292 of file py_test_component.py.

00292 
00293     def CheckIIDArray(self, data):
00294         # void CheckIIDArray(in PRUint32 count,
00295         #                          [array, size_is(count)] in nsIIDRef data,
00296         #                          [retval] out PRBool all_mine);
00297         ret = 1
00298         for i in data:
00299             if i!= self._com_interfaces_ and i != self._reg_clsid_:
00300                 ret = 0
00301                 break
        return ret
def py_test_component.CheckInterfaceArray (   self,
  interfaces 
)

Definition at line 270 of file py_test_component.py.

00270 
00271     def CheckInterfaceArray(self, interfaces):
00272         # void CheckInterfaceArray(in PRUint32 count,
00273         #                          [array, size_is(count)] in nsISupports data,
00274         #                          [retval] out PRBool all_non_null);
00275         ret = 1
00276         for i in interfaces:
00277             if i is None:
00278                 ret = 0
00279                 break
        return ret
def py_test_component.CompareStringArrays (   self,
  ar1,
  ar2 
)

Definition at line 194 of file py_test_component.py.

00194 
00195     def CompareStringArrays(self, ar1, ar2):
00196         # void CompareStringArrays([array, size_is(count)] in string arr1,
00197         #              [array, size_is(count)] in string arr2,
00198         #              in unsigned long count,
00199         #             [retval] out short result);
00200         return cmp(ar1, ar2)

def py_test_component.ConcatDOMStrings (   self,
  param0,
  param1 
)

Definition at line 397 of file py_test_component.py.

00397 
00398     def ConcatDOMStrings( self, param0, param1 ):
00399         # Result: void - None
00400         # In: param0: DOMString &
00401         # In: param1: DOMString &
00402         # Out: DOMString &
        return param0 + param1
def py_test_component.CopyAndDoubleArray (   self,
  array 
)

Definition at line 337 of file py_test_component.py.

00337 
00338     def CopyAndDoubleArray(self, array):
00339         # void CopyAndDoubleArray(inout PRUint32 count, [array, size_is(count)]in array1, [array, size_is(count)]out array2);
        return array + array
def py_test_component.CopyArray (   self,
  array1 
)

Definition at line 333 of file py_test_component.py.

00333 
00334     def CopyArray(self, array1):
00335         # void CopyArray(in PRUint32 count, [array, size_is(count)]in array1, [array, size_is(count)]out array2);
        return array1
def py_test_component.CopyInterfaceArray (   self,
  a 
)

Definition at line 280 of file py_test_component.py.

00280 
00281     def CopyInterfaceArray(self, a):
        return a
def py_test_component.CopyUTF8String (   self,
  v 
)

Definition at line 243 of file py_test_component.py.

00243 
00244     def CopyUTF8String(self, v):
        return v
def py_test_component.CopyUTF8String2 (   self,
  v 
)

Definition at line 245 of file py_test_component.py.

00245 
00246     def CopyUTF8String2(self, v):
        return v.encode("utf8")
def py_test_component.CopyVariant (   self,
  invar 
)

Definition at line 365 of file py_test_component.py.

00365 
00366     def CopyVariant(self, invar):
00367         return invar

def py_test_component.DoubleString (   self,
  val 
)

Definition at line 201 of file py_test_component.py.

00201 
00202     def DoubleString(self, val):
00203         # void DoubleString(inout PRUint32 count, 
00204         #               [size_is(count)] inout string str);
        return val * 2
def py_test_component.DoubleString2 (   self,
  val 
)

Definition at line 205 of file py_test_component.py.

00205 
00206     def DoubleString2(self, val):
00207         # void DoubleString2(in PRUint32 in_count, [size_is(in_count)] in string in_str,
00208         #                out PRUint32 out_count, [size_is(out_count)] out string out_str);
        return val * 2
def py_test_component.DoubleString3 (   self,
  val 
)

Definition at line 209 of file py_test_component.py.

00209 
00210     def DoubleString3(self, val):
00211         # void DoubleString3(in PRUint32 in_count, [size_is(in_count)] in string in_str,
00212         #                    out PRUint32 out_count, [size_is(out_count), retval] string out_str);
        return val * 2
def py_test_component.DoubleString4 (   self,
  val 
)

Definition at line 213 of file py_test_component.py.

00213 
00214     def DoubleString4(self, val):
00215         # void DoubleString4([size_is(count)] in string in_str, inout PRUint32 count, [size_is(count)] out string out_str);
        return val * 2
def py_test_component.DoubleStringArray (   self,
  valueArray 
)

Definition at line 179 of file py_test_component.py.

00179 
00180     def DoubleStringArray(self, valueArray):
00181         # void DoubleStringArray(inout PRUint32 count, 
00182         #                       [array, size_is(count)] inout string valueArray);
00183         results = []
00184         for item in valueArray:
00185             results.append(item * 2)
00186         return results

def py_test_component.DoubleWideString (   self,
  val 
)

Definition at line 232 of file py_test_component.py.

00232 
00233     def DoubleWideString(self, val):
        return val * 2
def py_test_component.DoubleWideString2 (   self,
  val 
)

Definition at line 234 of file py_test_component.py.

00234 
00235     def DoubleWideString2(self, val):
        return val * 2
def py_test_component.DoubleWideString3 (   self,
  val 
)

Definition at line 236 of file py_test_component.py.

00236 
00237     def DoubleWideString3(self, val):
        return val * 2
def py_test_component.DoubleWideString4 (   self,
  val 
)

Definition at line 238 of file py_test_component.py.

00238 
00239     def DoubleWideString4(self, val):
        return val * 2
def py_test_component.ExtendIIDArray (   self,
  data 
)

Definition at line 306 of file py_test_component.py.

00306 
00307     def ExtendIIDArray(self, data):
00308         # void ExtendIIDArray(inout PRUint32 count,
00309         #                      [array, size_is(count)] inout nsIIDRef data);
00310         return data * 2

def py_test_component.ExtendInterfaceArray (   self,
  data 
)

Definition at line 286 of file py_test_component.py.

00286 
00287     def ExtendInterfaceArray(self, data):
00288         # void ExtendInterfaceArray(inout PRUint32 count,
00289         #                          [array, size_is(count)] inout nsISupports data);
00290         return data * 2

Definition at line 403 of file py_test_component.py.

00403 
00404     def get_domstring_value( self ):
00405         # Result: DOMString &
        return self.domstring_value

Definition at line 411 of file py_test_component.py.

00411 
00412     def get_domstring_value_ro( self ):
00413         # Result: DOMString &
00414         return self.domstring_value

Definition at line 324 of file py_test_component.py.

00324 
00325     def GetArrays(self):
00326         # void GetArrays(out PRUint32 count, [array, size_is(count)]out array1, [array, size_is(count)]out array2);
        return (1,2,3), (4,5,6)
def py_test_component.GetDOMStringLength (   self,
  param0 
)

Definition at line 379 of file py_test_component.py.

00379 
00380     def GetDOMStringLength( self, param0 ):
00381         # Result: uint32
00382         # In: param0: DOMString &
00383         if param0 is None: return -1
00384         return len(param0)

def py_test_component.GetDOMStringOut (   self,
  length 
)

Definition at line 374 of file py_test_component.py.

00374 
00375     def GetDOMStringOut( self, length ):
00376         # Result: DOMString &
00377         if length == -1:
00378             return None
        return "y" * length
def py_test_component.GetDOMStringPtrLength (   self,
  param0 
)

Definition at line 391 of file py_test_component.py.

00391 
00392     def GetDOMStringPtrLength( self, param0 ):
00393         # Result: uint32
00394         # In: param0: DOMString *
00395         if param0 is None: return -1
00396         return len(param0)

def py_test_component.GetDOMStringRefLength (   self,
  param0 
)

Definition at line 385 of file py_test_component.py.

00385 
00386     def GetDOMStringRefLength( self, param0 ):
00387         # Result: uint32
00388         # In: param0: DOMString &
00389         if param0 is None: return -1
00390         return len(param0)

def py_test_component.GetDOMStringResult (   self,
  length 
)

Definition at line 369 of file py_test_component.py.

00369 
00370     def GetDOMStringResult( self, length ):
00371         # Result: DOMString &
00372         if length == -1:
00373             return None
        return "P" * length
def py_test_component.GetFixedArray (   self,
  size 
)

Definition at line 328 of file py_test_component.py.

00328 
00329     def GetFixedArray(self, size):
00330         # void GetFixedArray(in PRUint32 count, [array, size_is(count)]out PRInt32 array1]);
00331         return 0 * size
    
def py_test_component.GetFixedString (   self,
  count 
)

Definition at line 227 of file py_test_component.py.

00227 
00228     def GetFixedString(self, count):
00229         # void GetFixedString(in PRUint32 count, [size_is(count)out string out_str);
00230         return "A" * count

def py_test_component.GetFixedWideString (   self,
  count 
)

Definition at line 248 of file py_test_component.py.

00248 
00249     def GetFixedWideString(self, count):
00250         # void GetFixedWideString(in PRUint32 count, [size_is(count)out string out_str);
00251         return u"A" * count

Definition at line 302 of file py_test_component.py.

00302 
00303     def GetIIDArray(self):
00304         # void GetIIDArray(out PRUint32 count,
00305         #                         [array, size_is(count)] out nsIIDRef data);
        return self._com_interfaces_, self._reg_clsid_

Definition at line 282 of file py_test_component.py.

00282 
00283     def GetInterfaceArray(self):
00284         # void GetInterfaceArray(out PRUint32 count,
00285         #                          [array, size_is(count)] out nsISupports data);
        return self, self, self, None

Definition at line 252 of file py_test_component.py.

00252 
00253     def GetStrings(self):
00254         # void GetStrings(out PRUint32 count,
00255         #            [retval, array, size_is(count)] out string str);
        return "Hello from the Python test component".split()
def py_test_component.MultiplyEachItemInIntegerArray (   self,
  val,
  valueArray 
)

def do_nsISupportsIs2(self, iid, interface):

void do_nsISupportsIs2(inout nsIIDRef iid, [iid_is(iid),retval] inout nsQIResult result);

return iid, interface def do_nsISupportsIs3(self, interface):

void do_nsISupportsIs3(out nsIIDRef iid, [iid_is(iid)] inout nsQIResult result);

return self._com_interfaces_, interface def do_nsISupportsIs4(self):

void do_nsISupportsIs4(out nsIIDRef iid, [iid_is(iid)] out nsQIResult result);

return self._com_interfaces_, self

Definition at line 160 of file py_test_component.py.

00160 
00161     def MultiplyEachItemInIntegerArray(self, val, valueArray):
00162         # void MultiplyEachItemInIntegerArray(
00163         #                       in PRInt32 val, 
00164         #                       in PRUint32 count, 
00165         #                       [array, size_is(count)] inout PRInt32 valueArray);
00166         # NOTE - the "sizeis" params are never passed to or returned from Python!
00167         results = []
00168         for item in valueArray:
00169             results.append(item * val)
        return results
def py_test_component.MultiplyEachItemInIntegerArrayAndAppend (   self,
  val,
  valueArray 
)

Definition at line 170 of file py_test_component.py.

00170 
00171     def MultiplyEachItemInIntegerArrayAndAppend(self, val, valueArray):
00172         #void MultiplyEachItemInIntegerArrayAndAppend(
00173         #                       in PRInt32 val, 
00174         #                       inout PRUint32 count, 
00175         #                       [array, size_is(count)] inout PRInt32 valueArray);
00176         results = valueArray[:]
00177         for item in valueArray:
00178             results.append(item * val)
        return results
def py_test_component.ReverseStringArray (   self,
  valueArray 
)

Definition at line 187 of file py_test_component.py.

00187 
00188     def ReverseStringArray(self, valueArray):
00189         # void ReverseStringArray(in PRUint32 count, 
00190         #                    [array, size_is(count)] inout string valueArray);
00191         valueArray.reverse()
00192         return valueArray

def py_test_component.set_domstring_value (   self,
  param0 
)

Definition at line 406 of file py_test_component.py.

00406 
00407     def set_domstring_value( self, param0 ):
00408         # Result: void - None
00409         # In: param0: DOMString &
00410         self.domstring_value = param0

def py_test_component.SumArrays (   self,
  array1,
  array2 
)

Definition at line 312 of file py_test_component.py.

00312 
00313     def SumArrays(self, array1, array2):
00314         # void SumArrays(in PRUint32 count, [array, size_is(count)]in array1, [array, size_is(count)]in array2, [retval]result);
00315         if len(array1)!=len(array2):
00316             print "SumArrays - not expecting different lengths!"
00317         result = 0
00318         for i in array1:
00319             result = result + i
00320         for i in array2:
00321             result = result+i
00322         return result

def py_test_component.UpOctetArray (   self,
  data 
)

Definition at line 257 of file py_test_component.py.

00257 
00258     def UpOctetArray( self, data ):
00259         # void UpOctetArray(inout PRUint32 count,
00260         #                [array, size_is(count)] inout PRUint8 data);
00261         return data.upper()

def py_test_component.UpOctetArray2 (   self,
  data 
)

Definition at line 262 of file py_test_component.py.

00262 
00263     def UpOctetArray2( self, data ):
00264         # void UpOctetArray2(inout PRUint32 count,
00265         #                [array, size_is(count)] inout PRUint8 data);
00266         data = data.upper()
00267         # This time we return a list of integers.
00268         return map( ord, data )

def py_test_component.UpString (   self,
  val 
)

Definition at line 216 of file py_test_component.py.

00216 
00217     def UpString(self, val):
00218         # // UpString defines the count as only "in" - meaning the result must be the same size
00219         # void UpString(in PRUint32 count, 
00220         #               [size_is(count)] inout string str);
        return val.upper()
def py_test_component.UpWideString (   self,
  val 
)

Definition at line 240 of file py_test_component.py.

00240 
00241     def UpWideString(self, val):
        return val.upper()

Variable Documentation

Definition at line 409 of file py_test_component.py.

Definition at line 221 of file py_test_component.py.

Definition at line 242 of file py_test_component.py.