From b147f1846cd26ab25ad925105f52421992395918 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Fri, 16 May 2008 14:58:00 +1000 Subject: Remove trailing whitespace. --- debian/changelog | 54 +++++++++++++++++++++++++++--------------------------- debian/control | 6 +++--- debian/copyright | 6 +++--- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 0c7a782c..c81885f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,7 +21,7 @@ python-apt (0.7.4) unstable; urgency=low * apt/debfile.py: - added wrapper around apt_inst.debExtract() - - support dictionary like access + - support dictionary like access * apt/package.py: - fix apt.package.Dependency.relation initialization * python/apt_instmodule.cc: @@ -40,7 +40,7 @@ python-apt (0.7.4) unstable; urgency=low * python/depcache.cc: - be more threading friendly * python/tag.cc - - support "None" as default in + - support "None" as default in ParseSection(control).get(field, default), LP: #44470 * python/progress.cc: - fix refcount problem in OpProgress @@ -72,7 +72,7 @@ python-apt (0.7.3) unstable; urgency=low * doc/examples/records.py: - added example how to use the new Records class * apt/cache.py: - - throw FetchCancelleException, FetchFailedException, + - throw FetchCancelleException, FetchFailedException, LockFailedException exceptions when something goes wrong * aptsources/distro.py: - generalized some code, bringing it into the Distribution @@ -91,7 +91,7 @@ python-apt (0.7.2) unstable; urgency=low * build against the new apt * support for new "aptsources" pythn module - (thanks to Sebastian Heinlein) + (thanks to Sebastian Heinlein) * merged support for translated package descriptions * merged support for automatic removal of unused dependencies @@ -126,7 +126,7 @@ python-apt (0.6.21) unstable; urgency=low - better cdrom handling support * apt/package.py: - added candidateDependencies, installedDependencies - - SizeToString supports PyLong too + - SizeToString supports PyLong too - support pkg.architecture - support candidateRecord, installedRecord * apt/cache.py: @@ -156,7 +156,7 @@ python-apt (0.6.20) unstable; urgency=low - use select() when checking for statusfd (lp: #53282) * acknoledge NMU (closes: #378048, #373512) * python/apt_pkgmodule.cc: - - fix missing docstring (closes: #368907), + - fix missing docstring (closes: #368907), Thanks to Josh Triplett * make it build against python2.5 * python/progress.cc: @@ -208,40 +208,40 @@ python-apt (0.6.18) unstable; urgency=low python-apt (0.6.17) unstable; urgency=low - * apt/progress.py: + * apt/progress.py: - initialize FetchProgress.eta with the correct type - strip the staus str before passing it to InstallProgress.statusChanged() - - added InstallProgress.statusChange(pkg, percent, status) - - make DumbInstallProgress a new-style class + - added InstallProgress.statusChange(pkg, percent, status) + - make DumbInstallProgress a new-style class (thanks to kamion for the suggestions) - fix various pychecker warnings * apt/cache.py: - return useful values on Cache.update() - Release locks on failure (thanks to Colin Watson) - fix various pychecker warnings - * apt/package.py: + * apt/package.py: - fix various pychecker warnings - check if looupRecords succeeded - fix bug in the return statement of _downloadable() * python/srcrecords.cc: - add "Restart" method - - don't run auto "Restart" before performing a Lookup + - don't run auto "Restart" before performing a Lookup - fix the initalization (no need to pass a PkgCacheType to the records) - added "Index" attribute * python/indexfile.cc: - added ArchiveURI() method - + -- Michael Vogt Mon, 8 May 2006 22:34:58 +0200 python-apt (0.6.16.2) unstable; urgency=low - + * Non-maintainer upload. * debian/control: + Replaces: python-apt (<< 0.6.11), instead of Conflicts which is not correct here. (closes: #308586). -- Pierre Habouzit Fri, 14 Apr 2006 19:30:51 +0200 - + python-apt (0.6.16.1) unstable; urgency=low * memleak fixed when pkgCache objects are deallocated @@ -254,11 +254,11 @@ python-apt (0.6.16.1) unstable; urgency=low python-apt (0.6.16) unstable; urgency=low - * added GetPkgAcqFile to queue individual file downloads with the + * added GetPkgAcqFile to queue individual file downloads with the system (dosn't make use of the improved pkgAcqFile yet) * added SourceList.GetIndexes() * rewrote apt.cache.update() to use the improved aquire interface - * apt/ API change: apt.Package.candidateOrigin returns a list of origins + * apt/ API change: apt.Package.candidateOrigin returns a list of origins now instead of a single one * apt_pkg.Cdrom.Add() returns a boolean now, CdromProgress has totalSteps * added support for pkgIndexFile and added SourcesList.FindIndex() @@ -285,8 +285,8 @@ python-apt (0.6.14) unstable; urgency=low (this is the job of the caller now) * python/srcrecords.cc: - support for "srcrecords.Files" added - - always run "Restart" before performing a Lookup - * export locking via: GetLock(),PkgSystem{Lock,UnLock} + - always run "Restart" before performing a Lookup + * export locking via: GetLock(),PkgSystem{Lock,UnLock} * apt/cache.py: - added __iter__ to make "for pkg in apt.Cache:" stuff possible @@ -304,9 +304,9 @@ python-apt (0.6.13) unstable; urgency=low * native apt/ python directory added that contains a more pythonic interface to apt_pkg * made the apt/ python code PEP08 conform - * python exceptions return the apt error message now + * python exceptions return the apt error message now (thanks to Chris Halls for the patch) - + -- Michael Vogt Fri, 5 Aug 2005 10:30:31 +0200 python-apt (0.6.12.2) unstable; urgency=low @@ -319,7 +319,7 @@ python-apt (0.6.12.1) unstable; urgency=low * rebuild against the latest apt - -- Michael Vogt Tue, 28 Jun 2005 18:29:57 +0200 + -- Michael Vogt Tue, 28 Jun 2005 18:29:57 +0200 python-apt (0.6.12ubuntu1) breezy; urgency=low @@ -331,17 +331,17 @@ python-apt (0.6.12ubuntu1) breezy; urgency=low -- Michael Vogt Thu, 12 May 2005 11:34:05 +0200 python-apt (0.6.12) breezy; urgency=low - + * added a tests/ directory * added tests/pkgsrcrecords.py that will check if the pkgsrcrecords interface does not segfault * new native python "apt" interface that hides the details of apt_pkg -- Michael Vogt Fri, 6 May 2005 10:11:52 +0200 - + python-apt (0.6.11) experimental; urgency=low - * fixed some reference count problems in the depcache and + * fixed some reference count problems in the depcache and pkgsrcrecords code * DepCache.Init() is never called implicit now * merged with python-apt tree from Greek0@gmx.net--2005-main @@ -417,7 +417,7 @@ python-apt (0.5.8) unstable; urgency=low python-apt (0.5.5.2) unstable; urgency=low - * Add myself to Uploaders so that bugs don't get tagged as NMU-fixed anymore + * Add myself to Uploaders so that bugs don't get tagged as NMU-fixed anymore * Initial support for working with source packages (Closes: #199716) -- Matt Zimmerman Tue, 22 Jul 2003 22:20:00 -0400 @@ -427,7 +427,7 @@ python-apt (0.5.5.1) unstable; urgency=low * DepIterator::GlobOr increments the iterator; don't increment it again. This caused every other dependency to be skipped (Closes: #195805) * Avoid a null pointer dereference when calling keys() on an empty - configuration (Closes: #149380) + configuration (Closes: #149380) -- Matt Zimmerman Mon, 2 Jun 2003 23:18:53 -0400 @@ -457,7 +457,7 @@ python-apt (0.5.4.4) unstable; urgency=low Closes: #157773 -- Matt Zimmerman Tue, 27 Aug 2002 19:22:10 -0400 - + python-apt (0.5.4.3) unstable; urgency=low * #include in python/generic.h so that we can build on ia64, which diff --git a/debian/control b/debian/control index 51bb064b..a1d9b807 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,7 @@ Provides: ${python:Provides} Suggests: python-apt-dbg XB-Python-Version: ${python:Versions} Description: Python interface to libapt-pkg - The apt_pkg Python interface will provide full access to the internal + The apt_pkg Python interface will provide full access to the internal libapt-pkg structures allowing Python programs to easily perform a variety of functions, such as: . @@ -27,7 +27,7 @@ Description: Python interface to libapt-pkg - Parsing of Debian package control files, and other files with a similar structure . - The included 'aptsources' Python interface provides an abstraction of + The included 'aptsources' Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. Package: python-apt-dbg @@ -35,7 +35,7 @@ Priority: extra Architecture: any Depends: python-dbg, python-apt (= ${Source-Version}), ${shlibs:Depends} Description: Python interface to libapt-pkg (debug extension) - The apt_pkg Python interface will provide full access to the internal + The apt_pkg Python interface will provide full access to the internal libapt-pkg structures allowing Python programs to easily perform a variety of functions. . diff --git a/debian/copyright b/debian/copyright index 1e310354..f8463185 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ -APT is free software; you can redistribute them and/or modify them under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 2 of the License, or (at your option) any later +APT is free software; you can redistribute them and/or modify them under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems, a copy of the GNU General Public License can be -- cgit v1.2.3 From fa9eee96831b3bb8964646e1b0415a059a498bd4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Jan 2009 16:34:20 +0100 Subject: fix bug in candidateInstalledSize property --- apt/package.py | 4 ++++ debian/changelog | 1 + 2 files changed, 5 insertions(+) (limited to 'debian') diff --git a/apt/package.py b/apt/package.py index 70ddbb1a..6af14b1f 100644 --- a/apt/package.py +++ b/apt/package.py @@ -384,6 +384,10 @@ class Package(object): def candidateInstalledSize(self, UseCandidate=True): """ The size of the candidate installed package """ ver = self._depcache.GetCandidateVer(self._pkg) + if ver: + return ver.Size + else: + return None candidateInstalledSize = property(candidateInstalledSize) def installedSize(self): diff --git a/debian/changelog b/debian/changelog index 160fe7c8..8b6780f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ python-apt (0.7.9) UNRELEASED; urgency=low - better description parsing - new method "installedFiles()" - new method "getChangelog()" + - fix bug in candidateInstalledSize property * apt/gtk/widgets.py: - new gobject GOpProgress - new gobject GFetchProgress -- cgit v1.2.3 From c906abf5f25479483041636813117c48556f389b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Jan 2009 16:48:09 +0100 Subject: * aptsources/distinfo.py: - fix too restrictive mirror url check * aptsources/distro.py: - only add nearest_server and server to the mirrors if they are defined --- aptsources/distinfo.py | 2 +- aptsources/distro.py | 25 ++++++++++++++----------- debian/changelog | 5 +++++ 3 files changed, 20 insertions(+), 12 deletions(-) (limited to 'debian') diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index a6c0faf8..f4e804b2 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -132,7 +132,7 @@ class DistInfo: location = None match_loc = re.compile(r"^#LOC:(.+)$") - match_mirror_line = re.compile(r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://[A-Za-z/\.:\-_]+)$") + match_mirror_line = re.compile(r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://[A-Za-z0-9/\.:\-_]+)$") #match_mirror_line = re.compile(r".+") if not dist: diff --git a/aptsources/distro.py b/aptsources/distro.py index f271bbc4..0a094aed 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -211,31 +211,34 @@ class Distribution: (len(self.used_servers) == 1 and \ compare_mirrors(self.used_servers[0], self.main_server)): mirrors.append([_("Main server"), self.main_server, True]) - mirrors.append([self._get_mirror_name(self.nearest_server), - self.nearest_server, False]) + if self.nearest_server: + mirrors.append([self._get_mirror_name(self.nearest_server), + self.nearest_server, False]) elif len(self.used_servers) == 1 and not \ compare_mirrors(self.used_servers[0], self.main_server): mirrors.append([_("Main server"), self.main_server, False]) # Only one server is used server = self.used_servers[0] - # Append the nearest server if it's not already used - if not compare_mirrors(server, self.nearest_server): - mirrors.append([self._get_mirror_name(self.nearest_server), - self.nearest_server, False]) - mirrors.append([self._get_mirror_name(server), server, True]) + if self.nearest_server: + if not compare_mirrors(server, self.nearest_server): + mirrors.append([self._get_mirror_name(self.nearest_server), + self.nearest_server, False]) + if server: + mirrors.append([self._get_mirror_name(server), server, True]) elif len(self.used_servers) > 1: # More than one server is used. Since we don't handle this case # in the user interface we set "custom servers" to true and # append a list of all used servers mirrors.append([_("Main server"), self.main_server, False]) - mirrors.append([self._get_mirror_name(self.nearest_server), - self.nearest_server, False]) + if self.nearest_server: + mirrors.append([self._get_mirror_name(self.nearest_server), + self.nearest_server, False]) mirrors.append([_("Custom servers"), None, True]) for server in self.used_servers: - if compare_mirrors(server, self.nearest_server) or\ - compare_mirrors(server, self.main_server): + if (compare_mirrors(server, self.nearest_server) or + compare_mirrors(server, self.main_server)): continue elif not [self._get_mirror_name(server), server, False] in mirrors: mirrors.append([self._get_mirror_name(server), server, False]) diff --git a/debian/changelog b/debian/changelog index 8b6780f5..042785d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,11 @@ python-apt (0.7.9) UNRELEASED; urgency=low * setup.py: - build html/ help of the apt and aptsources modules into /usr/share/doc/python-apt/html + * aptsources/distinfo.py: + - fix too restrictive mirror url check + * aptsources/distro.py: + - only add nearest_server and server to the mirrors if + they are defined -- Michael Vogt Mon, 24 Nov 2008 14:30:32 +0100 -- cgit v1.2.3 From 6a806f0570599e8f5e9438c9623d496df75571d4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 9 Jan 2009 21:52:07 +0100 Subject: * Introduce the new documentation and add 0.7.9~exp2 to changelog. The new documentation is built using sphinx (>= 0.5) [other versions may work too, but let's be safe]. --- debian/changelog | 26 ++++ debian/control | 4 +- debian/examples | 1 + debian/python-apt.docs | 2 +- doc/Makefile | 75 +++++++++++ doc/makefile | 13 -- doc/source/apt/cache.rst | 70 ++++++++++ doc/source/apt/cdrom.rst | 7 + doc/source/apt/debfile.rst | 37 ++++++ doc/source/apt/gtk.widgets.rst | 29 +++++ doc/source/apt/index.rst | 58 +++++++++ doc/source/apt/package.rst | 101 ++++++++++++++ doc/source/apt/progress.rst | 37 ++++++ doc/source/apt_inst.rst | 100 ++++++++++++++ doc/source/apt_pkg/cache.rst | 95 ++++++++++++++ doc/source/apt_pkg/index.rst | 239 ++++++++++++++++++++++++++++++++++ doc/source/aptsources/distinfo.rst | 10 ++ doc/source/aptsources/distro.rst | 10 ++ doc/source/aptsources/index.rst | 10 ++ doc/source/aptsources/sourceslist.rst | 10 ++ doc/source/coding.rst | 149 +++++++++++++++++++++ doc/source/conf.py | 192 +++++++++++++++++++++++++++ doc/source/examples/apt-gtk.py | 29 +++++ doc/source/examples/dpkg-contents.py | 55 ++++++++ doc/source/examples/dpkg-extract.py | 25 ++++ doc/source/examples/dpkg-info.py | 20 +++ doc/source/index.rst | 38 ++++++ po/python-apt.pot | 12 +- setup.py | 51 ++++---- 29 files changed, 1453 insertions(+), 52 deletions(-) create mode 100644 doc/Makefile delete mode 100644 doc/makefile create mode 100644 doc/source/apt/cache.rst create mode 100644 doc/source/apt/cdrom.rst create mode 100644 doc/source/apt/debfile.rst create mode 100644 doc/source/apt/gtk.widgets.rst create mode 100644 doc/source/apt/index.rst create mode 100644 doc/source/apt/package.rst create mode 100644 doc/source/apt/progress.rst create mode 100644 doc/source/apt_inst.rst create mode 100644 doc/source/apt_pkg/cache.rst create mode 100644 doc/source/apt_pkg/index.rst create mode 100644 doc/source/aptsources/distinfo.rst create mode 100644 doc/source/aptsources/distro.rst create mode 100644 doc/source/aptsources/index.rst create mode 100644 doc/source/aptsources/sourceslist.rst create mode 100644 doc/source/coding.rst create mode 100644 doc/source/conf.py create mode 100644 doc/source/examples/apt-gtk.py create mode 100644 doc/source/examples/dpkg-contents.py create mode 100644 doc/source/examples/dpkg-extract.py create mode 100644 doc/source/examples/dpkg-info.py create mode 100644 doc/source/index.rst (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a80a9b64..1002bead 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +python-apt (0.7.9~exp2) experimental; urgency=low + + * apt/*.py: + - Almost complete cleanup of the code + - 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 + - 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 doc/build/html. + * 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) + + -- Julian Andres Klode Fri, 09 Jan 2009 17:20:41 +0100 + python-apt (0.7.9~exp1) experimental; urgency=low * Merged python-apt consolidation branch by Sebastian diff --git a/debian/control b/debian/control index b738231f..8a10091d 100644 --- a/debian/control +++ b/debian/control @@ -5,15 +5,13 @@ Maintainer: APT Development Team Uploaders: Matt Zimmerman , Michael Vogt Standards-Version: 3.7.2.2 XS-Python-Version: all -Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.7.10), apt-utils, python-all-dev, python-distutils-extra (>= 1.9.0), cdbs, python-central (>= 0.5), python-all-dbg +Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.7.10), apt-utils, python-all-dev, python-distutils-extra (>= 1.9.0), cdbs, python-central (>= 0.5), python-all-dbg, python-sphinx (>= 0.5) Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-sid Package: python-apt Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release Priority: optional -Replaces: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) -Conflicts: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) Provides: ${python:Provides} Suggests: python-apt-dbg, python-gtk2, python-vte XB-Python-Version: ${python:Versions} diff --git a/debian/examples b/debian/examples index 80a386c8..e4a93ea1 100644 --- a/debian/examples +++ b/debian/examples @@ -1 +1,2 @@ doc/examples/*.py +doc/source/examples/*.py diff --git a/debian/python-apt.docs b/debian/python-apt.docs index f3c87fdc..ff53abec 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -1,4 +1,4 @@ README apt/README.apt data/templates/README.templates -html/ +doc/build/html/ diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..39fe377f --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,75 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html web pickle htmlhelp latex changes linkcheck + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview over all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + +clean: + -rm -rf build/* + +html: + mkdir -p build/html build/doctrees + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html + @echo + @echo "Build finished. The HTML pages are in build/html." + +pickle: + mkdir -p build/pickle build/doctrees + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +web: pickle + +json: + mkdir -p build/json build/doctrees + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + mkdir -p build/htmlhelp build/doctrees + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in build/htmlhelp." + +latex: + mkdir -p build/latex build/doctrees + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex + @echo + @echo "Build finished; the LaTeX files are in build/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +changes: + mkdir -p build/changes build/doctrees + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes + @echo + @echo "The overview file is in build/changes." + +linkcheck: + mkdir -p build/linkcheck build/doctrees + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in build/linkcheck/output.txt." diff --git a/doc/makefile b/doc/makefile deleted file mode 100644 index 7f9dff2b..00000000 --- a/doc/makefile +++ /dev/null @@ -1,13 +0,0 @@ -# -*- make -*- -BASE=.. -SUBDIR=doc - -# Bring in the default rules -include ../buildlib/defaults.mak - -# Examples -SOURCE = examples/config.py examples/configisc.py examples/tagfile.py \ - examples/versiontest.py examples/checkstate.py \ - examples/recommends.py -TO = $(DOC) -include $(COPY_H) diff --git a/doc/source/apt/cache.rst b/doc/source/apt/cache.rst new file mode 100644 index 00000000..f3ba7d52 --- /dev/null +++ b/doc/source/apt/cache.rst @@ -0,0 +1,70 @@ +:mod:`apt.cache` --- The Cache class +===================================== +.. automodule:: apt.cache + +The Cache class +--------------- + +.. autoclass:: Cache + :members: + +Example +^^^^^^^ + +The following example shows how to load the cache, update it, and upgrade +all the packages on the system. + +.. code-block:: python + + import apt + import apt.progress + + # First of all, open the cache + cache = apt.Cache() + # Now, lets update the package list + cache.update() + # We need to re-open the cache because it needs to read the package list + cache.open(None) + # Now we can do the same as 'apt-get upgrade' does + cache.upgrade() + # or we can play 'apt-get dist-upgrade' + cache.upgrade(True) + # Q: Why does nothing happen? + # A: You forgot to call commit()! + cache.commit(apt.progress.TextFetchProgress(), + apt.progress.InstallProgress()) + + + +Working with Filters +-------------------- +.. autoclass:: Filter + :members: + +.. autoclass:: MarkedChangesFilter + :members: + +.. autoclass:: FilteredCache + :members: + + +Example +^^^^^^^ + +This is an example for a filtered cache, which only allows access to the +packages whose state has been changed, eg. packages marked for installation:: + + >>> from apt.cache import FilteredCache, Cache, MarkedChangesFilter + >>> cache = apt.Cache() + >>> changed = apt.FilteredCache(cache) + >>> changed.setFilter(MarkedChangesFilter()) + >>> print len(changed) == len(cache.GetChanges()) # Both need to have same length + True + + +Exceptions +---------- +.. autoexception:: FetchCancelledException + :members: +.. autoexception:: FetchFailedException +.. autoexception:: LockFailedException diff --git a/doc/source/apt/cdrom.rst b/doc/source/apt/cdrom.rst new file mode 100644 index 00000000..56381f14 --- /dev/null +++ b/doc/source/apt/cdrom.rst @@ -0,0 +1,7 @@ +:mod:`apt.cdrom` - Functionality like in apt-cdrom +==================================================== +.. automodule:: apt.cdrom + :members: + + + diff --git a/doc/source/apt/debfile.rst b/doc/source/apt/debfile.rst new file mode 100644 index 00000000..70c39087 --- /dev/null +++ b/doc/source/apt/debfile.rst @@ -0,0 +1,37 @@ +:mod:`apt.debfile` --- Classes related to debian package files +============================================================== +The :mod:`apt.debfile` provides classes to work with locally available +debian packages, or source packages. + +.. module:: apt.debfile + +Binary packages +---------------- +.. autoclass:: DebPackage + :members: + :inherited-members: + :undoc-members: + + The :class:`DebPackage` class is a class for working with '.deb' files, + also known as Debian packages. + + It provides methods and attributes to get a list of the files in the + package, to install the package and much more. + + If you specify ``cache`` it has to point to an :class:`apt.cache.Cache()` + object. + + All methods except for :meth:`open()` and the attribute :attr:`filelist` have been + introduced in version 0.7.9. + +Source packages +---------------- +.. autoclass:: DscSrcPackage + :members: + :inherited-members: + :undoc-members: + + Provide functionality to work with locally available source packages, + especially with their '.dsc' file. + + .. versionadded:: 0.7.9 diff --git a/doc/source/apt/gtk.widgets.rst b/doc/source/apt/gtk.widgets.rst new file mode 100644 index 00000000..9fa84ead --- /dev/null +++ b/doc/source/apt/gtk.widgets.rst @@ -0,0 +1,29 @@ +:mod:`apt.gtk.widgets` --- GTK widgets +====================================== +.. automodule:: apt.gtk.widgets + + +GObject progress classes +------------------------- + +.. autoclass:: GDpkgInstallProgress + :members: + +.. autoclass:: GFetchProgress + :members: + +.. autoclass:: GInstallProgress + :members: + +.. autoclass:: GOpProgress + :members: + +GTK+ Class +---------- +.. autoclass:: GtkAptProgress + :members: + + +Example +------- +.. literalinclude:: ../examples/apt-gtk.py diff --git a/doc/source/apt/index.rst b/doc/source/apt/index.rst new file mode 100644 index 00000000..5047a0fd --- /dev/null +++ b/doc/source/apt/index.rst @@ -0,0 +1,58 @@ +:mod:`apt` --- Highlevel apt package +===================================== +The highlevel apt package provides a lot of functionality, all +with an easy-to-use interface. + +.. warning:: + The API of this package is not considered stable. Evenmore, it is considered + to change the naming conventions in future to lowercase_with_underscores. + + In case this happens, the API will still be kept compatible, with the old + functions provided as deprecated ones. + +.. automodule:: apt + :members: + + + + +.. toctree:: + :maxdepth: 2 + :glob: + + * + + +Classes exported in apt +------------------------ +These classes are defined in the submodules, but are also exported directly +in the package. + +.. class:: Cache + + Please see :class:`apt.cache.Cache` for documentation. + +.. class:: Cdrom + + Please see :class:`apt.cdrom.Cdrom` for documentation. + +.. class:: CdromProgress + + Please see :class:`apt.progress.CdromProgress` for documentation. + +.. class:: FetchProgress + + Please see :class:`apt.progress.FetchProgress` for documentation. + +.. class:: InstallProgress + + Please see :class:`apt.progress.InstallProgress` for documentation. + +.. class:: OpProgress + + Please see :class:`apt.progress.OpProgress` for documentation. + +.. class:: Package + + Please see :class:`apt.package.Package` for documentation. + diff --git a/doc/source/apt/package.rst b/doc/source/apt/package.rst new file mode 100644 index 00000000..1bd032ab --- /dev/null +++ b/doc/source/apt/package.rst @@ -0,0 +1,101 @@ +:mod:`apt.package` --- Classes for package handling +==================================================== + + +.. automodule:: apt.package + + +The Package class +----------------- +.. autoclass:: Package + :members: + + +Dependency Information +---------------------- +.. class:: BaseDependency + + The :class:`BaseDependency` class defines various attributes for accessing + the parts of a dependency. The attributes are as follows: + + .. attribute:: name + + The name of the dependency + + .. attribute:: relation + + The relation (>>,>=,==,<<,<=,) + + .. attribute:: version + + The version or None. + + .. attribute:: preDepend + + Boolean value whether this is a pre-dependency. + +.. class:: Dependency + + The dependency class represents a Or-Group of dependencies. It provides + an attribute to access the :class:`BaseDependency` object for the available + choices. + + .. attribute:: or_dependencies + + A list of :class:`BaseDependency` objects which could satisfy the + requirement of the Or-Group. + + +Origin Information +------------------- +.. class:: Origin + + The :class:`Origin` class provides access to the origin of the package. + It allows you to check the component, archive, the hostname, and even if + this package can be trusted. + + .. attribute:: archive + + The archive (eg. unstable) + + .. attribute:: component + + The component (eg. main) + + .. attribute:: label + + The Label, as set in the Release file + + .. attribute:: origin + + The Origin, as set in the Release file + + .. attribute:: site + + The hostname of the site. + + .. attribute:: trusted + + Boolean value whether this is trustworthy. An origin can be trusted, if + it provides a GPG-signed Release file and the GPG-key used is in the + keyring used by apt (see apt-key). + +Examples +--------- +.. code-block:: python + + import apt + + cache = apt.Cache() + pkg = cache['python-apt'] # Access the Package object for python-apt + print 'python-apt is trusted:', pkg.candidateOrigin.trusted + + # Mark python-apt for install + pkg.markInstall() + + print 'python-apt is marked for install:', pkg.markedInstall + + print 'python-apt is', pkg.summary #Python interface to libapt-pkg + + # Now, really install it + cache.commit() diff --git a/doc/source/apt/progress.rst b/doc/source/apt/progress.rst new file mode 100644 index 00000000..8989aa27 --- /dev/null +++ b/doc/source/apt/progress.rst @@ -0,0 +1,37 @@ +:mod:`apt.progress` --- Classes for progress reporting +====================================================== +.. automodule:: apt.progress + +.. warning:: + + This class is currently under re-organisation. Therefore, the API may + change soon. The old names will still be kept until it is safe to remove + them. + + + +Classes without output +---------------------- +.. autoclass:: FetchProgress + :members: +.. autoclass:: OpProgress + :members: +.. autoclass:: CdromProgress + :members: +.. autoclass:: DumbInstallProgress + :members: + +Implementing classes for text output +------------------------------------ +.. autoclass:: TextFetchProgress + :members: +.. autoclass:: OpTextProgress + :members: +.. autoclass:: InstallProgress + :members: +.. autoclass:: DpkgInstallProgress + :members: + + + + diff --git a/doc/source/apt_inst.rst b/doc/source/apt_inst.rst new file mode 100644 index 00000000..b405b9f4 --- /dev/null +++ b/doc/source/apt_inst.rst @@ -0,0 +1,100 @@ +:mod:`apt_inst` - Working with local Debian packages +==================================================== +.. module:: apt_inst + +The :mod:`apt_inst` extension provides access to functions for working with +locally available Debian packages (.deb files) and tar files. + + +Checking packages +------------------ +.. function:: arCheckMember(file, membername) + + Check if the member specified by the parameter ``membername`` exists in + the AR file referenced by the :class:`file` object ``file``. + + +Listing contents +----------------- +.. function:: debExtract(file, func, chunk) + + Call the function referenced by ``func`` for each member of the tar file + ``chunk`` which is contained in the AR file referenced by the file object + ``file``. + + An example would be: + + .. code-block:: python + + debExtract(open("package.deb"), my_callback, "data.tar.gz") + + See :ref:`emulating-dpkg-contents` for a more detailed example. + +.. function:: tarExtract(file,func,comp) + + Call the function ``func`` for each member of the tar file ``file``. + + ``Comp`` is a string determining the compressor used. Possible options are + "lzma", "bzip2" and "gzip". + + +Callback +^^^^^^^^^ +Both of these functions expect a callback with the signature +``(what, name, link, mode, uid, gid, size, mtime, major, minor)``. + +The parameter ``what`` describes the type of the member. It can be ``FILE``, +``DIR``, or ``HARDLINK``. + +The parameter ``name`` refers to the name of the member. In case of links, +``link`` refers to the target of the link. + + +Extracting contents +------------------- + +.. function:: debExtractArchive(file, rootdir) + + Extract the archive referenced by the :class:`file` object ``file`` + into the directory specified by ``rootdir``. + + See :ref:`emulating-dpkg-extract` for an example. + + .. warning:: + + If the directory given by ``rootdir`` does not exist, the package is + extracted into the current directory. + +.. function:: debExtractControl(file[, member='control']) + + Return the indicated file from the control tar. The default is 'control'. + + If you want to print the control file of a given package, you could do + something like: + + .. code-block:: python + + print debExtractControl(open("package.deb")) + + :return: The contents of the file, as :class:`str`. + + +.. _emulating-dpkg-extract: + +Example: Emulating :program:`dpkg` :option:`--extract` +------------------------------------------------------- +Here is a code snippet which emulates dpkg -x. It can be run as +``tool pkg.deb outdir``. + +.. literalinclude:: examples/dpkg-extract.py + + +.. _emulating-dpkg-contents: + +Example: Emulating :program:`dpkg` :option:`--contents` +------------------------------------------------------- +.. literalinclude:: examples/dpkg-contents.py + +Example: Emulating :program:`dpkg` :option:`--info` +---------------------------------------------------- +.. literalinclude:: examples/dpkg-info.py diff --git a/doc/source/apt_pkg/cache.rst b/doc/source/apt_pkg/cache.rst new file mode 100644 index 00000000..abb0fab2 --- /dev/null +++ b/doc/source/apt_pkg/cache.rst @@ -0,0 +1,95 @@ +Low-Level Cache Handling +=========================== + +.. class:: Acquire + + .. method:: Run() + + Fetch all the items which have been added by + :func:`apt_pkg.GetPkgAcqFile`. + + .. method:: Shutdown + + Shut the fetcher down. + +.. class:: pkgCache + + The :class:`pkgCache` class prov + + .. method:: Close() + + Close the package cache. + + .. method:: Open([progress]) + + Open the package cache again. The parameter ``progress`` may be set to + an :class:`apt.progress.OpProgress()` object or `None`. + + .. method:: Update(progress, list) + + Update the package cache. + + The parameter ``progress`` points to an :class:`apt.progress.FetchProgress()` + object. + + The parameter ``list`` refers to an object as returned by + :func:`apt_pkg.GetPkgSourceList`. + + .. method:: __getitem__(item) + + Return an :class:`pkgCachePackage` object for the package with the given + name. + +.. class:: pkgCachePackage + + The pkgCache::Package objects are an interface to package specific + features. + + + Attributes: + + .. attribute:: Name + + This is the name of the package. + + .. attribute:: Section + + The section of the package, as specified in the record. The list of + possible sections is defined in the Policy. + + .. attribute:: ID + + The ID of the package. This can be used to store information about + the package. The ID is an int value. + + +Working with dependencies +------------------------- +.. class:: pkgDepCache + + The pkgDepCache object contains various methods to manipulate the cache, + to install packages, to remove them, and much more. + + .. method:: Commit(fprogress, iprogress) + + Apply all the changes made. + + The parameter ``fprogress`` has to be set to an instance of + apt.progress.FetchProgress or one of its subclasses. + + The parameter ``iprogress`` has to be set to an instance of + apt.progress.InstallProgress or one of its subclasses. + + .. method:: FixBroken() + + Try to fix all broken packages in the cache. + + .. method:: GetCandidateVer(pkg) + + Return the candidate version of the package, ie. the version that + would be installed normally. + + The parameter ``pkg`` refers to an :class:`pkgCachePackage` object, + available using the :class:`pkgCache`. + + This method returns a :class:`pkgCacheVersion` object. diff --git a/doc/source/apt_pkg/index.rst b/doc/source/apt_pkg/index.rst new file mode 100644 index 00000000..5f23df31 --- /dev/null +++ b/doc/source/apt_pkg/index.rst @@ -0,0 +1,239 @@ +:mod:`apt_pkg` --- The low-level bindings for apt-pkg +===================================================== +.. module:: apt_pkg + +The apt_pkg extensions provides a more low-level way to work with apt. It can +do everything apt can, and is written in C++. It has been in python-apt since +the beginning. + + +.. toctree:: + :maxdepth: 2 + :glob: + + * + + +Module Initialization +--------------------- + + +.. function:: initConfig + + Initialize the configuration of apt. This is needed for most operations. + +.. function:: initSystem + + Initialize the system. + +.. function:: init + + Deprecated function. Use initConfig() and initSystem() instead. + +Object initialization +---------------------- +.. function:: GetCache([progress]) + + Return a :class:`pkgCache` object. The optional parameter ``progress`` + specifies an instance of :class:`apt.progress.OpProgress()` which will + display the open progress. + +.. function:: GetCdrom() + + Return a Cdrom object with the following methods: + + .. method:: Cdrom.Ident(progress) + + Identify the cdrom. The parameter ``progress`` refers to an + :class:`apt.progress.CdromProgress()` object. + + .. method:: Cdrom.Add(progress) + + Add the cdrom to the sources.list file. The parameter ``progress`` + refers to an :class:`apt.progress.CdromProgress()` object. + + + +.. function:: GetDepCache(cache) + + Return a :class:`pkgDepCache` object. The parameter ``cache`` specifies an + instance of :class:`pkgCache` (see :func:`GetCache()`). + + +.. function:: GetPkgSourceList() + + Return a :class:`pkgSourceList` object. + + +The Acquire interface +---------------------- +.. function:: GetAcquire([progress]) + + Return an :class:`Acquire` object. This is a class which allows you + to fetch files, or archive contents. The parameter ``progress`` refers to + an :class:`apt.progress.FetchProgress()` object. + + Acquire items have multiple methods: + + .. method:: Acquire.Run() + + Fetch all the items which have been added by :func:`GetPkgAcqFile`. + + .. method:: Acquire.Shutdown() + + Shut the fetcher down. + +.. function:: GetPkgAcqFile(aquire, uri[, md5, size, descr, shortDescr, destDir, destFile]) + + The parameter ``acquire`` refers to an :class:`Acquire()` object as returned + by :func:`GetAcquire`. The file will be added to the Acquire queue + automatically. + + The parameter ``uri`` refers to the location of the file, any protocol + of apt is supported. + + The parameter ``md5`` refers to the md5sum of the file. This can be used + for checking the file. + + The parameter ``size`` can be used to specify the size of the package, + which can then be used to calculate the progress and validate the download. + + The parameter ``descr`` is a descripition of the download. It may be + used to describe the item in the progress class. ``shortDescr`` is the + short form of it. + + You can use ``destDir`` to manipulate the directory where the file will + be saved in. Together with ``destFile`` you can specify the complete target + path. + + + +Hash functions +-------------- +The apt_pkg module also provides several hash functions. If you develop +applications with python-apt it is often easier to use these functions instead +of the ones provides in Python's :mod:`hashlib` module. + +.. function:: md5sum(object) + + Return the md5sum of the object. ``object`` may either be a string, in + which case the md5sum of the string is returned, or a :class:`file()` + object, in which case the md5sum of its contents is returned. + +.. function:: sha1sum(object) + + Return the sha1sum of the object. ``object`` may either be a string, in + which case the sha1sum of the string is returned, or a :class:`file()` + object, in which case the sha1sum of its contents is returned. + +.. function:: sha256sum(object) + + Return the sha256sum of the object. ``object`` may either be a string, in + which case the sha256sum of the string is returned, or a :class:`file()` + object, in which case the sha256sum of its contents is returned. + +Other functions +---------------- + +.. note:: + + This documentation is created automatically and should be rewritten. + +.. autofunction:: Base64Encode +.. autofunction:: CheckDep +.. autofunction:: CheckDomainList +.. autofunction:: DeQuoteString +.. autofunction:: GetLock +.. autofunction:: GetPackageManager +.. autofunction:: GetPkgActionGroup +.. autofunction:: GetPkgProblemResolver +.. autofunction:: GetPkgRecords +.. autofunction:: GetPkgSrcRecords +.. autofunction:: newConfiguration +.. autofunction:: ParseCommandLine +.. autofunction:: ParseDepends +.. autofunction:: ParseSection +.. autofunction:: ParseSrcDepends +.. autofunction:: ParseTagFile +.. autofunction:: PkgSystemLock +.. autofunction:: PkgSystemUnLock +.. autofunction:: QuoteString +.. autofunction:: ReadConfigFile +.. autofunction:: ReadConfigFileISC +.. autofunction:: RewriteSection +.. autofunction:: SizeToStr +.. autofunction:: StringToBool +.. autofunction:: StrToTime +.. autofunction:: TimeRFC1123 +.. autofunction:: TimeToStr +.. autofunction:: UpstreamVersion +.. autofunction:: URItoFileName +.. autofunction:: VersionCompare + + +Data +----- + +.. data:: Config + + An :class:`Configuration()` object with the default configuration. Actually, + this is a bit different object, but it is compatible. + +.. data:: RewritePackageOrder + +.. data:: RewriteSourceOrder + + +Package States +^^^^^^^^^^^^^^^ +.. data:: CurStateConfigFiles +.. data:: CurStateHalfConfigured +.. data:: CurStateHalfInstalled +.. data:: CurStateInstalled +.. data:: CurStateNotInstalled +.. data:: CurStateUnPacked + + + + +Dependency types +^^^^^^^^^^^^^^^^ +.. data:: DepConflicts +.. data:: DepDepends +.. data:: DepObsoletes +.. data:: DepPreDepends +.. data:: DepRecommends +.. data:: DepReplaces +.. data:: DepSuggests + +Installed states +^^^^^^^^^^^^^^^^^ +.. data:: InstStateHold +.. data:: InstStateHoldReInstReq +.. data:: InstStateOk +.. data:: InstStateReInstReq + + +Priorities +^^^^^^^^^^ +.. data:: PriExtra +.. data:: PriImportant +.. data:: PriOptional +.. data:: PriRequired +.. data:: PriStandard + +Dselect states +^^^^^^^^^^^^^^ +.. data:: SelStateDeInstall +.. data:: SelStateHold +.. data:: SelStateInstall +.. data:: SelStatePurge +.. data:: SelStateUnknown + + +Build information +^^^^^^^^^^^^^^^^^ +.. data:: Date +.. data:: LibVersion +.. data:: Time +.. data:: Version diff --git a/doc/source/aptsources/distinfo.rst b/doc/source/aptsources/distinfo.rst new file mode 100644 index 00000000..96f9445d --- /dev/null +++ b/doc/source/aptsources/distinfo.rst @@ -0,0 +1,10 @@ +:mod:`aptsources.distinfo` --- provide meta information for distro repositories +=============================================================================== + +.. automodule:: aptsources.distinfo + :members: + :undoc-members: + + .. note:: + + This part of the documentation is created automatically. diff --git a/doc/source/aptsources/distro.rst b/doc/source/aptsources/distro.rst new file mode 100644 index 00000000..06ca0fda --- /dev/null +++ b/doc/source/aptsources/distro.rst @@ -0,0 +1,10 @@ +:mod:`aptsources.distro` --- Distribution abstraction of the sources.list +=============================================================================== + +.. automodule:: aptsources.distro + :members: + :undoc-members: + + .. note:: + + This part of the documentation is created automatically. diff --git a/doc/source/aptsources/index.rst b/doc/source/aptsources/index.rst new file mode 100644 index 00000000..898fbf74 --- /dev/null +++ b/doc/source/aptsources/index.rst @@ -0,0 +1,10 @@ +:mod:`aptsources` --- Working with sources.list +===================================================== +.. automodule:: aptsources + +.. toctree:: + :maxdepth: 2 + :glob: + + * + diff --git a/doc/source/aptsources/sourceslist.rst b/doc/source/aptsources/sourceslist.rst new file mode 100644 index 00000000..509db3ce --- /dev/null +++ b/doc/source/aptsources/sourceslist.rst @@ -0,0 +1,10 @@ +:mod:`aptsources.sourceslist` --- Provide an abstraction of the sources.list +============================================================================ + +.. automodule:: aptsources.sourceslist + :members: + :undoc-members: + + .. note:: + + This part of the documentation is created automatically. diff --git a/doc/source/coding.rst b/doc/source/coding.rst new file mode 100644 index 00000000..0a57bd74 --- /dev/null +++ b/doc/source/coding.rst @@ -0,0 +1,149 @@ +Coding for python-apt +====================== +Let's say you need a new feature, you can develop it, and you want to get it +included in python-apt. Then be sure to follow the following guidelines + + +Available branches +------------------- +First of all, let's talk a bit about the bzr branches of python-apt. In the +following parts, we will assume that you use bzr to create your changes and +submit them. + +**mvo:** http://people.ubuntu.com/~mvo/bzr/python-apt/mvo + This is Michael Vogt's branch. Most of the development of apt happens here, + as he is the lead maintainer of python-apt. + + This branch is also available from Launchpads super mirror, via + ``lp:python-apt``. Checkouts from Launchpad are generally faster and can + use the bzr protocoll. + + VCS-Browser: https://code.launchpad.net/~mvo/python-apt/python-apt--mvo + +**debian-sid:** http://bzr.debian.org/apt/python-apt/debian-sid + This is the official Debian branch of python-apt. All code which will be + uploaded to Debian is here. It is not as up-to-date as the mvo branch, + because this branch often gets updated just right before the release + happens. + + VCS-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes + +**ubuntu:** ``lp:~ubuntu-core-dev/python-apt/ubuntu`` + This is the official Ubuntu development branch. The same notes apply as + for the debian-sid branch above. + + VCS-Browser: https://code.launchpad.net/~ubuntu-core-dev/python-apt/ubuntu + + +C++ Coding style +---------------- +When you work on the C++ code in the python/ directory, you should follow some +basic rules. + +The indentation of the code is a bit non-standard. We currently use 3 spaces +indentation for the C++ code. + +When you create new functions, you should follow some naming conventions. All +C++ functions are named according to the ``CamelCase`` convention. + +The resulting Python functions should be ``CamelCase`` as well in apt_pkg, or +``mixedCase`` in apt_inst. The same applies for variables, parameters, +attributes, etc. + +.. note:: + + This coding style guidelines are incomplete. If you have any questions + send an email to deity@lists.debian.org. + +.. note:: + + The coding style may be changed completely during the port to Python 3.0. + But this will not happen very soon. + + +Python Coding Style +------------------- +The coding style for the rest of the code is basically :PEP:`8`, with some exceptions: + +The naming convention is mixedCase for functions, methods, attributes, and +variables. This is considered bad and will be changed in future versions to +lowercase_with_underscores, as stated in :PEP:`8`. + +.. note:: + + You can use the tool pep8.py from http://svn.browsershots.org/trunk/devtools/pep8/ + to validate your code. Please also run pylint, pychecker, and pyflakes and + fix all new errors they report (unresolved names, etc.). + + +Submitting your patch +--------------------- +First of all, the patch you create should be based against the debian-sid +branch of python-apt. + +Once you have made your change, check that it: + + * conforms to :PEP:`8` (checked with pep8.py). It should, at least not + introduce new errors. (and never have whitespace at end of line) + * produces no new errors in pychecker, pyflakes and pylint (unless you + can't fix them, but please tell so when requesting the merge, so it can + be fixed before hitting one of the main branches). + * does not change the behaviour of existing code in a non-compatible way. + +If your change follows all points of the checklist, you can commit it to your +repository. (You could commit it first, and check later, and then commit the +fixes, but commits should be logical and it makes no sense to have to commits +for one logical unit). + +Once you have made all your changes, you can run ``bzr send -o patch-name`` +to create a so called *merge-directive*, which contains your changes and +allows us to preserve the history of your changes. (But please replace patch-name +with something useful). + +Now report a bug against the python-apt package, attach the merge directive +you created in the previous step, and tag it with 'patch'. It might also be +a good idea to prefix the bug report with '[PATCH]'. + +If your patch introduces new functions, parameters, etc. , but does not update +the content of this documentation, please CC. jak@debian.org, and add a short +notice to the bug report. Also see `Documentation updates` + +Once your patch got merged, you can *pull* the branch into which it has been +merged into your local one. If you have made changes since you submitted your +patch, you may need to *merge* the branch instead. + +.. note:: + + If you plan to work on python-apt for a longer time, it may be a good + idea to publish your branch somewhere. Alioth (http://alioth.debian.org) + and Launchpad (https://launchpad.net) provide bzr hosting. You can also + use any webspace with ftp or sftp connection (for the upload). + + +Documentation updates +--------------------- +If you want to update the documentation, please follow the procedure as written +above. But please CC: jak@debian.org in the bug report. + +You can send your content in plain text, but reStructuredText is the preferred +format. I (Julian Andres Klode) will review your patch and will forward them to +Michael Vogt, for inclusion in his branch. On release, this will be merged into +the debian-sid branch. + + +Example patch session +---------------------- +In the following example, we edit a file, create a merge directive (an enhanced +patch), and report a wishlist bug with this patch against the python-apt +package:: + + user@pc:~$ bzr clone http://bzr.debian.org/apt/python-apt/debian-sid/ + user@pc:~$ cd debian-sid + user@pc:~/debian-sid$ editor FILES + user@pc:~/debian-sid$ pep8.py FILES # PEP 8 check, see above. + user@pc:~/debian-sid$ pylint -e FILES # Check with pylint + user@pc:~/debian-sid$ pyflakes FILES # Check with pyflakes + user@pc:~/debian-sid$ pychecker FILES # Check with pychecker + user@pc:~/debian-sid$ bzr commit + user@pc:~/debian-sid$ bzr send -o my-patch + user@pc:~/debian-sid$ reportbug --severity=wishlist --tag=patch --attach=my-patch python-apt diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 00000000..4cd444f1 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +# +# python-apt documentation build configuration file, created by +# sphinx-quickstart on Wed Jan 7 17:04:36 2009. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# The contents of this file are pickled, so don't put values in the namespace +# that aren't pickleable (module imports are okay, they're removed automatically). +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If your extensions are in another directory, add it here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +sys.path.insert(0,os.path.abspath('..')) +sys.path.insert(0,os.path.abspath('../..')) + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx'] +intersphinx_mapping = {'http://docs.python.org/': None} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['.templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'python-apt' +copyright = u'2009, Julian Andres Klode ' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.7' +# The full version, including alpha/beta/rc tags. +release = '0.7.9~exp2' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directory, that shouldn't be searched +# for source files. +exclude_trees = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The style sheet to use for HTML and HTML Help pages. A file of that name +# must exist either in Sphinx' static/ path, or in one of the custom paths +# given in html_static_path. +html_style = 'default.css' + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['.static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, the reST sources are included in the HTML build as _sources/. +#html_copy_source = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'python-aptdoc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class [howto/manual]). +latex_documents = [ + ('index', 'python-apt.tex', ur'python-apt Documentation', + ur'Julian Andres Klode ', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True diff --git a/doc/source/examples/apt-gtk.py b/doc/source/examples/apt-gtk.py new file mode 100644 index 00000000..c3bb09d5 --- /dev/null +++ b/doc/source/examples/apt-gtk.py @@ -0,0 +1,29 @@ +#!/usr/bin/python +"""Example for gtk widgets""" +import pygtk +pygtk.require("2.0") +import gtk + +import apt.gtk.widgets + + +def main(): + """Main function.""" + win = gtk.Window() + win.connect("destroy", gtk.main_quit) + progress = apt.gtk.widgets.GtkAptProgress() + win.set_title("GtkAptProgress Demo") + win.add(progress) + progress.show() + win.show() + cache = apt.cache.Cache(progress.open) + if cache["xterm"].isInstalled: + cache["xterm"].markDelete() + else: + cache["xterm"].markInstall() + progress.show_terminal(expanded=True) + cache.commit(progress.fetch, progress.install) + gtk.main() + +if __name__ == "__main__": + main() diff --git a/doc/source/examples/dpkg-contents.py b/doc/source/examples/dpkg-contents.py new file mode 100644 index 00000000..99d1596f --- /dev/null +++ b/doc/source/examples/dpkg-contents.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +"""Emulate dpkg --contents""" + +import grp +import pwd +import stat +import sys +import time + +import apt_inst + + +def format_mode(what, mode): + """Return the symbolic mode""" + s_mode = dict(DIR="d", HARDLINK="h", FILE="-").get(what) + s_mode += ((mode & stat.S_IRUSR) and "r" or "-") + s_mode += ((mode & stat.S_IWUSR) and "w" or "-") + s_mode += ((mode & stat.S_IXUSR) and (mode & stat.S_ISUID and "s" or "x") + or (mode & stat.S_ISUID and "S" or "-")) + s_mode += ((mode & stat.S_IRGRP) and "r" or "-") + s_mode += ((mode & stat.S_IWGRP) and "w" or "-") + s_mode += ((mode & stat.S_IXGRP) and (mode & stat.S_ISGID and "s" or "x") + or (mode & stat.S_ISGID and "S" or "-")) + s_mode += ((mode & stat.S_IROTH) and "r" or "-") + s_mode += ((mode & stat.S_IWOTH) and "w" or "-") + s_mode += ((mode & stat.S_IXOTH) and "x" or "-") + return s_mode + + +def callback(what, name, link, mode, uid, gid, size, mtime, major, minor): + """callback for debExtract""" + s_mode = format_mode(what, mode) + s_owner = "%s/%s" % (pwd.getpwuid(uid)[0], grp.getgrgid(gid)[0]) + s_size = "%9d" % size + s_time = time.strftime("%Y-%m-%d %H:%M", time.localtime(mtime)) + s_name = name.startswith(".") and name or ("./" + name) + if link: + s_name += " link to %s" % link + print s_mode, s_owner, s_size, s_time, s_name + + +def main(): + """Main function""" + if len(sys.argv) < 2: + print >> sys.stderr, "need filename argumnet" + sys.exit(1) + + fobj = open(sys.argv[1]) + try: + apt_inst.debExtract(fobj, callback, "data.tar.gz") + finally: + fobj.close() + +if __name__ == "__main__": + main() diff --git a/doc/source/examples/dpkg-extract.py b/doc/source/examples/dpkg-extract.py new file mode 100644 index 00000000..ced8652f --- /dev/null +++ b/doc/source/examples/dpkg-extract.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +"""Emulate dpkg --extract package.deb outdir""" +import os +import sys + +import apt_inst + + +def main(): + """Main function.""" + if len(sys.argv) < 3: + print >> sys.stderr, "Usage:", __file__, "package.deb outdir" + sys.exit(1) + if not os.path.exists(sys.argv[2]): + print >> sys.stderr, "The directory %s does not exist" % sys.argv[2] + sys.exit(1) + + fobj = open(sys.argv[1]) + try: + apt_inst.debExtractArchive(fobj, sys.argv[2]) + finally: + fobj.close() + +if __name__ == "__main__": + main() diff --git a/doc/source/examples/dpkg-info.py b/doc/source/examples/dpkg-info.py new file mode 100644 index 00000000..ff98d8b1 --- /dev/null +++ b/doc/source/examples/dpkg-info.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +"""Emulate dpkg --info package.deb control-file""" +import sys + +from apt_inst import debExtractControl + + +def main(): + """Main function.""" + if len(sys.argv) < 3: + print >> sys.stderr, 'Usage: tool file.deb control-file' + sys.exit(0) + fobj = open(sys.argv[1]) + try: + print debExtractControl(fobj, sys.argv[2]) + finally: + fobj.close() + +if __name__ == '__main__': + main() diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..d7c425bd --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,38 @@ +Welcome to python-apt's documentation! +====================================== + +.. note:: + + This documentation can not be considered complete at the moment. But it + provides better documentation than the documentation available through + pydoc. + +.. note:: + + + This documentation has been created by Sphinx, using reStructuredText files + written by Julian Andres Klode , and in case of the apt + package, from the documentation shipped in the modules. + + +Contents: + +.. toctree:: + :maxdepth: 2 + + apt/index + apt_pkg/index + apt_inst + aptsources/index + coding + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + + diff --git a/po/python-apt.pot b/po/python-apt.pot index 7a1002fb..6ffef103 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-24 14:45+0100\n" +"POT-Creation-Date: 2009-01-09 17:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -336,25 +336,25 @@ msgstr "" msgid "Custom servers" msgstr "" -#: ../apt/gtk/widgets.py:173 +#: ../apt/gtk/widgets.py:243 #, python-format msgid "Downloading file %(current)li of %(total)li with %(speed)s/s" msgstr "" -#: ../apt/gtk/widgets.py:179 +#: ../apt/gtk/widgets.py:249 #, python-format msgid "Downloading file %(current)li of %(total)li" msgstr "" #. Setup some child widgets -#: ../apt/gtk/widgets.py:220 +#: ../apt/gtk/widgets.py:269 msgid "Details" msgstr "" -#: ../apt/gtk/widgets.py:310 +#: ../apt/gtk/widgets.py:351 msgid "Starting..." msgstr "" -#: ../apt/gtk/widgets.py:313 +#: ../apt/gtk/widgets.py:357 msgid "Complete" msgstr "" diff --git a/setup.py b/setup.py index bdb59ff2..1ff7cb16 100755 --- a/setup.py +++ b/setup.py @@ -10,24 +10,9 @@ import os.path import pydoc import shutil import string +import subprocess import sys -def build_docs(dir="html", modules=["apt","aptsources"]): - htmldir = os.path.join(os.getcwd(), dir) - for d in modules: - for (dirpath, dirnames, filenames) in os.walk(d): - pydoc.writedoc(dirpath.replace("/",".")) - for file in filenames: - if not file.endswith(".py"): - continue - if file in ["__init__.py"]: - continue - pydoc.writedoc(dirpath.replace("/",".")+"."+file.split(".py")[0]) - if not os.path.exists(htmldir): - os.mkdir(htmldir) - for f in glob.glob("*.html"): - shutil.move(f, htmldir) - return True # The apt_pkg module files = map(lambda source: "python/"+source, @@ -41,23 +26,31 @@ apt_inst = Extension("apt_inst", files, libraries=["apt-pkg","apt-inst"]); # Replace the leading _ that is used in the templates for translation templates = [] -if not os.path.exists("build/data/templates/"): - os.makedirs("build/data/templates") -for template in glob.glob('data/templates/*.info.in'): - source = open(template, "r") - build = open(os.path.join("build", template[:-3]), "w") - lines = source.readlines() - for line in lines: - build.write(line.lstrip("_")) - source.close() - build.close() # build doc -if sys.argv[1] == "build": - build_docs() +if len(sys.argv) > 1 and sys.argv[1] == "build": + if not os.path.exists("build/data/templates/"): + os.makedirs("build/data/templates") + for template in glob.glob('data/templates/*.info.in'): + source = open(template, "r") + build = open(os.path.join("build", template[:-3]), "w") + lines = source.readlines() + for line in lines: + build.write(line.lstrip("_")) + source.close() + build.close() + if subprocess.call(["make", "-C", "doc", "html"]) : + raise SystemError +if len(sys.argv) > 1 and sys.argv[1] == "clean" and '-a' in sys.argv: + for dirname in "doc/build", "build/data", "build/mo": + if os.path.exists(dirname): + print "Removing", dirname + shutil.rmtree(dirname) + else: + print "Not removing", dirname, "because it does not exist" setup(name="python-apt", - version="0.6.17", + version="0.7.9", description="Python bindings for APT", author="APT Development Team", author_email="deity@lists.debian.org", -- cgit v1.2.3 From 21ba650e32457ee67ac0f85b03c071969aa5934b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 9 Jan 2009 21:52:32 +0100 Subject: * setup.py, doc/source/conf.py: Fix building by adding build/lib* to PYTHONPATH We now build the extension first, and then the documentation. Also add the text docs. --- debian/changelog | 6 ++++-- debian/python-apt.docs | 3 ++- debian/rules | 1 + doc/Makefile | 4 ++++ doc/source/conf.py | 7 +++++-- po/python-apt.pot | 2 +- setup.py | 14 ++++++++++---- 7 files changed, 27 insertions(+), 10 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 1002bead..7d37e7be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,9 @@ python-apt (0.7.9~exp2) experimental; urgency=low - 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 doc/build/html. + - 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 @@ -22,7 +24,7 @@ python-apt (0.7.9~exp2) experimental; urgency=low they are only needed for oldstable (sarge) - Build-Depend on python-sphinx (>= 0.5) - -- Julian Andres Klode Fri, 09 Jan 2009 17:20:41 +0100 + -- Julian Andres Klode Fri, 09 Jan 2009 18:11:30 +0100 python-apt (0.7.9~exp1) experimental; urgency=low diff --git a/debian/python-apt.docs b/debian/python-apt.docs index ff53abec..6ba083f5 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -1,4 +1,5 @@ README apt/README.apt data/templates/README.templates -doc/build/html/ +build/doc/html/ +build/doc/text/ diff --git a/debian/rules b/debian/rules index adaad2a8..90b48cda 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,7 @@ include /usr/share/cdbs/1/class/python-distutils.mk PKG=python-apt DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') +DEB_COMPRESS_EXCLUDE:=.html .js _static/* _sources/* _sources/*/* .inv DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS) build/python-apt-dbg:: diff --git a/doc/Makefile b/doc/Makefile index 39fe377f..327bba91 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -26,6 +26,10 @@ help: clean: -rm -rf build/* +text: + mkdir -p build/text build/doctrees + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) build/text + html: mkdir -p build/html build/doctrees $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html diff --git a/doc/source/conf.py b/doc/source/conf.py index 4cd444f1..907e2275 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -19,8 +19,11 @@ import sys, os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -sys.path.insert(0,os.path.abspath('..')) -sys.path.insert(0,os.path.abspath('../..')) +sys.path.insert(0, os.path.abspath('..')) +sys.path.insert(0, os.path.abspath('../..')) +if os.path.exists("../../build"): + for dirname in os.listdir('../../build'): + sys.path.insert(0, os.path.abspath('../../build/' + dirname)) # General configuration # --------------------- diff --git a/po/python-apt.pot b/po/python-apt.pot index 6ffef103..6af898db 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-09 17:23+0100\n" +"POT-Creation-Date: 2009-01-09 18:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/setup.py b/setup.py index 1ff7cb16..016db85a 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,6 @@ import os.path import pydoc import shutil import string -import subprocess import sys @@ -39,10 +38,10 @@ if len(sys.argv) > 1 and sys.argv[1] == "build": build.write(line.lstrip("_")) source.close() build.close() - if subprocess.call(["make", "-C", "doc", "html"]) : - raise SystemError + + if len(sys.argv) > 1 and sys.argv[1] == "clean" and '-a' in sys.argv: - for dirname in "doc/build", "build/data", "build/mo": + for dirname in "build/doc", "doc/build", "build/data", "build/mo": if os.path.exists(dirname): print "Removing", dirname shutil.rmtree(dirname) @@ -65,3 +64,10 @@ setup(name="python-apt", license = 'GNU GPL', platforms = 'posix' ) + +if len(sys.argv) > 1 and sys.argv[1] == "build": + import sphinx + sphinx.main(["sphinx", "-b", "html", "-d", "build/doc/doctrees", + os.path.abspath("doc/source"), "build/doc/html"]) + sphinx.main(["sphinx", "-b", "text", "-d", "build/doc/doctrees", + os.path.abspath("doc/source"), "build/doc/text"]) -- cgit v1.2.3 From 048460bfb647f57e232a95f5f37c99dd9242343c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 9 Jan 2009 22:50:02 +0100 Subject: Contains style Guide (Closes: #481562) --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7d37e7be..43c868a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ python-apt (0.7.9~exp2) experimental; urgency=low * 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 -- cgit v1.2.3 From 2470a03e9789f1729a49d945e8719b2adba871f8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 9 Jan 2009 23:39:45 +0100 Subject: Remove inconsistent use of tabs and spaces (Closes: #505443) --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 43c868a4..0bd352b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ python-apt (0.7.9~exp2) experimental; urgency=low * 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 -- cgit v1.2.3 From f9ab7e8cba34b547b3295409bc70a3b41da76e7c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 10 Jan 2009 00:28:17 +0100 Subject: * aptsources/distinfo.py: Allow @ in mirror urls (Closes: #478171) --- aptsources/distinfo.py | 2 +- debian/changelog | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 42395bc5..7a318799 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -132,7 +132,7 @@ class DistInfo: location = None match_loc = re.compile(r"^#LOC:(.+)$") - match_mirror_line = re.compile(r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://[A-Za-z/\.:\-_]+)$") + match_mirror_line = re.compile(r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://[A-Za-z/\.:\-_@]+)$") #match_mirror_line = re.compile(r".+") if not dist: diff --git a/debian/changelog b/debian/changelog index 0bd352b0..0324ae09 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,8 +25,10 @@ python-apt (0.7.9~exp2) experimental; urgency=low - 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) - -- Julian Andres Klode Fri, 09 Jan 2009 18:11:30 +0100 + -- Julian Andres Klode Sat, 10 Jan 2009 00:26:57 +0100 python-apt (0.7.9~exp1) experimental; urgency=low -- cgit v1.2.3 From 2d319fe412d9a506b9ab8b107cb2470f03dd5a11 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 10 Jan 2009 00:30:32 +0100 Subject: * also close LP: #223097 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 0324ae09..cd67e51a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,9 +26,9 @@ python-apt (0.7.9~exp2) experimental; urgency=low they are only needed for oldstable (sarge) - Build-Depend on python-sphinx (>= 0.5) * aptsources/distinfo.py: - - Allow @ in mirror urls (Closes: #478171) + - Allow @ in mirror urls (Closes: #478171) (LP: #223097) - -- Julian Andres Klode Sat, 10 Jan 2009 00:26:57 +0100 + -- Julian Andres Klode Sat, 10 Jan 2009 00:30:19 +0100 python-apt (0.7.9~exp1) experimental; urgency=low -- cgit v1.2.3 From 2e845fd26a63499c8d94b95dae0cb462f81b206d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 11 Jan 2009 19:55:47 +0100 Subject: * debian/changelog: Do not use deprecated form of raise statement (Closes: #494259) --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d920c16e..fbf665cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,8 +29,9 @@ python-apt (0.7.9~exp2) experimental; urgency=low - 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) - -- Julian Andres Klode Sun, 11 Jan 2009 19:46:12 +0100 + -- Julian Andres Klode Sun, 11 Jan 2009 19:55:11 +0100 python-apt (0.7.9~exp1) experimental; urgency=low -- cgit v1.2.3 From 2e980f4f190abb787f9aa9939a404875905d651c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 11 Jan 2009 20:02:29 +0100 Subject: * Add support for PkgRecords.SHA256Hash (Closes: #456113) --- debian/changelog | 3 ++- doc/source/apt_pkg/cache.rst | 5 +++++ python/pkgrecords.cc | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index fbf665cd..49236999 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,8 +30,9 @@ python-apt (0.7.9~exp2) experimental; urgency=low * 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) - -- Julian Andres Klode Sun, 11 Jan 2009 19:55:11 +0100 + -- Julian Andres Klode Sun, 11 Jan 2009 20:01:59 +0100 python-apt (0.7.9~exp1) experimental; urgency=low diff --git a/doc/source/apt_pkg/cache.rst b/doc/source/apt_pkg/cache.rst index 0a02c47c..6e924aeb 100644 --- a/doc/source/apt_pkg/cache.rst +++ b/doc/source/apt_pkg/cache.rst @@ -923,6 +923,11 @@ broken dependencies: Return the SHA1 hashsum of the package. This refers to the field 'SHA1' in the raw record. + .. attribute:: SHA256Hash + + Return the SHA256 hashsum of the package. This refers to the field + 'SHA256' in the raw record. + .. attribute:: SourcePkg Return the source package. diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 18240ce0..5359ee6f 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -65,6 +65,8 @@ static PyObject *PkgRecordsAttr(PyObject *Self,char *Name) return CppPyString(Struct.Last->MD5Hash()); else if (strcmp("SHA1Hash",Name) == 0) return CppPyString(Struct.Last->SHA1Hash()); + else if (strcmp("SHA256Hash",Name) == 0) + return CppPyString(Struct.Last->SHA256Hash()); else if (strcmp("SourcePkg",Name) == 0) return CppPyString(Struct.Last->SourcePkg()); else if (strcmp("SourceVer",Name) == 0) -- cgit v1.2.3