diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-24 20:20:22 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-24 20:20:22 +0200 |
| commit | 1db4f4035b23acf6b2452e57b27c3f44571fc489 (patch) | |
| tree | ecbfd1997129893c6cddf053318488f9cc0236cd /python/apt_pkgmodule.cc | |
| parent | 93b79ada84fb8f27c2f9c124b2ea9ed87864d967 (diff) | |
| download | python-apt-1db4f4035b23acf6b2452e57b27c3f44571fc489.tar.gz | |
python/apt_pkgmodule.cc: Move all constants here.
Now the constants are accessible from the types, and not only from instances.
Diffstat (limited to 'python/apt_pkgmodule.cc')
| -rw-r--r-- | python/apt_pkgmodule.cc | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 0a899efb..9e486a91 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -14,6 +14,7 @@ #include <apt-pkg/configuration.h> #include <apt-pkg/acquire-item.h> +#include <apt-pkg/packagemanager.h> #include <apt-pkg/version.h> #include <apt-pkg/deblistparser.h> #include <apt-pkg/pkgcache.h> @@ -666,9 +667,41 @@ extern "C" void initapt_pkg() CharCharToList(TFRewriteSourceOrder)); - // AcquireItem Constants. + // Acquire constants. + // some constants + PyDict_SetItemString(PyAcquire_Type.tp_dict, "result_cancelled", + Py_BuildValue("i", pkgAcquire::Cancelled)); + PyDict_SetItemString(PyAcquire_Type.tp_dict, "result_continue", + Py_BuildValue("i", pkgAcquire::Continue)); + PyDict_SetItemString(PyAcquire_Type.tp_dict, "result_failed", + Py_BuildValue("i", pkgAcquire::Failed)); +#ifdef COMPAT_0_7 + PyDict_SetItemString(PyAcquire_Type.tp_dict, "ResultCancelled", + Py_BuildValue("i", pkgAcquire::Cancelled)); + PyDict_SetItemString(PyAcquire_Type.tp_dict, "ResultContinue", + Py_BuildValue("i", pkgAcquire::Continue)); + PyDict_SetItemString(PyAcquire_Type.tp_dict, "ResultFailed", + Py_BuildValue("i", pkgAcquire::Failed)); +#endif + // PackageManager constants + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "result_completed", + Py_BuildValue("i", pkgPackageManager::Completed)); + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "result_failed", + Py_BuildValue("i", pkgPackageManager::Failed)); + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "result_incomplete", + Py_BuildValue("i", pkgPackageManager::Incomplete)); +#ifdef COMPAT_0_7 + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "ResultCompleted", + Py_BuildValue("i", pkgPackageManager::Completed)); + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "ResultFailed", + Py_BuildValue("i", pkgPackageManager::Failed)); + PyDict_SetItemString(PyPackageManager_Type.tp_dict, "ResultIncomplete", + Py_BuildValue("i", pkgPackageManager::Incomplete)); +#endif + + // AcquireItem Constants. PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "stat_idle", Py_BuildValue("i", pkgAcquire::Item::StatIdle)); PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "stat_fetching", |
