1 # -*- coding: utf-8 -*- |
1 # -*- coding: utf-8 -*- |
2 |
2 # |
3 # Copyright (c) 2002 - 2017 Detlev Offenbach <detlev@die-offenbachs.de> |
3 # This module contains the configuration of the individual eric6 installation |
4 # |
4 # |
5 |
5 |
6 # |
|
7 # This module contains the configuration of the individual eric installation |
|
8 # |
|
9 |
|
10 """ |
|
11 Module containing the default configuration of the eric6 installation. |
|
12 """ |
|
13 |
|
14 from __future__ import unicode_literals |
|
15 |
|
16 import sys |
|
17 import os |
|
18 |
|
19 __ericDir = os.path.dirname(sys.argv[0]) |
|
20 |
|
21 _pkg_config = { |
6 _pkg_config = { |
22 'ericDir': __ericDir, |
7 'ericDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6', |
23 'ericPixDir': os.path.join(__ericDir, 'pixmaps'), |
8 'ericPixDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/pixmaps', |
24 'ericIconDir': os.path.join(__ericDir, 'icons'), |
9 'ericIconDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/icons', |
25 'ericDTDDir': os.path.join(__ericDir, 'DTDs'), |
10 'ericDTDDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/DTDs', |
26 'ericCSSDir': os.path.join(__ericDir, 'CSSs'), |
11 'ericCSSDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/CSSs', |
27 'ericStylesDir': os.path.join(__ericDir, "Styles"), |
12 'ericStylesDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/Styles', |
28 'ericDocDir': os.path.join(__ericDir, 'Documentation'), |
13 'ericDocDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/Documentation', |
29 'ericExamplesDir': os.path.join(__ericDir, 'Examples'), |
14 'ericExamplesDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/Examples', |
30 'ericTranslationsDir': os.path.join(__ericDir, 'i18n'), |
15 'ericTranslationsDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/i18n', |
31 'ericTemplatesDir': os.path.join(__ericDir, 'DesignerTemplates'), |
16 'ericTemplatesDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/DesignerTemplates', |
32 'ericCodeTemplatesDir': os.path.join(__ericDir, 'CodeTemplates'), |
17 'ericCodeTemplatesDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6/CodeTemplates', |
33 'ericOthersDir': __ericDir, |
18 'ericOthersDir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/eric6', |
34 'bindir': __ericDir, |
19 'bindir': r'/Users/detlev/py3qt50env/bin', |
35 'mdir': __ericDir, |
20 'mdir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages', |
|
21 'apidir': r'/Users/detlev/py3qt50env/lib/python3.6/site-packages/PyQt5/Qt/qsci/api', |
|
22 'apis': ['zope-2.10.7.api', 'zope-2.11.2.api', 'zope-3.3.1.api', 'eric6.api', 'Ruby-1.8.7.api', 'Ruby-1.9.1.api', 'qss.api'], |
|
23 'macAppBundlePath': r'/Applications', |
|
24 'macAppBundleName': r'eric6.app', |
36 } |
25 } |
37 |
26 |
38 |
|
39 def getConfig(name): |
27 def getConfig(name): |
40 """ |
28 ''' |
41 Module function to get a configuration value. |
29 Module function to get a configuration value. |
42 |
30 |
43 @param name the name of the configuration value (string). |
31 @param name name of the configuration value (string) |
44 @return requested config value |
32 ''' |
45 @exception AttributeError raised to indicate an invalid config entry |
|
46 """ |
|
47 try: |
33 try: |
48 return _pkg_config[name] |
34 return _pkg_config[name] |
49 except KeyError: |
35 except KeyError: |
50 pass |
36 pass |
51 |
37 |
52 raise AttributeError( |
38 raise AttributeError('"{0}" is not a valid configuration value'.format(name)) |
53 '"{0}" is not a valid configuration value'.format(name)) |
|