eric6config.py

changeset 3669
ac84ac3c0f05
parent 3145
a9de05d4a22f
child 3670
f0cb7579c0b4
equal deleted inserted replaced
3668:0e83d06e5429 3669:ac84ac3c0f05
1 # -*- coding: utf-8 -*-
2 #
3 # This module contains the configuration of the individual eric installation
4 #
5
6 """
7 Module containing the default configuration of the eric5 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 the name of the configuration value (string).
40 @return requested config value
41 @exception AttributeError raised to indicate an invalid config entry
42 """
43 try:
44 return _pkg_config[name]
45 except KeyError:
46 pass
47
48 raise AttributeError(
49 '"{0}" is not a valid configuration value'.format(name))

eric ide

mercurial