diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-04-19 15:17:32 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-04-19 15:17:32 +0200 |
| commit | 45cdd4f2c6b04bfdfd37ef0e1a6358b29680afb8 (patch) | |
| tree | abe54ecca53fa226b4fd354a8b5f5e4224d47b50 /python/configuration.cc | |
| parent | 6472bb377c1effbf2b9a17188e5e057acdf9d195 (diff) | |
| download | python-apt-45cdd4f2c6b04bfdfd37ef0e1a6358b29680afb8.tar.gz | |
* python/*.cc: Export all types and add a __new__() method to them.
Some names may be changed before the release, but this is a good draft.
Diffstat (limited to 'python/configuration.cc')
| -rw-r--r-- | python/configuration.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/python/configuration.cc b/python/configuration.cc index eaac48ec..abbed6d9 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -475,6 +475,13 @@ static PyMethodDef CnfMethods[] = {} }; +static PyObject *CnfNew(PyTypeObject *type, PyObject *args, PyObject *kwds) { + static char *kwlist[] = {}; + if (PyArg_ParseTupleAndKeywords(args,kwds,"",kwlist) == 0) + return 0; + return CppPyObject_NEW<Configuration>(type); +} + // Type for a Normal Configuration object static PySequenceMethods ConfigurationSeq = {0,0,0,0,0,0,0,CnfContains,0,0}; static PyMappingMethods ConfigurationMap = {0,CnfMap,CnfMapSet}; @@ -484,7 +491,7 @@ PyTypeObject ConfigurationType = #if PY_MAJOR_VERSION < 3 0, // ob_size #endif - "Configuration", // tp_name + "apt_pkg.Configuration", // tp_name sizeof(CppPyObject<Configuration>), // tp_basicsize 0, // tp_itemsize // Methods @@ -512,6 +519,16 @@ PyTypeObject ConfigurationType = 0, // tp_iter 0, // tp_iternext CnfMethods, // tp_methods + 0, // tp_members + 0, // tp_getset + 0, // tp_base + 0, // tp_dict + 0, // tp_descr_get + 0, // tp_descr_set + 0, // tp_dictoffset + 0, // tp_init + 0, // tp_alloc + CnfNew, // tp_new }; PyTypeObject ConfigurationPtrType = @@ -520,7 +537,7 @@ PyTypeObject ConfigurationPtrType = #if PY_MAJOR_VERSION < 3 0, // ob_size #endif - "ConfigurationPtr", // tp_name + "apt_pkg.ConfigurationPtr", // tp_name sizeof(CppPyObject<Configuration *>), // tp_basicsize 0, // tp_itemsize // Methods @@ -556,7 +573,7 @@ PyTypeObject ConfigurationSubType = #if PY_MAJOR_VERSION < 3 0, // ob_size #endif - "ConfigurationSub", // tp_name + "apt_pkg.ConfigurationSub", // tp_name sizeof(SubConfiguration), // tp_basicsize 0, // tp_itemsize // Methods |
