ebs-linuxnode-core 3.2.2__tar.gz → 3.3.0__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.
Files changed (29) hide show
  1. {ebs_linuxnode_core-3.2.2/ebs_linuxnode_core.egg-info → ebs_linuxnode_core-3.3.0}/PKG-INFO +2 -1
  2. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/config.py +45 -0
  3. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0/ebs_linuxnode_core.egg-info}/PKG-INFO +2 -1
  4. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs_linuxnode_core.egg-info/SOURCES.txt +2 -0
  5. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs_linuxnode_core.egg-info/requires.txt +1 -0
  6. ebs_linuxnode_core-3.3.0/ebs_linuxnode_core.egg-info/scm_file_list.json +24 -0
  7. ebs_linuxnode_core-3.3.0/ebs_linuxnode_core.egg-info/scm_version.json +8 -0
  8. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/setup.py +1 -0
  9. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/.gitignore +0 -0
  10. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/__init__.py +0 -0
  11. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/__init__.py +0 -0
  12. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/__init__.py +0 -0
  13. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/background.py +0 -0
  14. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/basemixin.py +0 -0
  15. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/basenode.py +0 -0
  16. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/busy.py +0 -0
  17. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/constants.py +0 -0
  18. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/http.py +0 -0
  19. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/log.py +0 -0
  20. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/nodeid.py +0 -0
  21. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/resources.py +0 -0
  22. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/shell.py +0 -0
  23. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/core/tempfs.py +0 -0
  24. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/db/__init__.py +0 -0
  25. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs/linuxnode/db/sequence.py +0 -0
  26. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs_linuxnode_core.egg-info/dependency_links.txt +0 -0
  27. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/ebs_linuxnode_core.egg-info/top_level.txt +0 -0
  28. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/example.py +0 -0
  29. {ebs_linuxnode_core-3.2.2 → ebs_linuxnode_core-3.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ebs-linuxnode-core
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: Twisted based linux application node core
5
5
  Home-page: https://github.com/ebs-universe/ebs-linuxnode-core
6
6
  Author: Chintalagiri Shashank
@@ -24,3 +24,4 @@ Requires-Dist: ifcfg
24
24
  Requires-Dist: psutil
25
25
  Requires-Dist: memory_tempfile
26
26
  Requires-Dist: treq
27
+ Requires-Dist: standard-pkg-resources
@@ -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')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ebs-linuxnode-core
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: Twisted based linux application node core
5
5
  Home-page: https://github.com/ebs-universe/ebs-linuxnode-core
6
6
  Author: Chintalagiri Shashank
@@ -24,3 +24,4 @@ Requires-Dist: ifcfg
24
24
  Requires-Dist: psutil
25
25
  Requires-Dist: memory_tempfile
26
26
  Requires-Dist: treq
27
+ Requires-Dist: standard-pkg-resources
@@ -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
@@ -10,3 +10,4 @@ ifcfg
10
10
  psutil
11
11
  memory_tempfile
12
12
  treq
13
+ standard-pkg-resources
@@ -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
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "3.2.2",
3
+ "distance": 0,
4
+ "node": "g867c9835ebaf141a8f9011cadfd61a26853afc16",
5
+ "dirty": true,
6
+ "branch": "main",
7
+ "node_date": "2025-10-18"
8
+ }
@@ -19,6 +19,7 @@ _requires = [
19
19
 
20
20
  # HTTP Client
21
21
  'treq',
22
+ 'standard-pkg-resources',
22
23
  ]
23
24
 
24
25
  setuptools.setup(