~ubuntu-branches/ubuntu/vivid/debtags/vivid-proposed

« back to all changes in this revision

Viewing changes to libapt-front/swig/python.i

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2006-03-18 20:31:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20060318203147-d9uzdeong5f5nk14
Tags: 1.5.5
* Added dumpavail command.
* Don't rebuild the database on install: apt-index-watcher does it instead.
  Closes: #357103.
* Compiles with g++ 4.1.  Closes: #357360.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%include <file.i>
2
 
%include <std_set.i>
3
 
%include <std_string.i>
4
 
 
5
 
%extend aptFront::cache::component::Packages {
6
 
    %pythoncode %{
7
 
    def __iter__(self):
8
 
        current = Package(self.PkgBegin())
9
 
        while True:
10
 
            if not current.valid():
11
 
                return
12
 
            yield current
13
 
            current = current.nextInCache()
14
 
    %}
15
 
};
16
 
 
17
 
%extend aptFront::cache::entity::Package {
18
 
    %pythoncode %{
19
 
    def __iter__(self):
20
 
        current = self.firstVersionInCache()
21
 
        while True:
22
 
            if not current.valid():
23
 
                return
24
 
            yield current
25
 
            current = current.nextInCache()
26
 
 
27
 
    versions = __iter__
28
 
    %}
29
 
};
 
 
b'\\ No newline at end of file'