VirtualMailManager/__init__.py
changeset 760 b678a1c43027
parent 748 659c4476c57c
child 761 e4e656f19771
equal deleted inserted replaced
748:659c4476c57c 760:b678a1c43027
     1 # -*- coding: UTF-8 -*-
       
     2 # Copyright (c) 2007 - 2014, Pascal Volk
       
     3 # See COPYING for distribution information.
       
     4 """
       
     5     VirtualMailManager
       
     6     ~~~~~~~~~~~~~~~~~~
       
     7 
       
     8     VirtualMailManager package initialization code
       
     9 """
       
    10 
       
    11 import gettext
       
    12 import locale
       
    13 import sys
       
    14 
       
    15 from VirtualMailManager.constants import __author__, __date__, __version__
       
    16 
       
    17 __all__ = [
       
    18     # version information from VERSION
       
    19     '__author__', '__date__', '__version__',
       
    20     # defined stuff
       
    21     'ENCODING',
       
    22 ]
       
    23 
       
    24 
       
    25 # Try to set all of the locales according to the current
       
    26 # environment variables and get the character encoding.
       
    27 try:
       
    28     locale.setlocale(locale.LC_ALL, '')
       
    29 except locale.Error:
       
    30     sys.stderr.write('warning: unsupported locale setting - '
       
    31                      'that may cause encoding problems.\n\n')
       
    32     locale.setlocale(locale.LC_ALL, 'C')
       
    33 ENCODING = locale.nl_langinfo(locale.CODESET)
       
    34 
       
    35 gettext.install('vmm', '/usr/local/share/locale', unicode=1)