403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : 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,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/bin/fontconfig-voodoo
#!/usr/bin/python

import sys
from optparse import OptionParser

from LanguageSelector import FontConfig
from gettext import gettext as _


def main():
    
    def abort(msg=None):
        " helper for a clean abort "
        if not options.silent:
            if msg:
                print msg
            print _("Aborting")
        sys.exit(1)

    usage = "usage: %prog [options]"
    # init the option parser
    parser = OptionParser(usage)
    parser.add_option("-f", "--force", dest="force",
                      action="store_true",
                      help=_("Force even when a configuration exists"))
    parser.add_option("-s", "--set", dest="lang",
                      help=_("Set fontconfig voodoo for the selected "
                             "language"))
    parser.add_option("-a", "--auto", dest="auto",
                      action="store_true",
                      help=_("Guess a configuration based on the "
                             "LANGUAGE environment. Sets the config to "
                             "'none' if nothing suitable was found"))
    parser.add_option("-l", "--list", dest="list",
                      action="store_true",
                      help=_("List the available fontconfig-voodoo configs"))
    parser.add_option("-c", "--current", dest="show_current",
                      action="store_true",
                      help=_("Show the current fontconfig-voodoo config"))
    parser.add_option("-r", "--remove-current", dest="remove_current",
                      action="store_true",
                      help=_("Remove the current fontconfig-voodoo config"))
    parser.add_option("-q", "--quiet",
                      action="store_true", dest="silent", default=False)

    # check if we have arguments at all
    if len(sys.argv[1:]) == 0:
        parser.print_help()
        sys.exit(0)

    # parse them
    (options, args) = parser.parse_args()

    # do the work
    fc = FontConfig.FontConfigHack()

    if options.show_current:
        try:
            if options.silent:
                print fc.getCurrentConfig()
            else:
                print "Current config: %s" % fc.getCurrentConfig()
        except FontConfig.ExceptionUnconfigured:
            print _("Unconfigured")
        sys.exit(0)

    if options.list:
        print "\n".join(fc.getAvailableConfigs())
        sys.exit(0)
        
    if options.remove_current:
        fc.removeConfig()
        sys.exit(0)

    if not options.force:
        try:
            fc.getCurrentConfig()
            # if this does not raise a "Unconfigured" exception, we
            # abort here
            abort(_("A configuration exists already. Use '--force' to "
                    "overwrite it. "))
        except FontConfig.ExceptionUnconfigured:
            pass

    if options.auto:
        try:
            fc.setConfigBasedOnLocale()
        except FontConfig.ExceptionNoConfigForLocale:
            abort(_("No fontconfig-voodoo configuration found for the "
                    "current LANGUAGE"))

    if options.lang:
        try:
            fc.setConfig(options.lang)
        except FontConfig.ExceptionNoConfigForLocale:
            abort(_("No fontconfig-voodoo configuration found for the "
                    "selected locale"))

    
if __name__ == "__main__":
    main()

Youez - 2016 - github.com/yon3zu
LinuXploit