summaryrefslogtreecommitdiff
path: root/python/apt_instmodule.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-01-13 17:22:27 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-01-13 17:22:27 +0100
commit38d602dc83006c51dfe4ed594d691ea9b0679498 (patch)
treeb7aedfba82c44cad6c3012f879b5d6d7e8ad1425 /python/apt_instmodule.cc
parent12cf58d12b969010f3d98b2974d72bbb950b775f (diff)
parent614897f798d9f16591fbd29ebe2a6c5674102d2d (diff)
downloadpython-apt-38d602dc83006c51dfe4ed594d691ea9b0679498.tar.gz
* apt/*.py:
- Almost complete cleanup of the code - Remove inconsistent use of tabs and spaces (Closes: #505443) - Improved documentation * apt/debfile.py: - Drop get*() methods, as they are deprecated and were never in a stable release - Make DscSrcPackage working * apt/gtk/widgets.py: - Fix the code and document the signals * Introduce new documentation build with Sphinx - Contains style Guide (Closes: #481562) - debian/rules: Build the documentation here - setup.py: Remove pydoc building and add new docs. - debian/examples: Include examples from documentation - debian/python-apt.docs: + Change html/ to build/doc/html. + Add build/doc/text for the text-only documentation * setup.py: - Only create build/data when building, not all the time - Remove build/mo and build/data on clean -a * debian/control: - Remove the Conflicts on python2.3-apt, python2.4-apt, as they are only needed for oldstable (sarge) - Build-Depend on python-sphinx (>= 0.5) * aptsources/distinfo.py: - Allow @ in mirror urls (Closes: #478171) (LP: #223097) * Merge Ben Finney's whitespace changes (Closes: #481563) * Merge Ben Finney's do not use has_key() (Closes: #481878) * Do not use deprecated form of raise statement (Closes: #494259) * Add support for PkgRecords.SHA256Hash (Closes: #456113)
Diffstat (limited to 'python/apt_instmodule.cc')
-rw-r--r--python/apt_instmodule.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index ea703b21..48868d86 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -5,10 +5,10 @@
apt_intmodule - Top level for the python module. Create the internal
structures for the module in the interpriter.
-
+
Note, this module shares state (particularly global config) with the
apt_pkg module.
-
+
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
@@ -17,7 +17,7 @@
#include <apt-pkg/debfile.h>
#include <apt-pkg/error.h>
-
+
#include <sys/stat.h>
#include <unistd.h>
#include <Python.h>
@@ -37,7 +37,7 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
PyObject *File;
if (PyArg_ParseTuple(Args,"O!|s",&PyFile_Type,&File,&Member) == 0)
return 0;
-
+
// Subscope makes sure any clean up errors are properly handled.
PyObject *Res = 0;
{
@@ -46,13 +46,13 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
debDebFile Deb(Fd);
if (_error->PendingError() == true)
return HandleErrors();
-
+
debDebFile::MemControlExtract Extract(Member);
if (Extract.Read(Deb) == false)
return HandleErrors();
-
+
// Build the return result
-
+
if (Extract.Control == 0)
{
Py_INCREF(Py_None);
@@ -61,7 +61,7 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
else
Res = PyString_FromStringAndSize(Extract.Control,Extract.Length+2);
}
-
+
return HandleErrors(Res);
}
/*}}}*/
@@ -78,11 +78,11 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
PyObject *File;
if (PyArg_ParseTuple(Args,"O!|s",&PyFile_Type,&File,&Rootdir) == 0)
return 0;
-
+
// Subscope makes sure any clean up errors are properly handled.
bool res = false;
{
- if(Rootdir != NULL)
+ if(Rootdir != NULL)
{
getcwd(cwd, sizeof(cwd));
chdir(Rootdir);
@@ -105,7 +105,7 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
chdir (cwd);
if (res == false)
return HandleErrors(Py_BuildValue("b",res));
- }
+ }
return HandleErrors(Py_BuildValue("b",res));
}
/*}}}*/
@@ -120,13 +120,13 @@ static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
PyObject *File;
if (PyArg_ParseTuple(Args,"O!s",&PyFile_Type,&File,&Member) == 0)
return 0;
-
+
// Open the file and associate the .deb
FileFd Fd(fileno(PyFile_AsFile(File)),false);
ARArchive AR(Fd);
if (_error->PendingError() == true)
return HandleErrors(Py_BuildValue("b",res));
-
+
if(AR.FindMember(Member) != 0)
res = true;