taskcarry 0.3.2__py3-none-any.whl
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.
- taskcarry/__init__.py +3 -0
- taskcarry/__main__.py +4 -0
- taskcarry/adapter_contracts.py +166 -0
- taskcarry/agy_turns.py +282 -0
- taskcarry/api.py +111 -0
- taskcarry/board.py +313 -0
- taskcarry/board_assets/board.css +1087 -0
- taskcarry/board_assets/board.js +1187 -0
- taskcarry/board_assets/browse.js +214 -0
- taskcarry/board_assets/index.html +43 -0
- taskcarry/board_assets/taskcarry-icon.ico +0 -0
- taskcarry/board_assets/taskcarry-mark.svg +28 -0
- taskcarry/board_data.py +466 -0
- taskcarry/chat_joins.py +157 -0
- taskcarry/cli.py +119 -0
- taskcarry/codex_capture.py +184 -0
- taskcarry/codex_host.py +293 -0
- taskcarry/collaboration_exchange.py +316 -0
- taskcarry/connection.py +159 -0
- taskcarry/continuity.py +300 -0
- taskcarry/contracts.py +165 -0
- taskcarry/conversation_capture.py +669 -0
- taskcarry/core.py +896 -0
- taskcarry/cycle_contracts.py +73 -0
- taskcarry/discovery.py +434 -0
- taskcarry/discovery_contracts.py +52 -0
- taskcarry/exchange_contracts.py +67 -0
- taskcarry/exchange_endpoint.py +377 -0
- taskcarry/exchange_packets.py +142 -0
- taskcarry/experience_contracts.py +129 -0
- taskcarry/experience_exchange.py +214 -0
- taskcarry/experience_notes.py +433 -0
- taskcarry/experience_storage.py +125 -0
- taskcarry/experience_tools.py +26 -0
- taskcarry/feishu/__init__.py +1 -0
- taskcarry/feishu/display.py +122 -0
- taskcarry/feishu/project_watch.py +145 -0
- taskcarry/feishu/review_sets.py +80 -0
- taskcarry/feishu/sender.py +42 -0
- taskcarry/feishu/subscription.py +193 -0
- taskcarry/feishu/windows_agent.py +287 -0
- taskcarry/feishu/windows_secret.py +34 -0
- taskcarry/gitops.py +170 -0
- taskcarry/governance.py +88 -0
- taskcarry/governance_cycle.py +775 -0
- taskcarry/identification.py +82 -0
- taskcarry/integration.py +663 -0
- taskcarry/maintenance.py +118 -0
- taskcarry/mcp.py +183 -0
- taskcarry/member_join.py +184 -0
- taskcarry/member_routing.py +145 -0
- taskcarry/onboarding.py +272 -0
- taskcarry/onboarding_complete.py +252 -0
- taskcarry/path_batches.py +19 -0
- taskcarry/preservation.py +257 -0
- taskcarry/project_collaboration.py +453 -0
- taskcarry/project_history.py +166 -0
- taskcarry/project_identity.py +51 -0
- taskcarry/project_recovery.py +824 -0
- taskcarry/recovery_contracts.py +25 -0
- taskcarry/recovery_files.py +153 -0
- taskcarry/recovery_git.py +234 -0
- taskcarry/remote_capture.py +89 -0
- taskcarry/remote_transfer.py +356 -0
- taskcarry/role_connection.py +215 -0
- taskcarry/setup.py +597 -0
- taskcarry/shared_workbench.py +480 -0
- taskcarry/skill_data/taskcarry-experience-recovery/SKILL.md +37 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/SKILL.md +47 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/references/daily-governance.md +72 -0
- taskcarry/skill_data/taskcarry-project-setup/SKILL.md +48 -0
- taskcarry/skill_data/taskcarry-project-setup/references/onboarding.md +198 -0
- taskcarry/skill_data/taskcarry-task-delivery/SKILL.md +32 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/conditional-experience.md +93 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/worker-channel.md +41 -0
- taskcarry/source_review_set.py +80 -0
- taskcarry/state_format.py +47 -0
- taskcarry/store.py +472 -0
- taskcarry/task_context.py +141 -0
- taskcarry/text_handback.py +98 -0
- taskcarry/transfer_contracts.py +18 -0
- taskcarry/updates.py +351 -0
- taskcarry/workbench.py +625 -0
- taskcarry/workbench_contracts.py +32 -0
- taskcarry/workbuddy_capture.py +451 -0
- taskcarry/workbuddy_setup.py +212 -0
- taskcarry/worker_channel.py +859 -0
- taskcarry/worker_contracts.py +190 -0
- taskcarry/worker_storage.py +60 -0
- taskcarry/worker_tools.py +111 -0
- taskcarry-0.3.2.dist-info/METADATA +203 -0
- taskcarry-0.3.2.dist-info/RECORD +105 -0
- taskcarry-0.3.2.dist-info/WHEEL +5 -0
- taskcarry-0.3.2.dist-info/entry_points.txt +5 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE +21 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE_SCOPE.md +31 -0
- taskcarry-0.3.2.dist-info/top_level.txt +2 -0
- taskcarry_https/__init__.py +1 -0
- taskcarry_https/consent.py +207 -0
- taskcarry_https/reader.py +132 -0
- taskcarry_https/review.py +116 -0
- taskcarry_https/server.py +163 -0
- taskcarry_https/team.py +335 -0
- taskcarry_https/team_host.py +109 -0
- taskcarry_https/web_host.py +82 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"""Planned exact local Git preservation, with a recoverable ref/index journal.
|
|
2
|
+
|
|
3
|
+
No remote transport, implicit repository creation, staging sweep or author
|
|
4
|
+
fabrication. Selected staged changes require a separate user-reviewed workflow.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import os
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
import stat
|
|
12
|
+
import subprocess
|
|
13
|
+
import tempfile
|
|
14
|
+
|
|
15
|
+
from .core import Core, _id, _linked, digest_bytes, read_file_bytes, validate_relative_path
|
|
16
|
+
from .gitops import repo, identity, pathsafe
|
|
17
|
+
from .store import GovernanceError, now
|
|
18
|
+
from .path_batches import path_batches
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _git(root, *args, data=None, index=None, author=None, check=True):
|
|
22
|
+
environment = {k: v for k, v in os.environ.items() if not k.startswith('GIT_')}
|
|
23
|
+
environment.update(GIT_TERMINAL_PROMPT='0', GIT_OPTIONAL_LOCKS='0')
|
|
24
|
+
if index:
|
|
25
|
+
environment['GIT_INDEX_FILE'] = str(index)
|
|
26
|
+
if author:
|
|
27
|
+
environment.update(GIT_AUTHOR_NAME=author['name'], GIT_AUTHOR_EMAIL=author['email'],
|
|
28
|
+
GIT_COMMITTER_NAME=author['name'], GIT_COMMITTER_EMAIL=author['email'])
|
|
29
|
+
try:
|
|
30
|
+
result = subprocess.run(['git', '--literal-pathspecs', '-c', 'core.hooksPath=' + os.devnull,
|
|
31
|
+
'-c', 'commit.gpgsign=false', '-c', 'core.autocrlf=false',
|
|
32
|
+
'-C', str(root), *map(str, args)], input=data, env=environment,
|
|
33
|
+
stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60, shell=False)
|
|
34
|
+
except (OSError, subprocess.TimeoutExpired) as error:
|
|
35
|
+
raise GovernanceError('GIT_UNAVAILABLE', str(error)) from error
|
|
36
|
+
if check and result.returncode:
|
|
37
|
+
raise GovernanceError('PRESERVE_GIT_FAILED', result.stderr.decode('utf-8', 'replace'), {'args': args})
|
|
38
|
+
return result
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _head(root):
|
|
42
|
+
result = _git(root, 'rev-parse', '--verify', 'HEAD', check=False)
|
|
43
|
+
return result.stdout.decode().strip() if result.returncode == 0 else None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _index(root):
|
|
47
|
+
path = Path(_git(root, 'rev-parse', '--path-format=absolute', '--git-path', 'index').stdout.decode().strip())
|
|
48
|
+
if _linked(path) or _linked(path.parent):
|
|
49
|
+
raise GovernanceError('UNSAFE_METADATA', 'The Git index cannot traverse a link.')
|
|
50
|
+
return path
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _bytes(path):
|
|
54
|
+
return read_file_bytes(path) if path.exists() else None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _hash(data):
|
|
58
|
+
return digest_bytes(data) if data is not None else None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _fingerprint(value):
|
|
62
|
+
return digest_bytes(json.dumps(value, sort_keys=True, separators=(',', ':')).encode())
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class Preservation(Core):
|
|
66
|
+
def _author(self, root):
|
|
67
|
+
result = {}
|
|
68
|
+
for field in ('name', 'email'):
|
|
69
|
+
value = _git(root, 'config', '--get', 'user.' + field, check=False).stdout.decode('utf-8').strip()
|
|
70
|
+
if not value or len(value) > 512 or any(c in value for c in '\n\r\0<>'):
|
|
71
|
+
raise GovernanceError('GIT_AUTHOR_REQUIRED', 'Set a verified repository-local Git author before saving.', {'field': field})
|
|
72
|
+
result[field] = value
|
|
73
|
+
return result
|
|
74
|
+
|
|
75
|
+
def _capture(self, root, paths):
|
|
76
|
+
files, total = [], 0
|
|
77
|
+
for path in paths:
|
|
78
|
+
pathsafe(path)
|
|
79
|
+
source = validate_relative_path(root, path)
|
|
80
|
+
if any(p.casefold() in ('runtime', 'toolkit', 'downloads', '.venv', 'node_modules', '__pycache__')
|
|
81
|
+
for p in Path(path).parts):
|
|
82
|
+
raise GovernanceError('PRESERVE_EXCLUDED', 'Runtime/download/dependency trees are not governance records.')
|
|
83
|
+
if _git(root, 'check-ignore', '-q', '--', path, check=False).returncode == 0:
|
|
84
|
+
raise GovernanceError('PRESERVE_IGNORED', 'An ignored path requires a separate reviewed workflow.', {'path': path})
|
|
85
|
+
data = read_file_bytes(source) if source.exists() else None
|
|
86
|
+
if data is None and not _git(root, 'ls-files', '--error-unmatch', '--', path, check=False).returncode == 0:
|
|
87
|
+
raise GovernanceError('MISSING_FILE', 'The selected file has no content or tracked deletion.', {'path': path})
|
|
88
|
+
total += len(data) if data is not None else 0
|
|
89
|
+
if total > 128 * 1024 * 1024:
|
|
90
|
+
raise GovernanceError('PRESERVE_TOO_LARGE', 'Split the selection or use external artifact references.')
|
|
91
|
+
files.append({'path': path, 'sha256': _hash(data), 'size': len(data) if data is not None else 0,
|
|
92
|
+
'mode': ('100755' if source.exists() and source.stat().st_mode & stat.S_IXUSR else '100644')})
|
|
93
|
+
return files
|
|
94
|
+
|
|
95
|
+
def _selection_clean(self, root, head, paths):
|
|
96
|
+
# A saved stage has distinct intent from unstaged working content. Do not
|
|
97
|
+
# silently consume it, even if only the same selected path is involved.
|
|
98
|
+
for selected in path_batches(paths):
|
|
99
|
+
if head:
|
|
100
|
+
different = _git(root, 'diff', '--cached', '--quiet', head, '--', *selected, check=False)
|
|
101
|
+
if different.returncode == 1:
|
|
102
|
+
raise GovernanceError('PRESERVE_SELECTED_STAGED', 'Preserve or explicitly deliver selected staged work separately.')
|
|
103
|
+
if different.returncode:
|
|
104
|
+
raise GovernanceError('PRESERVE_GIT_FAILED', different.stderr.decode('utf-8', 'replace'))
|
|
105
|
+
elif _git(root, 'ls-files', '--stage', '-z', '--', *selected).stdout:
|
|
106
|
+
raise GovernanceError('PRESERVE_SELECTED_STAGED', 'Selected files are already staged.')
|
|
107
|
+
for line in _git(root, 'ls-files', '-v', '-z', '--', *selected).stdout.split(b'\0'):
|
|
108
|
+
if line and not line.startswith(b'H '):
|
|
109
|
+
raise GovernanceError('PRESERVE_INDEX_FLAGS', 'Selected skip-worktree/assume-unchanged paths need review.')
|
|
110
|
+
|
|
111
|
+
def preserve(self, action='plan', repository=None, paths=None, message=None, plan_id=None):
|
|
112
|
+
if action not in ('plan', 'execute', 'status'):
|
|
113
|
+
raise GovernanceError('PRESERVE_ACTION', 'Use plan, execute or status.')
|
|
114
|
+
if action in ('execute', 'status'):
|
|
115
|
+
if any(value is not None for value in (repository, paths, message)):
|
|
116
|
+
raise GovernanceError('PRESERVE_ARGUMENT', 'Use the exact saved plan without new repository, paths or message.')
|
|
117
|
+
plan_id = _id(plan_id, 'Preservation plan')
|
|
118
|
+
record = self.store.get('preservation', plan_id)
|
|
119
|
+
if not record:
|
|
120
|
+
raise GovernanceError('PRESERVE_UNKNOWN', 'Create a preservation plan first.')
|
|
121
|
+
if action == 'status':
|
|
122
|
+
return {**record, 'effects_verified_now': False,
|
|
123
|
+
'meaning': 'Durable local save receipt; not remote backup, business acceptance or current HEAD verification.'}
|
|
124
|
+
return self._execute(record)
|
|
125
|
+
if plan_id is not None:
|
|
126
|
+
raise GovernanceError('PRESERVE_ARGUMENT', 'A new plan does not accept an existing plan ID.')
|
|
127
|
+
if (not isinstance(paths, list) or not 1 <= len(paths) <= 500
|
|
128
|
+
or any(not isinstance(p, str) for p in paths)
|
|
129
|
+
or len({p.casefold() for p in paths}) != len(paths)):
|
|
130
|
+
raise GovernanceError('EXACT_PATHS_REQUIRED', 'Select 1-500 unique explicit relative files.')
|
|
131
|
+
if not isinstance(message, str) or not message.strip() or len(message) > 2048 or '\0' in message:
|
|
132
|
+
raise GovernanceError('PRESERVE_MESSAGE', 'Provide a bounded commit message.')
|
|
133
|
+
if not isinstance(repository, str) or not repository.strip():
|
|
134
|
+
raise GovernanceError('PRESERVE_REPOSITORY', 'Select an existing repository root.')
|
|
135
|
+
root = repo(repository)
|
|
136
|
+
files = self._capture(root, sorted(paths))
|
|
137
|
+
head, index_bytes = _head(root), _bytes(_index(root))
|
|
138
|
+
self._selection_clean(root, head, paths)
|
|
139
|
+
body = {'repository': str(root), 'identity': identity(root), 'head': head, 'files': files,
|
|
140
|
+
'index_sha256': _hash(index_bytes), 'author': self._author(root), 'message': message}
|
|
141
|
+
pid = 'save-' + _fingerprint(body)[:24]
|
|
142
|
+
with self.store.transaction():
|
|
143
|
+
old = self.store.get('preservation', pid)
|
|
144
|
+
if old:
|
|
145
|
+
return {**old, 'reused': True}
|
|
146
|
+
record = {**body, 'plan_id': pid, 'state': 'PLANNED', 'created_at': now(),
|
|
147
|
+
'scope': 'selected_local_files', 'remote_backup': False, 'delivery': False}
|
|
148
|
+
self.store.put('preservation', pid, record)
|
|
149
|
+
self.store.event('preservation_planned', {'plan_id': pid, 'paths': paths})
|
|
150
|
+
return record
|
|
151
|
+
|
|
152
|
+
def _prepare(self, record, root, before):
|
|
153
|
+
# Git plumbing uses a private index, raw bytes and no hooks/filters. The
|
|
154
|
+
# actual staged file bytes and attributes are never silently normalized.
|
|
155
|
+
scratch = self.store.directory / 'preservation-scratch'
|
|
156
|
+
scratch.mkdir(exist_ok=True)
|
|
157
|
+
if _linked(scratch):
|
|
158
|
+
raise GovernanceError('UNSAFE_METADATA', 'Scratch storage cannot be a link.')
|
|
159
|
+
with tempfile.TemporaryDirectory(prefix='save-', dir=scratch) as temporary:
|
|
160
|
+
candidate_index = Path(temporary) / 'candidate-index'
|
|
161
|
+
_git(root, 'read-tree', record['head'] or '--empty', index=candidate_index)
|
|
162
|
+
entries = []
|
|
163
|
+
oid_length = len(_git(root, 'hash-object', '--stdin', data=b'').stdout.strip())
|
|
164
|
+
for item in record['files']:
|
|
165
|
+
path = item['path']
|
|
166
|
+
if item['sha256'] is None:
|
|
167
|
+
entries.append('0 ' + '0' * oid_length + '\t' + path + '\0')
|
|
168
|
+
continue
|
|
169
|
+
data = read_file_bytes(validate_relative_path(root, path, allow_missing=False))
|
|
170
|
+
if digest_bytes(data) != item['sha256']:
|
|
171
|
+
raise GovernanceError('PRESERVE_CHANGED', 'Selected content changed after planning.')
|
|
172
|
+
oid = _git(root, 'hash-object', '-w', '--stdin', data=data).stdout.decode().strip()
|
|
173
|
+
entries.append(item['mode'] + ' ' + oid + '\t' + path + '\0')
|
|
174
|
+
payload = ''.join(entries).encode('utf-8')
|
|
175
|
+
_git(root, 'update-index', '-z', '--index-info', data=payload, index=candidate_index)
|
|
176
|
+
tree = _git(root, 'write-tree', index=candidate_index).stdout.decode().strip()
|
|
177
|
+
prior_tree = (_git(root, 'rev-parse', record['head'] + '^{tree}').stdout.decode().strip()
|
|
178
|
+
if record['head'] else None)
|
|
179
|
+
if tree == prior_tree:
|
|
180
|
+
return {**record, 'state': 'COMPLETED', 'commit': record['head'], 'changed': False,
|
|
181
|
+
'completed_at': now()}
|
|
182
|
+
args = ['commit-tree', tree]
|
|
183
|
+
if record['head']:
|
|
184
|
+
args += ['-p', record['head']]
|
|
185
|
+
candidate = _git(root, *args, data=(record['message'] + '\n').encode(), author=record['author']).stdout.decode().strip()
|
|
186
|
+
after_index = Path(temporary) / 'after-index'
|
|
187
|
+
if before is None:
|
|
188
|
+
_git(root, 'read-tree', '--empty', index=after_index)
|
|
189
|
+
else:
|
|
190
|
+
after_index.write_bytes(before)
|
|
191
|
+
_git(root, 'update-index', '-z', '--index-info', data=payload, index=after_index)
|
|
192
|
+
return {**record, 'state': 'PREPARED', 'candidate': candidate, 'tree': tree,
|
|
193
|
+
'index_before': self._snapshot(before) if before is not None else None,
|
|
194
|
+
'index_after': self._snapshot(read_file_bytes(after_index)), 'changed': True,
|
|
195
|
+
'content_policy': 'exact_raw_bytes_without_clean_filters'}
|
|
196
|
+
|
|
197
|
+
def _publish(self, record):
|
|
198
|
+
with self.store.transaction():
|
|
199
|
+
self.store.put('preservation', record['plan_id'], record)
|
|
200
|
+
self.store.event('preservation_completed', {'plan_id': record['plan_id'],
|
|
201
|
+
'commit': record['commit'], 'changed': record['changed']})
|
|
202
|
+
return record
|
|
203
|
+
|
|
204
|
+
def _execute(self, original):
|
|
205
|
+
with self.store.guard():
|
|
206
|
+
record = self.store.get('preservation', original['plan_id'])
|
|
207
|
+
if record['state'] == 'COMPLETED':
|
|
208
|
+
return {**record, 'reused': True}
|
|
209
|
+
root = repo(record['repository'])
|
|
210
|
+
if identity(root) != record['identity']:
|
|
211
|
+
raise GovernanceError('PRESERVE_CHANGED', 'The repository identity changed; inspect actual effects.')
|
|
212
|
+
index = _index(root)
|
|
213
|
+
lock = Path(str(index) + '.lock')
|
|
214
|
+
if _linked(lock):
|
|
215
|
+
raise GovernanceError('UNSAFE_METADATA', 'The index lock cannot be a link.')
|
|
216
|
+
try:
|
|
217
|
+
handle = lock.open('xb')
|
|
218
|
+
except FileExistsError as error:
|
|
219
|
+
raise GovernanceError('PRESERVE_BUSY', 'Git index is locked; do not delete another operation lock.') from error
|
|
220
|
+
try:
|
|
221
|
+
before, current = _bytes(index), _head(root)
|
|
222
|
+
if record['state'] == 'PLANNED':
|
|
223
|
+
if current != record['head'] or _hash(before) != record['index_sha256']:
|
|
224
|
+
raise GovernanceError('PRESERVE_CHANGED', 'HEAD or index changed; prepare a fresh plan.')
|
|
225
|
+
if self._author(root) != record['author'] or self._capture(root, [f['path'] for f in record['files']]) != record['files']:
|
|
226
|
+
raise GovernanceError('PRESERVE_CHANGED', 'Author or selected files changed; prepare a fresh plan.')
|
|
227
|
+
record = self._prepare(record, root, before)
|
|
228
|
+
if record['state'] == 'COMPLETED':
|
|
229
|
+
return self._publish(record)
|
|
230
|
+
# This journal is durable before the first visible Git effect.
|
|
231
|
+
self.store.put('preservation', record['plan_id'], record)
|
|
232
|
+
original_index = self._snapshot_bytes(record['index_before']) if record['index_before'] else None
|
|
233
|
+
final_index = self._snapshot_bytes(record['index_after'])
|
|
234
|
+
if before not in (original_index, final_index):
|
|
235
|
+
raise GovernanceError('PRESERVE_REVIEW_REQUIRED', 'The index differs from both recorded states; preserve it and review.')
|
|
236
|
+
candidate = record['candidate']
|
|
237
|
+
if current == record['head']:
|
|
238
|
+
if before != original_index or self._capture(root, [f['path'] for f in record['files']]) != record['files']:
|
|
239
|
+
raise GovernanceError('PRESERVE_CHANGED', 'Source changed before commit; do not replay the plan.')
|
|
240
|
+
expected = record['head'] or ('0' * len(candidate))
|
|
241
|
+
_git(root, 'update-ref', record['identity']['branch'], candidate, expected)
|
|
242
|
+
elif current != candidate:
|
|
243
|
+
raise GovernanceError('PRESERVE_REVIEW_REQUIRED', 'HEAD is neither the old nor prepared commit; no automatic replay.')
|
|
244
|
+
# Only selected entries differ. Unrelated staged entries, file
|
|
245
|
+
# bytes and all unstaged work remain exactly as before.
|
|
246
|
+
handle.write(final_index)
|
|
247
|
+
handle.flush()
|
|
248
|
+
os.fsync(handle.fileno())
|
|
249
|
+
handle.close()
|
|
250
|
+
os.replace(lock, index)
|
|
251
|
+
if _head(root) != candidate or _bytes(index) != final_index:
|
|
252
|
+
raise GovernanceError('PRESERVE_REVIEW_REQUIRED', 'Effects changed before receipt finalization.')
|
|
253
|
+
return self._publish({**record, 'state': 'COMPLETED', 'commit': candidate, 'completed_at': now()})
|
|
254
|
+
finally:
|
|
255
|
+
handle.close()
|
|
256
|
+
if lock.exists():
|
|
257
|
+
lock.unlink()
|