ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:27.45 GB of 70.42 GB (38.98%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ lib/ python2.6/ dist-packages/ LanguageSelector/ - drwxr-xr-x

Directory:
Viewing file:     xkb.py (2.42 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import libxml2, sys

class Variant:
    def __init__(self, name, desc, raw_desc):
        self.name = name
        self.desc = desc
        self.raw_desc = raw_desc

    def __str__(self):
        return "%s: %s, %s" % (self.name, self.desc, self.raw_desc)

class Layout:
    def __init__(self, name, desc, raw_desc, short_desc, raw_short_desc, variants):
        self.name = name
        self.desc = desc
        self.raw_desc = raw_desc
        self.short_desc = short_desc
        self.raw_short_desc = raw_short_desc
        self.variants = variants
        
    def __str__(self):
        return "%s: %s, %s; %s, %s;; %s" % (self.name,self.desc,self.raw_desc,self.short_desc,self.raw_short_desc,["%s" % x for x in self.variants])

def get_all_layout_possibilities():
    possibility_list = list()
    
    #FIXME: don't call parseFile() twice
    doc = libxml2.parseFile("/etc/X11/xkb/rules/xorg.xml")
    ctxt = doc.xpathNewContext()
            
    for i in ctxt.xpathEval("/xkbConfigRegistry/layoutList/layout/configItem/name/text()"):
        possibility_list.append(i.content)
    
    return possibility_list

def get_variants(layout_node, lang):
    variant_list = list()

    variant_nodes = layout_node.xpathEval("../../../variantList/variant/configItem/name/text()")
    for i in variant_nodes:
        if len(i.xpathEval("../description[@xml:lang='%s']" % lang)) > 0:
            trans = i.xpathEval("../description[@xml:lang='%s']" % lang)[0]
        else:
            trans = ""

        v = Variant(i.content, trans, i.xpathEval("../../description[position()=1]")[0].content)
        variant_list.append(v)
    
    return variant_list


def get_layouts(lang):
    layout_list = list()
    doc = libxml2.parseFile("/etc/X11/xkb/rules/xorg.xml")
    ctxt = doc.xpathNewContext()
    layout_nodes = ctxt.xpathEval("/xkbConfigRegistry/layoutList/layout/configItem/name/text()")

    for i in layout_nodes:
        if i.content == lang:
            if (len(i.xpathEval("../description[@xml:lang='%s']" % lang)) > 0):
                translation = i.xpathEval("../description[@xml:lang='%s']" % lang)[0]
            else:
                translation = ""
            if (len(i.xpathEval("../description[@xml:lang='%s']" % lang)) > 0):
                short_trans = i.xpathEval("../shortDescription[@xml:lang='%s']" % lang)[0]
            else:
                short_trans = ""

            layout_list.append(Layout(i.content, 
                translation, i.xpathEval("../../description[position()=1]")[0].content, 
                short_trans, i.xpathEval("../../shortDescription[position()=1]")[0].content,
                get_variants(i, lang)))

    return layout_list


if __name__ == "__main__":
    for i in get_layouts("fr"): 
        print i

    for i in get_all_layout_possibilities():
        print i
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.3562 seconds