summaryrefslogtreecommitdiff
path: root/doc/source/examples/update-print-uris.py
blob: dbe1dfde58854e77f0fe1f1db038fa3700414c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
"""Print out the URIs of all indexes files.

This behaves somewhat like apt-get --print-uris update."""
import apt_pkg


def main():
    apt_pkg.init_config()
    apt_pkg.init_system()
    acquire = apt_pkg.Acquire()
    slist = apt_pkg.SourceList()
    # Read the list
    slist.read_main_list()
    # Add all indexes to the fetcher.
    slist.get_indexes(acquire, True)

    # Now print the URI of every item.
    for item in acquire.items:
        print item.desc_uri

if __name__ == '__main__':
    main()