From 2f5a96fb610ef9cb10cb2042a86fea34d8a48904 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 8 Mar 2009 17:02:04 +0100 Subject: * apt/: Adjust modules to use Package.{installed,candidate}.* --- apt/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index 0065d14c..0c729787 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -152,7 +152,7 @@ class Cache(object): """Return the packages not downloadable packages in reqreinst state.""" reqreinst = set() for pkg in self: - if (not pkg.candidateDownloadable and + if (not pkg.candidate.downloadable and (pkg._pkg.InstState == apt_pkg.InstStateReInstReq or pkg._pkg.InstState == apt_pkg.InstStateHoldReInstReq)): reqreinst.add(pkg.name) -- cgit v1.2.3 From c3f9f8637176e2411b4e84e632e595cfd5512e90 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 8 Mar 2009 18:20:14 +0100 Subject: * apt/cache.py, apt/package.py: Fix some bugs. --- TODO | 5 ----- apt/cache.py | 3 +-- apt/package.py | 5 ++++- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'apt/cache.py') diff --git a/TODO b/TODO index c3faedf4..a08a28af 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,3 @@ -* apt.Package: - - change all candidateInstalledSize() to installSize(useCandidate=True) - same for candidateOrigin() (see downloadable for a example). - - might be better to have "Package.candidate.{downloadable,size,etc} - * aptsources: - make the distro detection in sources.list more clever by using the origin informaton to avoid adding full uris to (unofficial/internal) diff --git a/apt/cache.py b/apt/cache.py index 0c729787..1b5531ac 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -20,7 +20,6 @@ # USA import os -import sys import apt_pkg from apt import Package @@ -446,7 +445,7 @@ if __name__ == "__main__": print len(f) print "Testing filtered cache (no argument)" - f = FilteredCache(progress=OpTextProgress()) + f = FilteredCache(progress=apt.progress.OpTextProgress()) f.cache.connect("cache_pre_change", cache_pre_changed) f.cache.connect("cache_post_change", cache_post_changed) f.cache.upgrade() diff --git a/apt/package.py b/apt/package.py index c9275360..03b1e90c 100644 --- a/apt/package.py +++ b/apt/package.py @@ -79,6 +79,7 @@ class Dependency(object): def __repr__(self): return repr(self.or_dependencies) + class DeprecatedProperty(property): """A property which gives DeprecationWarning on access. @@ -97,6 +98,7 @@ class DeprecatedProperty(property): self.fget.func_name), DeprecationWarning, 2) return property.__get__(self, obj, type) + class Origin(object): """The origin of a version. @@ -167,6 +169,7 @@ class Record(object): """deprecated form of 'key in x'.""" return self._rec.has_key(key) + class Version(object): """Representation of a package version. @@ -264,7 +267,7 @@ class Version(object): dsc = unicode(self.package._records.LongDesc, "utf-8") except UnicodeDecodeError, err: return _("Invalid unicode in description for '%s' (%s). " - "Please report.") % (self.name, err) + "Please report.") % (self.package.name, err) lines = iter(dsc.split("\n")) # Skip the first line, since its a duplication of the summary -- cgit v1.2.3 From cece83b131202c9557fa332332b8cf85c2170eb8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 8 Mar 2009 19:09:47 +0100 Subject: * setup.py: Remove apt.gtk, add apt.progress --- apt/cache.py | 6 ++++-- doc/source/apt_pkg/index.rst | 1 + setup.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index 9f00b8a5..11e44c9e 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -52,9 +52,11 @@ class Cache(object): apt_pkg.Config.Set("Dir::Cache::pkgcache", "") if rootdir: if os.path.exists(rootdir+"/etc/apt/apt.conf"): - apt_pkg.ReadConfigFile(apt_pkg.Config, rootdir+"/etc/apt/apt.conf") + apt_pkg.ReadConfigFile(apt_pkg.Config, + rootdir + "/etc/apt/apt.conf") if os.path.isdir(rootdir+"/etc/apt/apt.conf.d"): - apt_pkg.ReadConfigDir(apt_pkg.Config, rootdir+"/etc/apt/apt.conf.d") + apt_pkg.ReadConfigDir(apt_pkg.Config, + rootdir + "/etc/apt/apt.conf.d") apt_pkg.Config.Set("Dir", rootdir) apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") diff --git a/doc/source/apt_pkg/index.rst b/doc/source/apt_pkg/index.rst index e944eb15..6e7b772e 100644 --- a/doc/source/apt_pkg/index.rst +++ b/doc/source/apt_pkg/index.rst @@ -201,6 +201,7 @@ Other functions .. autofunction:: PkgSystemUnLock .. autofunction:: QuoteString .. autofunction:: ReadConfigFile +.. autofunction:: ReadConfigDir() .. autofunction:: ReadConfigFileISC .. autofunction:: RewriteSection diff --git a/setup.py b/setup.py index 6a22734d..fc046381 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ setup(name="python-apt", author="APT Development Team", author_email="deity@lists.debian.org", ext_modules=[apt_pkg, apt_inst], - packages=['apt', 'apt.gtk', 'aptsources'], + packages=['apt', 'apt.progress', 'aptsources'], data_files = [('share/python-apt/templates', glob.glob('build/data/templates/*.info')), ('share/python-apt/templates', -- cgit v1.2.3 From d012f1c89a5f773d9b9ae7128e24d708bb4117cb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 8 Mar 2009 20:15:52 +0100 Subject: apt/cache.py: If no progress is given for cache open, use OpProgress. Also fix doc/examples/records.py to use Package.candidate.* --- apt/cache.py | 10 +++++----- doc/examples/records.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index 11e44c9e..a9430d6b 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -72,6 +72,8 @@ class Cache(object): """ Open the package cache, after that it can be used like a dictionary """ + if progress is None: + progress = apt.progress.OpProgress() self._runCallbacks("cache_pre_open") self._cache = apt_pkg.GetCache(progress) self._depcache = apt_pkg.GetDepCache(self._cache) @@ -80,9 +82,7 @@ class Cache(object): self._list.ReadMainList() self._dict = {} - # build the packages dict - if progress is not None: - progress.Op = "Building data structures" + progress.Op = "Building data structures" i=last=0 size=len(self._cache.Packages) for pkg in self._cache.Packages: @@ -94,8 +94,8 @@ class Cache(object): self._dict[pkg.Name] = Package(self, pkg) i += 1 - if progress is not None: - progress.done() + + progress.done() self._runCallbacks("cache_post_open") def __getitem__(self, key): diff --git a/doc/examples/records.py b/doc/examples/records.py index a0fc8dc4..681eac0c 100755 --- a/doc/examples/records.py +++ b/doc/examples/records.py @@ -5,9 +5,9 @@ import apt cache = apt.Cache() for pkg in cache: - if not pkg.candidateRecord: + if not pkg.candidate.record: continue - if "Task" in pkg.candidateRecord: + if "Task" in pkg.candidate.record: print "Pkg %s is part of '%s'" % ( - pkg.name, pkg.candidateRecord["Task"].split()) + pkg.name, pkg.candidate.record["Task"].split()) #print pkg.candidateRecord -- cgit v1.2.3 From 312b5ca7acbe74bc73acc2b710628ea2a8ad83cc Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 16:27:15 +0200 Subject: * Copyright updates: debian/copyright, etc. - debian/copyright: Switch to machine-interpretable copyright - apt/*.py: Fix the copyright years and comments. --- apt/__init__.py | 18 +++++++++++++++ apt/cache.py | 2 +- apt/cdrom.py | 2 +- apt/debfile.py | 31 ++++++++++++------------- apt/package.py | 2 +- apt/progress/__init__.py | 4 ++-- apt/progress/gtk2.py | 2 +- aptsources/distinfo.py | 10 ++++---- aptsources/distro.py | 4 ++-- aptsources/sourceslist.py | 12 +++++----- debian/changelog | 1 + debian/copyright | 58 ++++++++++++++++++++++++++++++++++++++++++----- 12 files changed, 103 insertions(+), 43 deletions(-) (limited to 'apt/cache.py') diff --git a/apt/__init__.py b/apt/__init__.py index e3cfacbe..ae2abbf2 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -1,3 +1,21 @@ +# Copyright (c) 2005-2009 Canonical +# +# Author: Michael Vogt +# +# This program is free software; you can redistribute it and/or +# modify it 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. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA # import the core of apt_pkg import apt_pkg import sys diff --git a/apt/cache.py b/apt/cache.py index a9430d6b..cc425ccb 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -1,6 +1,6 @@ # cache.py - apt cache abstraction # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/cdrom.py b/apt/cdrom.py index 61250fc4..b52762ad 100644 --- a/apt/cdrom.py +++ b/apt/cdrom.py @@ -1,6 +1,6 @@ # cdrom.py - CDROM handling # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # Copyright (c) 2009 Julian Andres Klode # # Author: Michael Vogt diff --git a/apt/debfile.py b/apt/debfile.py index c550d766..0406a250 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -1,24 +1,21 @@ -# Copyright (c) 2005-2007 Canonical +# Copyright (c) 2005-2009 Canonical # -# AUTHOR: -# Michael Vogt +# Author: Michael Vogt # -# This file is part of GDebi +# This program is free software; you can redistribute it and/or +# modify it 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. # -# GDebi is free software; you can redistribute it and/or -# modify it 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. -# -# GDebi is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GDebi; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA """Classes for working with locally available Debian packages.""" from gettext import gettext as _ import os diff --git a/apt/package.py b/apt/package.py index 595cf8ec..9afe1674 100644 --- a/apt/package.py +++ b/apt/package.py @@ -1,6 +1,6 @@ # package.py - apt package abstraction # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 51eb2426..769942ce 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -1,6 +1,6 @@ -# Progress.py - progress reporting classes +# progress.py - progress reporting classes # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 435265d4..f872e34f 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (c) 2004-2005 Canonical +# Copyright (c) 2004-2009 Canonical # # Authors: Michael Vogt # Sebastian Heinlein diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 59fa7e02..ce44e48b 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -1,12 +1,10 @@ -#!/usr/bin/env python -# # distinfo.py - provide meta information for distro repositories # -# Copyright (c) 2005 Gustavo Noronha Silva -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2005 Gustavo Noronha Silva +# Copyright (c) 2006-2007 Sebastian Heinlein # -# Author: Gustavo Noronha Silva -# Sebastian Heinlein +# Authors: Gustavo Noronha Silva +# Sebastian Heinlein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff --git a/aptsources/distro.py b/aptsources/distro.py index d81c6e4a..bbb8ba50 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -1,7 +1,7 @@ # distro.py - Provide a distro abstraction of the sources.list # -# Copyright (c) 2004-2007 Canonical Ltd. -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2004-2009 Canonical Ltd. +# Copyright (c) 2006-2007 Sebastian Heinlein # # Authors: Sebastian Heinlein # Michael Vogt diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index b1f00446..1dfd870f 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -1,12 +1,12 @@ # aptsource.py - Provide an abstraction of the sources.list # -# Copyright (c) 2004-2007 Canonical Ltd. -# 2004 Michiel Sikkes -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2004-2009 Canonical Ltd. +# Copyright (c) 2004 Michiel Sikkes +# Copyright (c) 2006-2007 Sebastian Heinlein # -# Author: Michiel Sikkes -# Michael Vogt -# Sebastian Heinlein +# Authors: Michiel Sikkes +# Michael Vogt +# Sebastian Heinlein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff --git a/debian/changelog b/debian/changelog index f51944f9..91ce7304 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.7.10~exp1) experimental; urgency=low - Remove mdz from Uploaders (Closes: #521477), add myself. - Update Standards-Version to 3.8.1 - Use ${binary:Version} instead of ${Source-Version} + * debian/copyright: Switch to machine-interpretable copyright -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/copyright b/debian/copyright index f8463185..8599328a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,53 @@ -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. +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=443 -On Debian systems, a copy of the GNU General Public License can be -found in /usr/share/common-licenses/GPL. +Files: * +Copyright: © 2004-2009 Canonical Ltd. +License: GPL-2+ + +Files: aptsources/*.py +Copyright: © 2004-2009 Canonical Ltd. +Copyright: © 2005 Gustavo Noronha Silva +Copyright: © 2006-2007 Sebastian Heinlein +License: GPL-2+ + +Files: doc/source/* +Copyright: © 2009 Julian Andres Klode +License: GPL-2+ + +Files: utils/get_*.py +Copyright: © 2006 Free Software Foundation Europe +License: GPL-2+ + +Files: po/* +Copyright: © 2006 Canonical Ltd, and Rosetta Contributors 2006 +License: GPL-2+ + +Files: po/de.po +Copyright: © 2005 Michiel Sikkes +License: GPL-2+ + +Files: po/en_CA.po +Copyright: © 2005 Adam Weinberger and the GNOME Foundation +License: GPL-2+ + +Files: po/fi.po +Copyright: © 2005-2006 Timo Jyrinki +License: GPL-2+ + +Files: po/fr.po +Copyright: © 2007 Hugues NAULET +License: GPL-2+ + +Files: po/hu.po, po/lt.po, po/pt.po, po/ro.po, po/rw.po, po/sv.po, po/uk.po, + po/zh_HK.po +Copyright: © 2005-2006 Free Software Foundation +License: GPL-2+ + +License: GPL-2+ + 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 + found in /usr/share/common-licenses/GPL-2. -- cgit v1.2.3