Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/samples/get_language_variants.py
blob: 6cfbda7d9c70c23cadd2c8901de697a339f112ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python

import xklavier
import gtk

def print_variant(c_reg, item, subitem):
    print ('\t %s (%s)' % (item.get_description(), item.get_name()))
    if subitem:
        print ('\t\t %s (%s)' % (subitem.get_description(), subitem.get_name()))

def print_language(c_reg, item):
    print ('\n%s (%s)' % (item.get_description(), item.get_name()))
    c_reg.foreach_language_variant(item.get_name(), print_variant)
    
display = gtk.gdk.display_get_default()
engine = xklavier.Engine(display)
configreg = xklavier.ConfigRegistry(engine)

configreg.load(False)
configreg.foreach_language(print_language)