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/sourcelist.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/sourcelist.cc')
| -rw-r--r-- | python/sourcelist.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/python/sourcelist.cc b/python/sourcelist.cc index 48b3b7c8..15311e94 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -97,13 +97,21 @@ static PyGetSetDef PkgSourceListGetSet[] = { {} }; +static PyObject *PkgSourceListNew(PyTypeObject *type,PyObject *args,PyObject *kwds) +{ + char *kwlist[] = {0}; + if (PyArg_ParseTupleAndKeywords(args,kwds,"",kwlist) == 0) + return 0; + return CppPyObject_NEW<pkgSourceList*>(type,new pkgSourceList()); +} + PyTypeObject PkgSourceListType = { PyObject_HEAD_INIT(&PyType_Type) #if PY_MAJOR_VERSION < 3 0, // ob_size #endif - "pkgSourceList", // tp_name + "apt_pkg.SourceList", // tp_name sizeof(CppPyObject<pkgSourceList*>), // tp_basicsize 0, // tp_itemsize // Methods @@ -133,6 +141,14 @@ PyTypeObject PkgSourceListType = PkgSourceListMethods, // tp_methods 0, // tp_members PkgSourceListGetSet, // 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 + PkgSourceListNew, // tp_new }; PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args) |
