portacode 1.3.30__py3-none-any.whl → 1.3.31__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.
- portacode/_version.py +2 -2
- portacode/connection/handlers/project_state/file_system_watcher.py +24 -10
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/METADATA +1 -1
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/RECORD +8 -8
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/WHEEL +0 -0
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/entry_points.txt +0 -0
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/licenses/LICENSE +0 -0
- {portacode-1.3.30.dist-info → portacode-1.3.31.dist-info}/top_level.txt +0 -0
portacode/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 3,
|
|
31
|
+
__version__ = version = '1.3.31'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 3, 31)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -28,12 +28,13 @@ except ImportError:
|
|
|
28
28
|
|
|
29
29
|
class FileSystemWatcher:
|
|
30
30
|
"""Watches file system changes for project folders."""
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
def __init__(self, project_manager):
|
|
33
33
|
self.project_manager = project_manager # Reference to ProjectStateManager
|
|
34
34
|
self.observer: Optional[Observer] = None
|
|
35
35
|
self.event_handler: Optional[FileSystemEventHandler] = None
|
|
36
36
|
self.watched_paths: Set[str] = set()
|
|
37
|
+
self.watch_handles: dict = {} # Map path -> watch handle for proper cleanup
|
|
37
38
|
# Store reference to the event loop for thread-safe async task creation
|
|
38
39
|
try:
|
|
39
40
|
self.event_loop = asyncio.get_running_loop()
|
|
@@ -140,14 +141,15 @@ class FileSystemWatcher:
|
|
|
140
141
|
if not WATCHDOG_AVAILABLE or not self.observer:
|
|
141
142
|
logger.warning("Watchdog not available, cannot start watching: %s", path)
|
|
142
143
|
return
|
|
143
|
-
|
|
144
|
+
|
|
144
145
|
if path not in self.watched_paths:
|
|
145
146
|
try:
|
|
146
147
|
# Use recursive=False to watch only direct contents of each folder
|
|
147
|
-
self.observer.schedule(self.event_handler, path, recursive=False)
|
|
148
|
+
watch_handle = self.observer.schedule(self.event_handler, path, recursive=False)
|
|
148
149
|
self.watched_paths.add(path)
|
|
150
|
+
self.watch_handles[path] = watch_handle # Store handle for cleanup
|
|
149
151
|
logger.info("Started watching path (non-recursive): %s", path)
|
|
150
|
-
|
|
152
|
+
|
|
151
153
|
if not self.observer.is_alive():
|
|
152
154
|
self.observer.start()
|
|
153
155
|
logger.info("Started file system observer")
|
|
@@ -161,14 +163,15 @@ class FileSystemWatcher:
|
|
|
161
163
|
if not WATCHDOG_AVAILABLE or not self.observer:
|
|
162
164
|
logger.warning("Watchdog not available, cannot start watching git directory: %s", git_path)
|
|
163
165
|
return
|
|
164
|
-
|
|
166
|
+
|
|
165
167
|
if git_path not in self.watched_paths:
|
|
166
168
|
try:
|
|
167
169
|
# Watch .git directory recursively to catch changes in refs/, logs/, etc.
|
|
168
|
-
self.observer.schedule(self.event_handler, git_path, recursive=True)
|
|
170
|
+
watch_handle = self.observer.schedule(self.event_handler, git_path, recursive=True)
|
|
169
171
|
self.watched_paths.add(git_path)
|
|
172
|
+
self.watch_handles[git_path] = watch_handle # Store handle for cleanup
|
|
170
173
|
logger.info("Started watching git directory (recursive): %s", git_path)
|
|
171
|
-
|
|
174
|
+
|
|
172
175
|
if not self.observer.is_alive():
|
|
173
176
|
self.observer.start()
|
|
174
177
|
logger.info("Started file system observer")
|
|
@@ -181,9 +184,19 @@ class FileSystemWatcher:
|
|
|
181
184
|
"""Stop watching a specific path."""
|
|
182
185
|
if not WATCHDOG_AVAILABLE or not self.observer:
|
|
183
186
|
return
|
|
184
|
-
|
|
187
|
+
|
|
185
188
|
if path in self.watched_paths:
|
|
186
|
-
#
|
|
189
|
+
# Actually unschedule the watch using stored handle
|
|
190
|
+
watch_handle = self.watch_handles.get(path)
|
|
191
|
+
if watch_handle:
|
|
192
|
+
try:
|
|
193
|
+
self.observer.unschedule(watch_handle)
|
|
194
|
+
logger.info("Successfully unscheduled watch for: %s", path)
|
|
195
|
+
except Exception as e:
|
|
196
|
+
logger.error("Error unscheduling watch for %s: %s", path, e)
|
|
197
|
+
finally:
|
|
198
|
+
self.watch_handles.pop(path, None)
|
|
199
|
+
|
|
187
200
|
self.watched_paths.discard(path)
|
|
188
201
|
logger.debug("Stopped watching path: %s", path)
|
|
189
202
|
|
|
@@ -192,4 +205,5 @@ class FileSystemWatcher:
|
|
|
192
205
|
if self.observer and self.observer.is_alive():
|
|
193
206
|
self.observer.stop()
|
|
194
207
|
self.observer.join()
|
|
195
|
-
self.watched_paths.clear()
|
|
208
|
+
self.watched_paths.clear()
|
|
209
|
+
self.watch_handles.clear()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
portacode/README.md,sha256=4dKtpvR8LNgZPVz37GmkQCMWIr_u25Ao63iW56s7Ke4,775
|
|
2
2
|
portacode/__init__.py,sha256=oB3sV1wXr-um-RXio73UG8E5Xx6cF2ZVJveqjNmC-vQ,1086
|
|
3
3
|
portacode/__main__.py,sha256=jmHTGC1hzmo9iKJLv-SSYe9BSIbPPZ2IOpecI03PlTs,296
|
|
4
|
-
portacode/_version.py,sha256=
|
|
4
|
+
portacode/_version.py,sha256=nj9fipyzeKa-vUpoV8y3uNnbzWCSR4Zi6utiZgnfsIg,706
|
|
5
5
|
portacode/cli.py,sha256=eDqcZMVFHKzqqWxedhhx8ylu5WMVCLqeJQkbPR7RcJE,16333
|
|
6
6
|
portacode/data.py,sha256=5-s291bv8J354myaHm1Y7CQZTZyRzMU3TGe5U4hb-FA,1591
|
|
7
7
|
portacode/keypair.py,sha256=PAcOYqlVLOoZTPYi6LvLjfsY6BkrWbLOhSZLb8r5sHs,3635
|
|
@@ -27,7 +27,7 @@ portacode/connection/handlers/tab_factory.py,sha256=VBZnwtxgeNJCsfBzUjkFWAAGBdij
|
|
|
27
27
|
portacode/connection/handlers/terminal_handlers.py,sha256=HRwHW1GiqG1NtHVEqXHKaYkFfQEzCDDH6YIlHcb4XD8,11866
|
|
28
28
|
portacode/connection/handlers/project_state/README.md,sha256=trdd4ig6ungmwH5SpbSLfyxbL-QgPlGNU-_XrMEiXtw,10114
|
|
29
29
|
portacode/connection/handlers/project_state/__init__.py,sha256=5ucIqk6Iclqg6bKkL8r_wVs5Tlt6B9J7yQH6yQUt7gc,2541
|
|
30
|
-
portacode/connection/handlers/project_state/file_system_watcher.py,sha256=
|
|
30
|
+
portacode/connection/handlers/project_state/file_system_watcher.py,sha256=2zingW9BoNKRijghHC2eHHdRoyDRdLmIl1yH1y-iuF8,10831
|
|
31
31
|
portacode/connection/handlers/project_state/git_manager.py,sha256=oqE5jC1Xk8Sne1BruQuAqotvbX_v7vPYYQUIp0pPe3U,87964
|
|
32
32
|
portacode/connection/handlers/project_state/handlers.py,sha256=03RYNeWfX_Ym9Lx4VdA6iwLSWFdjRtjWI5T1buBg4Mc,37941
|
|
33
33
|
portacode/connection/handlers/project_state/manager.py,sha256=_tkVu6sruKVTMxGPj1iLv7-IMGDWYid4xl_fCUppadA,60554
|
|
@@ -38,7 +38,7 @@ portacode/static/js/utils/ntp-clock.js,sha256=KMeHGT-IlUSlxVRZZ899z25dQCJh6EJbgX
|
|
|
38
38
|
portacode/utils/NTP_ARCHITECTURE.md,sha256=WkESTbz5SNAgdmDKk3DrHMhtYOPji_Kt3_a9arWdRig,3894
|
|
39
39
|
portacode/utils/__init__.py,sha256=NgBlWTuNJESfIYJzP_3adI1yJQJR0XJLRpSdVNaBAN0,33
|
|
40
40
|
portacode/utils/ntp_clock.py,sha256=6QJOVZr9VQuxIyJt9KNG4dR-nZ3bKNyipMxjqDWP89Y,5152
|
|
41
|
-
portacode-1.3.
|
|
41
|
+
portacode-1.3.31.dist-info/licenses/LICENSE,sha256=2FGbCnUDgRYuQTkB1O1dUUpu5CVAjK1j4_p6ack9Z54,1066
|
|
42
42
|
test_modules/README.md,sha256=Do_agkm9WhSzueXjRAkV_xEj6Emy5zB3N3VKY5Roce8,9274
|
|
43
43
|
test_modules/__init__.py,sha256=1LcbHodIHsB0g-g4NGjSn6AMuCoGbymvXPYLOb6Z7F0,53
|
|
44
44
|
test_modules/test_device_online.py,sha256=yiSyVaMwKAugqIX_ZIxmLXiOlmA_8IRXiUp12YmpB98,1653
|
|
@@ -63,8 +63,8 @@ testing_framework/core/playwright_manager.py,sha256=8xl-19b8NQjKNdiRyDjyeXlYyKPZ
|
|
|
63
63
|
testing_framework/core/runner.py,sha256=j2QwNJmAxVBmJvcbVS7DgPJUKPNzqfLmt_4NNdaKmZU,19297
|
|
64
64
|
testing_framework/core/shared_cli_manager.py,sha256=BESSNtyQb7BOlaOvZmm04T8Uezjms4KCBs2MzTxvzYQ,8790
|
|
65
65
|
testing_framework/core/test_discovery.py,sha256=2FZ9fJ8Dp5dloA-fkgXoJ_gCMC_nYPBnA3Hs2xlagzM,4928
|
|
66
|
-
portacode-1.3.
|
|
67
|
-
portacode-1.3.
|
|
68
|
-
portacode-1.3.
|
|
69
|
-
portacode-1.3.
|
|
70
|
-
portacode-1.3.
|
|
66
|
+
portacode-1.3.31.dist-info/METADATA,sha256=LVMS4rVdOb2nZS1adK_n1sx1ObasGJj1jvWVmSTMkeI,6989
|
|
67
|
+
portacode-1.3.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
68
|
+
portacode-1.3.31.dist-info/entry_points.txt,sha256=lLUUL-BM6_wwe44Xv0__5NQ1BnAz6jWjSMFvZdWW3zU,48
|
|
69
|
+
portacode-1.3.31.dist-info/top_level.txt,sha256=TGhTYUxfW8SyVZc_zGgzjzc24gGT7nSw8Qf73liVRKM,41
|
|
70
|
+
portacode-1.3.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|