cjnfuncs 2.4__tar.gz → 2.4.1__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.
- {cjnfuncs-2.4/src/cjnfuncs.egg-info → cjnfuncs-2.4.1}/PKG-INFO +1 -1
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/pyproject.toml +3 -1
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/resourcelock.py +10 -2
- {cjnfuncs-2.4 → cjnfuncs-2.4.1/src/cjnfuncs.egg-info}/PKG-INFO +1 -1
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/LICENSE.txt +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/README.md +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/setup.cfg +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/SMTP.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/__init__.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/configman.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/core.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/deployfiles.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/mungePath.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs/timevalue.py +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs.egg-info/SOURCES.txt +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs.egg-info/dependency_links.txt +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs.egg-info/entry_points.txt +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs.egg-info/requires.txt +0 -0
- {cjnfuncs-2.4 → cjnfuncs-2.4.1}/src/cjnfuncs.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,9 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "cjnfuncs"
|
|
8
|
-
version = "2.4"
|
|
8
|
+
version = "2.4.1"
|
|
9
|
+
# 2.4.1 - resource_lock only init lock_info if not existing
|
|
10
|
+
# 2.4.1b1 - resource_lock only init lock_info if not existing
|
|
9
11
|
# 2.4 - release
|
|
10
12
|
# 2.4rc2 - check_path_exists() exception fix for unmounted network path (OSError: [Errno 19] No such device)
|
|
11
13
|
# 2.4rc1 - doc fix on setuplogging()
|
|
@@ -46,6 +46,8 @@ process completes its work, and then acquire the I2C bus lock so that other proc
|
|
|
46
46
|
- Resource locks are on the honor system. Any process can unget a lock, but should not if it didn't get the lock.
|
|
47
47
|
- This lock mechanism is just as effective across threads within a process.
|
|
48
48
|
- As many different/independent locks as needed may be created.
|
|
49
|
+
- The first time a lock is created (on the current computer since reboot) the lock info string (accessible via `get_lock_info()`)
|
|
50
|
+
is set to '', else it retains the value set by the most recent get_lock() call.
|
|
49
51
|
- It is recommended (in order to avoid a minor memory leak) to `close()` the lock in the tool script cleanup code.
|
|
50
52
|
Calling `close()` sets the `closed` attribute to True so that any following code can detect and re-instantiate the
|
|
51
53
|
lock if needed.
|
|
@@ -90,10 +92,16 @@ checked and re-instantiate if needed.
|
|
|
90
92
|
self.I_have_the_lock = False
|
|
91
93
|
self.lock = posix_ipc.Semaphore(self.lockname, flags=posix_ipc.O_CREAT, mode=0o0600, initial_value=1)
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
preexisting = False
|
|
96
|
+
try:
|
|
97
|
+
memory = posix_ipc.SharedMemory(self.lockname, flags=0)
|
|
98
|
+
preexisting = True
|
|
99
|
+
except posix_ipc.ExistentialError:
|
|
100
|
+
memory = posix_ipc.SharedMemory(self.lockname, flags=posix_ipc.O_CREAT, mode=0o0600, size=4096)
|
|
101
|
+
|
|
94
102
|
self.mapfile = mmap.mmap(memory.fd, memory.size)
|
|
95
103
|
os.close(memory.fd)
|
|
96
|
-
if not
|
|
104
|
+
if not preexisting:
|
|
97
105
|
self._set_lock_info('')
|
|
98
106
|
|
|
99
107
|
|
|
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
|