When new components are registered, re-scan the Python directory for

new .pth files (which may have just been installed).

Add _xpcom.GetSpecialDirectory() to make this work.

Not part of the build.


git-svn-id: svn://10.0.0.236/trunk@145049 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2003-07-22 07:30:55 +00:00
parent f10c26b785
commit 446028483d
2 changed files with 33 additions and 0 deletions

View File

@@ -374,6 +374,19 @@ PyXPCOMMethod_GetProxyForObject(PyObject *self, PyObject *args)
return result;
}
PyObject *PyGetSpecialDirectory(PyObject *self, PyObject *args)
{
char *dirname;
if (!PyArg_ParseTuple(args, "s:GetSpecialDirectory", &dirname))
return NULL;
nsIFile *file = NULL;
nsresult r = NS_GetSpecialDirectory(dirname, &file);
if ( NS_FAILED(r) )
return PyXPCOM_BuildPyException(r);
// returned object swallows our reference.
return Py_nsISupports::PyObjectFromInterface(file, NS_GET_IID(nsIFile), PR_FALSE);
}
PyObject *AllocateBuffer(PyObject *self, PyObject *args)
{
int bufSize;
@@ -419,6 +432,7 @@ static struct PyMethodDef xpcom_methods[]=
{"_GetGatewayCount", PyXPCOMMethod_GetGatewayCount, 1},
{"getProxyForObject", PyXPCOMMethod_GetProxyForObject, 1},
{"GetProxyForObject", PyXPCOMMethod_GetProxyForObject, 1},
{"GetSpecialDirectory", PyGetSpecialDirectory, 1},
{"AllocateBuffer", AllocateBuffer, 1},
{"LogWarning", LogWarning, 1},
{"LogError", LogError, 1},