File: missing-screenshots.py

package info (click to toggle)
solfege 3.16.4-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 34,472 kB
  • ctags: 5,287
  • sloc: python: 22,642; xml: 14,196; ansic: 4,682; makefile: 621; sh: 287
file content (20 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python

import os
import glob
import sys

# ignore because they are screenshots in untranslated files:
IGNORE = ['chordname-example.png', 'progressionlabel-example-1.png', 'rnc-example.png']
exitval = 0
C_files = [os.path.split(n)[1] for n in glob.glob("help/C/figures/*.png")]
languages = [n for n in glob.glob("help/*") if os.path.isdir(n) and n != 'help/C']
for lang in languages:
    lang_files = [os.path.split(n)[1] for n in glob.glob("%s/figures/*.png" % lang)]
    missing_files = [n for n in C_files if n not in lang_files and n not in IGNORE]
    if missing_files:
        print "\nMissing screenshots for %s locale" % os.path.split(lang)[1]
        print missing_files
        exitval = -1

sys.exit(exitval)