Bug 106386 Correct misspellings in source code
patch by unknown@simplemachines.org r=timeless rs=brendan git-svn-id: svn://10.0.0.236/trunk@185269 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -54,7 +54,7 @@ Known Limitations:
|
||||
setup a message queue.
|
||||
|
||||
Known Bugs:
|
||||
* Only read ("r") mode is supported. Although write ("w") mode doesnt make
|
||||
* Only read ("r") mode is supported. Although write ("w") mode doesn't make
|
||||
sense for HTTP type URLs, it potentially does for file:// etc type ones.
|
||||
* No concept of text mode vs binary mode. It appears Mozilla takes care of
|
||||
this internally (ie, all "text/???" mime types are text, rest are binary)
|
||||
|
||||
@@ -159,7 +159,7 @@ class DefaultPolicy:
|
||||
if iid in self._nominated_interfaces_:
|
||||
# We return the underlying object re-wrapped
|
||||
# in a new gateway - which is desirable, as one gateway should only support
|
||||
# one interface (this wont affect the users of this policy - we can have as many
|
||||
# one interface (this won't affect the users of this policy - we can have as many
|
||||
# gateways as we like pointing to the same Python objects - the users never
|
||||
# see what object the call came in from.
|
||||
# NOTE: We could have simply returned the instance and let the framework
|
||||
@@ -172,12 +172,12 @@ class DefaultPolicy:
|
||||
return GetClassInfoForObject(self._obj_)
|
||||
|
||||
# See if the instance has a QI
|
||||
# use lower-case "_query_interface_" as win32com does, and it doesnt really matter.
|
||||
# use lower-case "_query_interface_" as win32com does, and it doesn't really matter.
|
||||
delegate = getattr(self._obj_, "_query_interface_", None)
|
||||
if delegate is not None:
|
||||
# The COM object itself doesnt get passed to the child
|
||||
# The COM object itself doesn't get passed to the child
|
||||
# (again, as win32com doesnt). It is rarely needed
|
||||
# (in win32com, we dont even pass it to the policy, although we have identified
|
||||
# (in win32com, we don't even pass it to the policy, although we have identified
|
||||
# one place where we should - for marshalling - so I figured I may as well pass it
|
||||
# to the policy layer here, but no all the way down to the object.
|
||||
return delegate(iid)
|
||||
@@ -191,7 +191,7 @@ class DefaultPolicy:
|
||||
if attr is not None and hasattr(self._obj_, attr):
|
||||
return xpcom.server.WrapObject(SupportsPrimitive(iid, self._obj_, attr, cvt), iid, bWrapClient = 0)
|
||||
# Out of clever things to try!
|
||||
return None # We dont support this IID.
|
||||
return None # We don't support this IID.
|
||||
|
||||
def _MakeInterfaceParam_(self, interface, iid, method_index, mi, param_index):
|
||||
# Wrap a "raw" interface object in a nice object. The result of this
|
||||
|
||||
@@ -144,7 +144,7 @@ PyG_Base::PyG_Base(PyObject *instance, const nsIID &iid)
|
||||
Py_XDECREF(real_repr);
|
||||
}
|
||||
#endif // DEBUG_LIFETIMES
|
||||
Py_XINCREF(instance); // instance should never be NULL - but whats an X between friends!
|
||||
Py_XINCREF(instance); // instance should never be NULL - but what's an X between friends!
|
||||
|
||||
PyXPCOM_DLLAddRef();
|
||||
|
||||
@@ -166,7 +166,7 @@ PyG_Base::~PyG_Base()
|
||||
if (m_pBaseObject)
|
||||
m_pBaseObject->Release();
|
||||
if (m_pWeakRef) {
|
||||
// Need to ensure some other thread isnt doing a QueryReferent on
|
||||
// Need to ensure some other thread isn't doing a QueryReferent on
|
||||
// our weak reference at the same time
|
||||
CEnterLeaveXPCOMFramework _celf;
|
||||
PyXPCOM_GatewayWeakReference *p = (PyXPCOM_GatewayWeakReference *)(nsISupports *)m_pWeakRef;
|
||||
@@ -246,7 +246,7 @@ done:
|
||||
// object in one of the xpcom.client.Interface objects, allowing
|
||||
// natural usage of the interface from Python clients.
|
||||
// Note that piid will usually be NULL - this is because the runtime
|
||||
// reflection interfaces dont provide this information to me.
|
||||
// reflection interfaces don't provide this information to me.
|
||||
// In this case, the Python code may choose to lookup the complete
|
||||
// interface info to obtain the IID.
|
||||
// It is expected (but should not be assumed) that the method info
|
||||
@@ -310,7 +310,7 @@ done:
|
||||
// return our obISupports. If NULL, we are really hosed and nothing we can do.
|
||||
return obISupports;
|
||||
}
|
||||
// Dont need to return this - we have a better result.
|
||||
// Don't need to return this - we have a better result.
|
||||
Py_XDECREF(obISupports);
|
||||
return result;
|
||||
}
|
||||
@@ -570,7 +570,7 @@ nsresult PyG_Base::InvokeNativeViaPolicyInternal(
|
||||
ppResult = &temp;
|
||||
nsresult nr = do_dispatch(m_pPyObject, ppResult, szMethodName, szFormat, va);
|
||||
|
||||
// If temp is NULL, they provided a buffer, and we dont touch it.
|
||||
// If temp is NULL, they provided a buffer, and we don't touch it.
|
||||
// If not NULL, *ppResult = temp, and _we_ do own it.
|
||||
Py_XDECREF(temp);
|
||||
return nr;
|
||||
|
||||
@@ -67,8 +67,8 @@ PyXPCOM_XPTStub::GetInterfaceInfo(nsIInterfaceInfo** info)
|
||||
if (info==nsnull)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
// Simply get the XPCOM runtime to provide this
|
||||
// (but there must be some reason why they dont get it themselves!?
|
||||
// Maybe because they dont know the IID?
|
||||
// (but there must be some reason why they don't get it themselves!?)
|
||||
// Maybe because they don't know the IID?
|
||||
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
|
||||
NS_ABORT_IF_FALSE(iim != nsnull, "Cant get interface from IIM!");
|
||||
if (iim==nsnull)
|
||||
|
||||
@@ -122,7 +122,7 @@ static PyObject *DoPyRead_Size(nsIInputStream *pI, PRUint32 n)
|
||||
return NULL;
|
||||
}
|
||||
if (buf_len != nread) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "New buffer isnt the size we create it!");
|
||||
PyErr_SetString(PyExc_RuntimeError, "New buffer isn't the size we created it!");
|
||||
return NULL;
|
||||
}
|
||||
memcpy(ob_buf, buf, nread);
|
||||
|
||||
@@ -311,7 +311,7 @@ Py_nsISupports::PyObjectFromInterface(nsISupports *pis,
|
||||
// since that means we have a spare reference
|
||||
|
||||
PyTypeObject *createType = NULL;
|
||||
// If the IID is for nsISupports, dont bother with
|
||||
// If the IID is for nsISupports, don't bother with
|
||||
// a map lookup as we know the type!
|
||||
if (!riid.Equals(NS_GET_IID(nsISupports))) {
|
||||
// Look up the map
|
||||
|
||||
@@ -145,7 +145,7 @@ PyXPCOM_TypeObject::Py_repr(PyObject *self)
|
||||
if (iim!=nsnull)
|
||||
iim->GetNameForIID(&pis->m_iid, &iid_repr);
|
||||
if (iid_repr==nsnull)
|
||||
// no IIM available, or it doesnt know the name.
|
||||
// no IIM available, or it doesn't know the name.
|
||||
iid_repr = pis->m_iid.ToString();
|
||||
// XXX - need some sort of buffer overflow.
|
||||
char buf[512];
|
||||
@@ -212,7 +212,7 @@ PyXPCOM_TypeObject::PyXPCOM_TypeObject( const char *name, PyXPCOM_TypeObject *pB
|
||||
baseType = pBase;
|
||||
ctor = thector;
|
||||
|
||||
// cast away const, as Python doesnt use it.
|
||||
// cast away const, as Python doesn't use it.
|
||||
tp_name = (char *)name;
|
||||
tp_basicsize = typeSize;
|
||||
}
|
||||
|
||||
@@ -1348,7 +1348,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::FillInVariant(const PythonTypeDescriptor
|
||||
case nsXPTType::T_INTERFACE_IS: {
|
||||
nsIID iid;
|
||||
nsXPTCVariant &ns_viid = m_var_array[td.argnum];
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isnt an IID!");
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
|
||||
// This is a pretty serious problem, but not Python's fault!
|
||||
// Just return an nsISupports and hope the caller does whatever
|
||||
// QI they need before using it.
|
||||
@@ -1515,7 +1515,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::PrepareOutVariant(const PythonTypeDescrip
|
||||
// we allocate a buffer for the value, but this is NOT cleaned up
|
||||
// via normal VARIANT cleanup rules - hence we clean it up ourselves.
|
||||
// If the param is IN/OUT, then the buffer falls under the normal variant
|
||||
// rules (ie, is flagged as VAL_IS_ALLOCD), so we dont clean it as a temporary.
|
||||
// rules (ie, is flagged as VAL_IS_ALLOCD), so we don't clean it as a temporary.
|
||||
// (it may have been changed under us - we free the _new_ value.
|
||||
// Even if ns_val.p already setup as part of "in" processing,
|
||||
// we need to ensure setup for out.
|
||||
@@ -1526,7 +1526,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::PrepareOutVariant(const PythonTypeDescrip
|
||||
break;
|
||||
case nsXPTType::T_DOMSTRING:
|
||||
case nsXPTType::T_ASTRING: {
|
||||
NS_ABORT_IF_FALSE(ns_v.val.p==nsnull, "T_DOMTSTRINGS cant be out and have a value (ie, no in/outs are allowed!");
|
||||
NS_ABORT_IF_FALSE(ns_v.val.p==nsnull, "T_DOMTSTRINGS can't be out and have a value (ie, no in/outs are allowed!");
|
||||
NS_ABORT_IF_FALSE(XPT_PD_IS_DIPPER(td.param_flags) && XPT_PD_IS_IN(td.param_flags), "out DOMStrings must really be in dippers!");
|
||||
ns_v.flags |= nsXPTCVariant::VAL_IS_DOMSTR;
|
||||
// Dippers are really treated like "in" params.
|
||||
@@ -1540,7 +1540,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::PrepareOutVariant(const PythonTypeDescrip
|
||||
}
|
||||
case nsXPTType::T_CSTRING:
|
||||
case nsXPTType::T_UTF8STRING: {
|
||||
NS_ABORT_IF_FALSE(ns_v.val.p==nsnull, "T_DOMTSTRINGS cant be out and have a value (ie, no in/outs are allowed!");
|
||||
NS_ABORT_IF_FALSE(ns_v.val.p==nsnull, "T_DOMTSTRINGS can't be out and have a value (ie, no in/outs are allowed!");
|
||||
NS_ABORT_IF_FALSE(XPT_PD_IS_DIPPER(td.param_flags) && XPT_PD_IS_IN(td.param_flags), "out DOMStrings must really be in dippers!");
|
||||
ns_v.flags |= ( XPT_TDP_TAG(ns_v.type)==nsXPTType::T_CSTRING ? nsXPTCVariant::VAL_IS_CSTR : nsXPTCVariant::VAL_IS_UTF8STR);
|
||||
ns_v.ptr = new nsCString();
|
||||
@@ -1666,7 +1666,7 @@ PyObject *PyXPCOM_InterfaceVariantHelper::MakeSinglePythonResult(int index)
|
||||
case nsXPTType::T_INTERFACE_IS: {
|
||||
nsIID iid;
|
||||
nsXPTCVariant &ns_viid = m_var_array[td.argnum];
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isnt an IID!");
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
|
||||
if (XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID) {
|
||||
nsIID *piid = (nsIID *)ns_viid.val.p;
|
||||
if (piid==NULL)
|
||||
@@ -1903,7 +1903,7 @@ PRUint32 PyXPCOM_GatewayVariantHelper::GetSizeIs( int var_index, PRBool is_arg1)
|
||||
m_python_type_desc_array[var_index].argnum2;
|
||||
NS_ABORT_IF_FALSE(argnum < m_num_type_descs, "size_is param is invalid");
|
||||
if (argnum >= m_num_type_descs) {
|
||||
PyErr_SetString(PyExc_ValueError, "dont have a valid size_is indicator for this param");
|
||||
PyErr_SetString(PyExc_ValueError, "don't have a valid size_is indicator for this param");
|
||||
return PR_FALSE;
|
||||
}
|
||||
PRBool is_out = XPT_PD_IS_OUT(m_python_type_desc_array[argnum].param_flags);
|
||||
@@ -2019,7 +2019,7 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes
|
||||
nsISupports *iret = DEREF_IN_OR_OUT(ns_v.val.p, nsISupports *);
|
||||
nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+index;
|
||||
nsXPTCMiniVariant &ns_viid = m_params[td.argnum];
|
||||
NS_ABORT_IF_FALSE((m_python_type_desc_array[td.argnum].type_flags & XPT_TDP_TAGMASK) == nsXPTType::T_IID, "The INTERFACE_IS iid describer isnt an IID!");
|
||||
NS_ABORT_IF_FALSE((m_python_type_desc_array[td.argnum].type_flags & XPT_TDP_TAGMASK) == nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!");
|
||||
const nsIID * iid = NULL;
|
||||
if (XPT_PD_IS_IN(m_python_type_desc_array[td.argnum].param_flags))
|
||||
// may still be inout!
|
||||
@@ -2107,7 +2107,7 @@ PRBool PyXPCOM_GatewayVariantHelper::GetIIDForINTERFACE_ID(int index, const nsII
|
||||
// in or out, so we will allow it.
|
||||
nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+index;
|
||||
nsXPTType typ = pi->GetType();
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isnt an IID!");
|
||||
NS_WARN_IF_FALSE(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isn't an IID!");
|
||||
NS_ABORT_IF_FALSE(typ.IsPointer(), "Expecting to re-fill a pointer value.");
|
||||
if (XPT_TDP_TAG(typ) != nsXPTType::T_IID)
|
||||
*ppret = &NS_GET_IID(nsISupports);
|
||||
@@ -2151,7 +2151,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
{
|
||||
nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+index;
|
||||
NS_ABORT_IF_FALSE(pi->IsOut() || pi->IsDipper(), "The value must be marked as [out] (or a dipper) to be back-filled!");
|
||||
NS_ABORT_IF_FALSE(!pi->IsShared(), "Dont know how to back-fill a shared out param");
|
||||
NS_ABORT_IF_FALSE(!pi->IsShared(), "Don't know how to back-fill a shared out param");
|
||||
nsXPTCMiniVariant &ns_v = m_params[index];
|
||||
|
||||
nsXPTType typ = pi->GetType();
|
||||
@@ -2281,7 +2281,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
nsCString *ws = (nsCString *)ns_v.val.p;
|
||||
NS_ABORT_IF_FALSE(ws->Length() == 0, "Why does this writable string already have chars??");
|
||||
if (val == Py_None) {
|
||||
NS_ABORT_IF_FALSE(0, "dont handle None here yet");
|
||||
NS_ABORT_IF_FALSE(0, "don't handle None here yet");
|
||||
} else {
|
||||
if (!PyString_Check(val) && !PyUnicode_Check(val)) {
|
||||
PyErr_SetString(PyExc_TypeError, "This parameter must be a string or Unicode object");
|
||||
@@ -2298,7 +2298,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
nsCString *ws = (nsCString *)ns_v.val.p;
|
||||
NS_ABORT_IF_FALSE(ws->Length() == 0, "Why does this writable string already have chars??");
|
||||
if (val == Py_None) {
|
||||
NS_ABORT_IF_FALSE(0, "dont handle None here yet");
|
||||
NS_ABORT_IF_FALSE(0, "don't handle None here yet");
|
||||
} else {
|
||||
if (PyString_Check(val)) {
|
||||
val_use = val;
|
||||
@@ -2460,7 +2460,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
if (bCanSetSizeIs)
|
||||
rc = SetSizeIs(index, PR_TRUE, nch);
|
||||
else {
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_TRUE) == nch, "Can't set sizeis, but string isnt correct size");
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_TRUE) == nch, "Can't set sizeis, but string isn't correct size");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2509,7 +2509,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
if (bCanSetSizeIs)
|
||||
rc = SetSizeIs(index, PR_TRUE, nch);
|
||||
else {
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_TRUE) == nch, "Can't set sizeis, but string isnt correct size");
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_TRUE) == nch, "Can't set sizeis, but string isn't correct size");
|
||||
}
|
||||
}
|
||||
if (sz)
|
||||
@@ -2567,7 +2567,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
|
||||
if (bCanSetSizeIs)
|
||||
rc = SetSizeIs(index, PR_FALSE, sequence_size);
|
||||
else {
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_FALSE) == sequence_size, "Can't set sizeis, but string isnt correct size");
|
||||
NS_ABORT_IF_FALSE(GetSizeIs(index, PR_FALSE) == sequence_size, "Can't set sizeis, but string isn't correct size");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2593,7 +2593,7 @@ nsresult PyXPCOM_GatewayVariantHelper::ProcessPythonResult(PyObject *ret_ob)
|
||||
NS_PRECONDITION(!PyErr_Occurred(), "Expecting no Python exception to be pending when processing the return result");
|
||||
|
||||
nsresult rc = NS_OK;
|
||||
// If we dont get a tuple back, then the result is only
|
||||
// If we don't get a tuple back, then the result is only
|
||||
// an int nresult for the underlying function.
|
||||
// (ie, the policy is expected to return (NS_OK, user_retval),
|
||||
// but can also return (say), NS_ERROR_FAILURE
|
||||
@@ -2628,7 +2628,7 @@ nsresult PyXPCOM_GatewayVariantHelper::ProcessPythonResult(PyObject *ret_ob)
|
||||
; // do nothing
|
||||
} else if (num_results==1) {
|
||||
// May or may not be the nominated retval - who cares!
|
||||
NS_ABORT_IF_FALSE(last_result >=0 && last_result < m_num_type_descs, "Have one result, but dont know its index!");
|
||||
NS_ABORT_IF_FALSE(last_result >=0 && last_result < m_num_type_descs, "Have one result, but don't know its index!");
|
||||
rc = BackFillVariant( user_result, last_result );
|
||||
} else {
|
||||
// Loop over each one, filling as we go.
|
||||
@@ -2645,7 +2645,7 @@ nsresult PyXPCOM_GatewayVariantHelper::ProcessPythonResult(PyObject *ret_ob)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
int num_user_results = PySequence_Length(user_result);
|
||||
// If they havent given enough, we dont really care.
|
||||
// If they havent given enough, we don't really care.
|
||||
// although a warning is probably appropriate.
|
||||
if (num_user_results != num_results) {
|
||||
const char *method_name = m_info->GetName();
|
||||
@@ -2665,7 +2665,7 @@ nsresult PyXPCOM_GatewayVariantHelper::ProcessPythonResult(PyObject *ret_ob)
|
||||
this_py_index = 1;
|
||||
}
|
||||
for (i=0;NS_SUCCEEDED(rc) && i<m_info->GetParamCount();i++) {
|
||||
// If weve already done it, or dont need to do it!
|
||||
// If we've already done it, or don't need to do it!
|
||||
if (i==index_retval || m_python_type_desc_array[i].is_auto_out)
|
||||
continue;
|
||||
nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+i;
|
||||
|
||||
@@ -365,8 +365,8 @@ PyXPCOMMethod_NS_ShutdownXPCOM(PyObject *self, PyObject *args)
|
||||
nr = NS_ShutdownXPCOM(nsnull);
|
||||
Py_END_ALLOW_THREADS;
|
||||
|
||||
// Dont raise an exception - as we are probably shutting down
|
||||
// and dont really case - just return the status
|
||||
// Don't raise an exception - as we are probably shutting down
|
||||
// and don't really care - just return the status
|
||||
return PyInt_FromLong(nr);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ For more information on compilation see the <a href="http://www.mozilla.org/scri
|
||||
compiler page</a>.
|
||||
|
||||
<p><b>Running the sample</b>
|
||||
<p><b>NOTE: This doesnt work for me - I get an access denied error using XPConnect!</b>
|
||||
<p><b>NOTE: This doesn't work for me - I get an access denied error using XPConnect!</b>
|
||||
<p>Using Mozilla, load this file. Pay attention
|
||||
to the console when clicking "write".
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
// NOTE: This is a TEST interface, not a DEMO interface :-)
|
||||
// We try to get as many data-types etc exposed, meaning this
|
||||
// doesnt really make a good demo of a "simple component"
|
||||
// doesn't really make a good demo of a "simple component"
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
# NOTE: This is a TEST interface, not a DEMO interface :-)
|
||||
# We try to get as many data-types etc exposed, meaning this
|
||||
# doesnt really make a good demo of a "simple component"
|
||||
# doesn't really make a good demo of a "simple component"
|
||||
|
||||
|
||||
from xpcom import components, verbose
|
||||
|
||||
@@ -72,7 +72,7 @@ def test_classes():
|
||||
prog_id = "@mozilla.org/supports-array;1"
|
||||
clsid = xpcom.components.ID("{bda17d50-0d6b-11d3-9331-00104ba0fd40}")
|
||||
|
||||
# Check we can create the instance (dont check we can do anything with it tho!)
|
||||
# Check we can create the instance (don't check we can do anything with it tho!)
|
||||
klass = xpcom.components.classes[prog_id]
|
||||
instance = klass.createInstance()
|
||||
|
||||
@@ -106,7 +106,7 @@ def test_id():
|
||||
print "The ID function appeared to work!"
|
||||
|
||||
|
||||
# regrtest doesnt like if __name__=='__main__' blocks - it fails when running as a test!
|
||||
# regrtest doesn't like if __name__=='__main__' blocks - it fails when running as a test!
|
||||
test_interfaces()
|
||||
test_classes()
|
||||
test_id()
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
# Test our support for the interfaces defined in nsISupportsPrimitives.idl
|
||||
#
|
||||
# The framework supports nsISupportsCString and nsISupportsString, but
|
||||
# only if our class doesnt provide explicit support.
|
||||
# only if our class doesn't provide explicit support.
|
||||
|
||||
from xpcom import components
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ if (c.boolean_value != false)
|
||||
throw("boolean_value has wrong new value");
|
||||
|
||||
// Python's own test does thorough testing of all numeric types
|
||||
// Wont bother from here!
|
||||
// Won't bother from here!
|
||||
|
||||
if (c.char_value != 'a')
|
||||
throw("char_value has wrong initial value");
|
||||
|
||||
@@ -441,7 +441,7 @@ def do_test_failures():
|
||||
try:
|
||||
ret = c.do_nsISupportsIs( xpcom._xpcom.IID_nsIInterfaceInfoManager )
|
||||
print "*** got", ret, "***"
|
||||
raise RuntimeError, "We worked when using an IID we dont support!?!"
|
||||
raise RuntimeError, "We worked when using an IID we don't support!?!"
|
||||
except xpcom.Exception, details:
|
||||
if details.errno != xpcom.nsError.NS_ERROR_NO_INTERFACE:
|
||||
raise RuntimeError, "Wrong COM exception type: %r" % (details,)
|
||||
@@ -554,7 +554,7 @@ def doit(num_loops = -1):
|
||||
else:
|
||||
print "The Python test component worked!"
|
||||
|
||||
# regrtest doesnt like if __name__=='__main__' blocks - it fails when running as a test!
|
||||
# regrtest doesn't like if __name__=='__main__' blocks - it fails when running as a test!
|
||||
num_iters = -1
|
||||
if __name__=='__main__' and len(sys.argv) > 1:
|
||||
num_iters = int(sys.argv[1])
|
||||
|
||||
@@ -402,7 +402,7 @@ class TypeDescriber:
|
||||
if self.tag == T_ARRAY:
|
||||
# NOTE - Adding a type specifier to the array is different from xpt_dump.exe
|
||||
if self.param is None or self.param.interface_info is None:
|
||||
type_desc = "" # Dont have explicit info about the array type :-(
|
||||
type_desc = "" # Don't have explicit info about the array type :-(
|
||||
else:
|
||||
i_info = self.param.interface_info
|
||||
type_code = i_info.GetTypeForParam(self.param.method_index, self.param.param_index, 1)
|
||||
@@ -410,7 +410,7 @@ class TypeDescriber:
|
||||
return self.GetName() + "[" + type_desc + "]"
|
||||
elif self.tag == T_INTERFACE:
|
||||
if self.param is None or self.param.interface_info is None:
|
||||
return "nsISomething" # Dont have explicit info about the IID :-(
|
||||
return "nsISomething" # Don't have explicit info about the IID :-(
|
||||
i_info = self.param.interface_info
|
||||
m_index = self.param.method_index
|
||||
p_index = self.param.param_index
|
||||
|
||||
Reference in New Issue
Block a user