diff options
| -rw-r--r-- | apt/history.py | 55 | ||||
| -rw-r--r-- | debian/changelog | 2 |
2 files changed, 0 insertions, 57 deletions
diff --git a/apt/history.py b/apt/history.py deleted file mode 100644 index f056e67e..00000000 --- a/apt/history.py +++ /dev/null @@ -1,55 +0,0 @@ -# histoy.py - apt package abstraction -# -# Copyright (c) 2005-2009 Canonical -# -# Author: Michael Vogt <michael.vogt@ubuntu.com> -# -# 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 -"""Functionality related to the apt history file.""" - -import apt_pkg -apt_pkg.InitConfig() - -import gzip -import string - -class Transaction(object): - def __init__(self, sec): - self.start_date = sec.has_key("Start-Date") - for k in ["Install", "Upgrade", "Downgrade" "Remove", "Purge","Error"]: - if sec.has_key(k): - setattr(self, k.lower(), map(string.strip, sec[k].split(","))) - else: - setattr(self, k.lower(), None) - - -class AptHistory(dict): - def __init__(self, history_file=None): - if not history_file: - history_file = apt_pkg.Config.FindFile("Dir::Log::History") - # FIXME: test for .gz ending - f = open(history_file) - self._tagfile = apt_pkg.ParseTagFile(f) - while self._tagfile.Step(): - sec = self._tagfile.Section - start_date = sec['Start-Date'] - self[start_date] = Transaction(sec) - -if __name__ == "__main__": - #h = AptHistory("/var/log/apt/history.log.1.gz") - history = AptHistory() - for date in history: - print "'%s' - '%s'" % (date, history[date].install) diff --git a/debian/changelog b/debian/changelog index d6d19bbf..fa87d5a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,6 @@ python-apt (0.7.13.5) UNRELEASED; urgency=low on non-blocking file descriptors (LP: #491027). [ Michael Vogt ] - * apt/history.py: - - simple abstraction for the apt history file * apt/cache.py: - improved docstring for the cache - add "enhances" property |
