File: apt_history.py

package info (click to toggle)
software-center 2.0.7debian7
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,404 kB
  • ctags: 1,229
  • sloc: python: 7,922; xml: 317; makefile: 17; sh: 14
file content (25 lines) | stat: -rwxr-xr-x 661 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python

import sys
sys.path.insert(0, "..")

from softwarecenter.apt.apthistory import AptHistory

if __name__ == "__main__":

    # current
    history = AptHistory()
    for trans in history.transactions:
        print "Date: %s - Count: %s" % (trans.start_date, len(trans))
        print "".join(history.find_terminal_log(trans.start_date))
        print

    # read one from a gzip log
    print history.find_terminal_log("2009-11-04  10:41:22")

    # old
    for old in history.older_parts:
        history = AptHistory(old)
        for trans in history.transactions:
            print "older: %s (count: %s)" % (trans.start_date, len(trans))