File: ldminfod

package info (click to toggle)
ltsp 0.99debian11%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 972 kB
  • ctags: 103
  • sloc: sh: 1,320; python: 485; ansic: 436; lex: 152; makefile: 129; yacc: 58
file content (30 lines) | stat: -rwxr-xr-x 907 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
#!/usr/bin/python
import sys
from subprocess import *
if __name__ == "__main__":
    # Get list of valid locales from locale -a
    try:
        lines = Popen(['locale', '-a'], stdout=PIPE).communicate()[0]

    except OSError:
        print "ERROR"
        sys.exit(0)
    langs = lines.split(None)
    for lang in langs:
        lang=lang.rstrip()
        if lang.endswith('.utf8'):
            # locale returns .utf8 when we want .UTF-8
            lang=lang.replace('.utf8','.UTF-8')
        if lang != 'POSIX' and lang != 'C':
            print lang
    print
    try:
        lines=[]
        for alternative in ['x-session-manager','x-window-manager']:
            lines.append(Popen(['/usr/sbin/update-alternatives', '--list', alternative ],
                      stdout=PIPE).communicate()[0])
    except OSError:
        print "ERROR"
        sys.exit(0)
    for line in lines:
        print line