eric6/eric6config.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 6949
a5255f1ba3f0
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2002 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module containing the default configuration of the eric6 installation.
8 """
9
10 from __future__ import unicode_literals
11
12 import sys
13 import os
14
15 __ericDir = os.path.dirname(sys.argv[0])
16
17 _pkg_config = {
18 'ericDir': __ericDir,
19 'ericPixDir': os.path.join(__ericDir, 'pixmaps'),
20 'ericIconDir': os.path.join(__ericDir, 'icons'),
21 'ericDTDDir': os.path.join(__ericDir, 'DTDs'),
22 'ericCSSDir': os.path.join(__ericDir, 'CSSs'),
23 'ericStylesDir': os.path.join(__ericDir, "Styles"),
24 'ericDocDir': os.path.join(__ericDir, 'Documentation'),
25 'ericExamplesDir': os.path.join(__ericDir, 'Examples'),
26 'ericTranslationsDir': os.path.join(__ericDir, 'i18n'),
27 'ericTemplatesDir': os.path.join(__ericDir, 'DesignerTemplates'),
28 'ericCodeTemplatesDir': os.path.join(__ericDir, 'CodeTemplates'),
29 'ericOthersDir': __ericDir,
30 'bindir': __ericDir,
31 'mdir': __ericDir,
32 }
33
34
35 def getConfig(name):
36 """
37 Module function to get a configuration value.
38
39 @param name name of the configuration value
40 @type str
41 @return requested config value
42 @exception AttributeError raised to indicate an invalid config entry
43 """
44 try:
45 return _pkg_config[name]
46 except KeyError:
47 pass
48
49 raise AttributeError(
50 '"{0}" is not a valid configuration value'.format(name))

eric ide

mercurial