|
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)) |