|
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 eric4 installation |
|
8 """ |
|
9 |
|
10 import sys |
|
11 import os |
|
12 |
|
13 __ericDir = os.path.dirname(sys.argv[0]) |
|
14 |
|
15 _pkg_config = { |
|
16 'ericDir' : __ericDir, |
|
17 'ericPixDir' : os.path.join(__ericDir, 'pixmaps'), |
|
18 'ericIconDir' : os.path.join(__ericDir, 'icons'), |
|
19 'ericDTDDir' : os.path.join(__ericDir, 'DTDs'), |
|
20 'ericCSSDir' : os.path.join(__ericDir, 'CSSs'), |
|
21 'ericStylesDir' : os.path.join(__ericDir, "Styles"), |
|
22 'ericDocDir' : os.path.join(__ericDir, 'Documentation'), |
|
23 'ericExamplesDir' : os.path.join(__ericDir, 'Examples'), |
|
24 'ericTranslationsDir' : os.path.join(__ericDir, 'i18n'), |
|
25 'ericTemplatesDir' : os.path.join(__ericDir, 'DesignerTemplates'), |
|
26 'ericCodeTemplatesDir' : os.path.join(__ericDir, 'CodeTemplates'), |
|
27 'ericOthersDir' : __ericDir, |
|
28 'bindir' : __ericDir, |
|
29 'mdir' : __ericDir, |
|
30 } |
|
31 |
|
32 def getConfig(name): |
|
33 ''' |
|
34 Module function to get a configuration value. |
|
35 |
|
36 @param name the name of the configuration value (string). |
|
37 ''' |
|
38 try: |
|
39 return _pkg_config[name] |
|
40 except KeyError: |
|
41 pass |
|
42 |
|
43 raise AttributeError, '"%s" is not a valid configuration value' % name |