-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathConfigInstall.py
More file actions
71 lines (47 loc) · 1.86 KB
/
ConfigInstall.py
File metadata and controls
71 lines (47 loc) · 1.86 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
####################################################################################################
import os
import sys
####################################################################################################
import PySpice.Tools.Path as PathTools # Fixme: why ?
####################################################################################################
class OsFactory:
##############################################
def __init__(self):
if sys.platform.startswith('linux'):
self._name = 'linux'
elif sys.platform.startswith('win'):
self._name = 'windows'
elif sys.platform.startswith('darwin'):
self._name = 'osx'
elif sys.platform.startswith('freebsd'):
self._name = 'freebsd'
##############################################
@property
def name(self):
return self._name
@property
def on_linux(self):
return self._name == 'linux'
@property
def on_windows(self):
return self._name == 'windows'
@property
def on_osx(self):
return self._name == 'osx'
@property
def on_freebsd(self):
return self._name == 'freebsd'
OS = OsFactory()
####################################################################################################
_this_file = PathTools.to_absolute_path(__file__)
class Path:
pyspice_module_directory = PathTools.parent_directory_of(_this_file, step=2)
config_directory = os.path.dirname(_this_file)
####################################################################################################
class Logging:
default_config_file = 'logging.yml'
directories = (Path.config_directory,)
##############################################
@staticmethod
def find(config_file):
return PathTools.find(config_file, Logging.directories)