eric4config.py

Mon, 28 Dec 2009 16:03:33 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 28 Dec 2009 16:03:33 +0000
changeset 0
de9c2efb9d02
child 12
1d8dd9706f46
permissions
-rw-r--r--

Started porting eric4 to Python3

# -*- coding: utf-8 -*-
#
# This module contains the configuration of the individual eric installation
#

"""
Module containing the default configuration of the eric4 installation
"""

import sys
import os

__ericDir = os.path.dirname(sys.argv[0])

_pkg_config = {
    'ericDir'              : __ericDir,
    'ericPixDir'           : os.path.join(__ericDir, 'pixmaps'),
    'ericIconDir'          : os.path.join(__ericDir, 'icons'),
    'ericDTDDir'           : os.path.join(__ericDir, 'DTDs'),
    'ericCSSDir'           : os.path.join(__ericDir, 'CSSs'),
    'ericStylesDir'        : os.path.join(__ericDir, "Styles"),
    'ericDocDir'           : os.path.join(__ericDir, 'Documentation'),
    'ericExamplesDir'      : os.path.join(__ericDir, 'Examples'),
    'ericTranslationsDir'  : os.path.join(__ericDir, 'i18n'),
    'ericTemplatesDir'     : os.path.join(__ericDir, 'DesignerTemplates'),
    'ericCodeTemplatesDir' : os.path.join(__ericDir, 'CodeTemplates'),
    'ericOthersDir'        : __ericDir,
    'bindir'               : __ericDir,
    'mdir'                 : __ericDir,
}

def getConfig(name):
    '''
    Module function to get a configuration value.

    @param name the name of the configuration value (string).
    '''
    try:
        return _pkg_config[name]
    except KeyError:
        pass

    raise AttributeError, '"%s" is not a valid configuration value' % name

eric ide

mercurial