-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy patheric6config.py
53 lines (42 loc) · 1.47 KB
/
eric6config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
# Copyright (c) 2002 - 2016 Detlev Offenbach <[email protected]>
#
#
# This module contains the configuration of the individual eric installation
#
"""
Module containing the default configuration of the eric6 installation.
"""
from __future__ import unicode_literals
import sys
import os
__ericDir = os.path.dirname(sys.argv[0])
_pkg_config = {
'ericDir': __ericDir,
'ericPixDir': os.path.join(__ericDir, 'pixmaps'),
'ericIconDir': os.path.join(__ericDir, 'icons'),
'ericDTDDir': os.path.join(__ericDir, 'DTDs'),
'ericCSSDir': os.path.join(__ericDir, 'CSSs'),
'ericStylesDir': os.path.join(__ericDir, "Styles"),
'ericDocDir': os.path.join(__ericDir, 'Documentation'),
'ericExamplesDir': os.path.join(__ericDir, 'Examples'),
'ericTranslationsDir': os.path.join(__ericDir, 'i18n'),
'ericTemplatesDir': os.path.join(__ericDir, 'DesignerTemplates'),
'ericCodeTemplatesDir': os.path.join(__ericDir, 'CodeTemplates'),
'ericOthersDir': __ericDir,
'bindir': __ericDir,
'mdir': __ericDir,
}
def getConfig(name):
"""
Module function to get a configuration value.
@param name the name of the configuration value (string).
@return requested config value
@exception AttributeError raised to indicate an invalid config entry
"""
try:
return _pkg_config[name]
except KeyError:
pass
raise AttributeError(
'"{0}" is not a valid configuration value'.format(name))