eric6config.py

Thu, 25 Jan 2018 11:54:38 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 25 Jan 2018 11:54:38 +0100
changeset 6088
b7fdd0db835e
parent 6048
82ad8ec9548c
child 6645
ad476851d7e0
permissions
-rw-r--r--

Removed use of sender() in the plug-in repository dialog and the plug-in manager.

# -*- coding: utf-8 -*-

# Copyright (c) 2002 - 2018 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module containing the default configuration of the eric6 installation.
"""

from __future__ import unicode_literals

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 name of the configuration value
    @type str
    @return requested config value
    @exception AttributeError raised to indicate an invalid config entry
    """
    try:
        return _pkg_config[name]
    except KeyError:
        pass

    raise AttributeError(
        '"{0}" is not a valid configuration value'.format(name))

eric ide

mercurial