~jjed/app-install-data-ubuntu/new-extract

« back to all changes in this revision

Viewing changes to utils/find_missing_icons.py

  • Committer: Michael Vogt
  • Date: 2011-04-19 13:30:31 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110419133031-ljuh6uapfh7b04f5
utils/find_missing_icons.py: print mapping from pkgname to icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
def get_icon_cache(menudir):
12
12
    icons = gtk.icon_theme_get_default()
13
 
    icons.set_search_path([os.path.join(menudir, "icons")])
14
 
 
 
13
    icons.set_search_path([os.path.join(menudir, "icons"),
 
14
                           "/usr/share/icons/hicolor",
 
15
                           "/usr/share/icons/gnome",
 
16
                           ])
15
17
    return icons
16
18
 
17
19
 
45
47
    subprocess.call(["wget", "-c", 
46
48
                     "http://archive.ubuntu.com/ubuntu/dists/%s/%s" % (
47
49
                distroseries, contents)])
 
50
    
 
51
    all_finds = {}
48
52
    for line in gzip.open(contents):
49
53
        (path, sep, component_section_packages) = line.strip().partition(" ")
50
54
        basename = os.path.basename(path)
51
55
        extension = os.path.splitext(basename)[1]
52
56
        if not extension in (".svg", ".png", ".xpm", ".tiff"):
53
57
            continue
 
58
        found = None
54
59
        if path in missing:
55
 
            print "found full path '%s' in '%s'" % (path, component_section_packages)
 
60
            #print "found full path '%s' in '%s'" % (path, component_section_packages)
56
61
            missing.remove(path)
 
62
            found = path
57
63
        elif basename in missing:
58
 
            print "found basename '%s' in '%s'" % (path, component_section_packages)       
 
64
            #print "found basename '%s' in '%s'" % (path, component_section_packages)       
59
65
            missing.remove(basename)
 
66
            found = basename
60
67
        elif os.path.splitext(basename)[0] in missing:
61
 
            print "found basename with no extension '%s' in '%s'" % (path, component_section_packages)
 
68
            #print "found basename with no extension '%s' in '%s'" % (path, component_section_packages)
62
69
            missing.remove(os.path.splitext(basename)[0])
63
 
            
 
70
            found = os.path.splitext(basename)[0]
 
71
        if found:
 
72
            pkgname = os.path.basename(component_section_packages)
 
73
            if "icon-theme" in pkgname:
 
74
                continue
 
75
            if not pkgname in all_finds:
 
76
                all_finds[pkgname] = []
 
77
            all_finds[pkgname].append(found)
 
78
 
 
79
    print "pkgname -> icons"
 
80
    print all_finds