ebs-linuxnode-core 3.2.2__tar.gz → 3.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ebs_linuxnode_core-3.2.2/ebs_linuxnode_core.egg-info → ebs_linuxnode_core-3.2.3}/PKG-INFO +1 -1
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/config.py +45 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3/ebs_linuxnode_core.egg-info}/PKG-INFO +1 -1
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/SOURCES.txt +2 -0
- ebs_linuxnode_core-3.2.3/ebs_linuxnode_core.egg-info/scm_file_list.json +24 -0
- ebs_linuxnode_core-3.2.3/ebs_linuxnode_core.egg-info/scm_version.json +8 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/setup.py +1 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/.gitignore +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/__init__.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/__init__.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/__init__.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/background.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/basemixin.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/basenode.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/busy.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/constants.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/http.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/log.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/nodeid.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/resources.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/shell.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/core/tempfs.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/db/__init__.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs/linuxnode/db/sequence.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/dependency_links.txt +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/requires.txt +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/top_level.txt +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/example.py +0 -0
- {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/setup.cfg +0 -0
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
import os
|
|
11
|
+
import shutil
|
|
11
12
|
import pkg_resources
|
|
13
|
+
|
|
14
|
+
from pathlib import Path
|
|
12
15
|
from six.moves.configparser import ConfigParser
|
|
13
16
|
from collections import namedtuple
|
|
14
17
|
from appdirs import user_config_dir
|
|
@@ -37,6 +40,48 @@ class IoTNodeConfig(object):
|
|
|
37
40
|
def appname(self):
|
|
38
41
|
return self._appname
|
|
39
42
|
|
|
43
|
+
def config_dir(self):
|
|
44
|
+
"""
|
|
45
|
+
Return the application's configuration directory.
|
|
46
|
+
|
|
47
|
+
This is the same directory used by IoTNodeConfig for
|
|
48
|
+
config.ini.
|
|
49
|
+
"""
|
|
50
|
+
path = Path(user_config_dir(self.appname))
|
|
51
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
52
|
+
return path
|
|
53
|
+
|
|
54
|
+
def ensure_app_resource(self, filename):
|
|
55
|
+
"""
|
|
56
|
+
Return the user-editable copy of a packaged resource.
|
|
57
|
+
|
|
58
|
+
On first execution the packaged resource is copied into the
|
|
59
|
+
application's configuration directory.
|
|
60
|
+
|
|
61
|
+
Subsequent executions always use the copy from the
|
|
62
|
+
configuration directory.
|
|
63
|
+
|
|
64
|
+
Deleting the copied file restores the packaged default on the
|
|
65
|
+
next application start.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
destination = self.config_dir() / filename
|
|
69
|
+
|
|
70
|
+
if destination.exists():
|
|
71
|
+
return destination
|
|
72
|
+
|
|
73
|
+
destination.parent.mkdir(
|
|
74
|
+
parents=True,
|
|
75
|
+
exist_ok=True,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
shutil.copy2(
|
|
79
|
+
self.get_path(f"resources/{filename}"),
|
|
80
|
+
destination
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return destination
|
|
84
|
+
|
|
40
85
|
@property
|
|
41
86
|
def _config_file(self):
|
|
42
87
|
return os.path.join(user_config_dir(self.appname), 'config.ini')
|
{ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/SOURCES.txt
RENAMED
|
@@ -22,4 +22,6 @@ ebs_linuxnode_core.egg-info/PKG-INFO
|
|
|
22
22
|
ebs_linuxnode_core.egg-info/SOURCES.txt
|
|
23
23
|
ebs_linuxnode_core.egg-info/dependency_links.txt
|
|
24
24
|
ebs_linuxnode_core.egg-info/requires.txt
|
|
25
|
+
ebs_linuxnode_core.egg-info/scm_file_list.json
|
|
26
|
+
ebs_linuxnode_core.egg-info/scm_version.json
|
|
25
27
|
ebs_linuxnode_core.egg-info/top_level.txt
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".gitignore",
|
|
4
|
+
"setup.py",
|
|
5
|
+
"example.py",
|
|
6
|
+
"ebs/__init__.py",
|
|
7
|
+
"ebs/linuxnode/__init__.py",
|
|
8
|
+
"ebs/linuxnode/db/sequence.py",
|
|
9
|
+
"ebs/linuxnode/db/__init__.py",
|
|
10
|
+
"ebs/linuxnode/core/log.py",
|
|
11
|
+
"ebs/linuxnode/core/shell.py",
|
|
12
|
+
"ebs/linuxnode/core/tempfs.py",
|
|
13
|
+
"ebs/linuxnode/core/config.py",
|
|
14
|
+
"ebs/linuxnode/core/__init__.py",
|
|
15
|
+
"ebs/linuxnode/core/basemixin.py",
|
|
16
|
+
"ebs/linuxnode/core/background.py",
|
|
17
|
+
"ebs/linuxnode/core/basenode.py",
|
|
18
|
+
"ebs/linuxnode/core/constants.py",
|
|
19
|
+
"ebs/linuxnode/core/resources.py",
|
|
20
|
+
"ebs/linuxnode/core/http.py",
|
|
21
|
+
"ebs/linuxnode/core/busy.py",
|
|
22
|
+
"ebs/linuxnode/core/nodeid.py"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/requires.txt
RENAMED
|
File without changes
|
{ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.2.3}/ebs_linuxnode_core.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|