mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
[karthik] fix: resolve debugger filepath-not-found on Linux
On Linux (case-sensitive FS), Directory.py lowercased child paths before os.path.isfile(), so mixed-case files like Apps.py were never indexed. Debugleton.py then lowercased the lookup too, guaranteeing no match. Fix: store real paths always; on darwin only, lowercase both sides at compare time. Closes #58.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Haik: sorry bout the filename
|
# Haik: sorry bout the filename
|
||||||
|
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
from debugger_backend.project_scanner import update_debug_toggles
|
from debugger_backend.project_scanner import update_debug_toggles
|
||||||
from debugger_backend.Directory import Directory
|
from debugger_backend.Directory import Directory
|
||||||
@@ -75,12 +76,15 @@ class Debugleton:
|
|||||||
return self.sync_lock.locked()
|
return self.sync_lock.locked()
|
||||||
|
|
||||||
def find_file_info(self, filepath: str):
|
def find_file_info(self, filepath: str):
|
||||||
filepath = filepath.lower()
|
|
||||||
# print(f"Finding file info for {filepath}")
|
# print(f"Finding file info for {filepath}")
|
||||||
if self.needs_resync():
|
if self.needs_resync():
|
||||||
self.sync_to_saved()
|
self.sync_to_saved()
|
||||||
try:
|
try:
|
||||||
filepath_id = self.abspaths.index(filepath)
|
if sys.platform == "darwin":
|
||||||
|
abspaths = [p.lower() for p in self.abspaths]
|
||||||
|
filepath_id = abspaths.index(filepath.lower())
|
||||||
|
else:
|
||||||
|
filepath_id = self.abspaths.index(filepath)
|
||||||
match = self.instances[filepath_id]
|
match = self.instances[filepath_id]
|
||||||
return match.color, match.is_toggled, match.emoji
|
return match.color, match.is_toggled, match.emoji
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Directory:
|
|||||||
ordered_abspaths.append({"abspath": full_path, "instance": dir})
|
ordered_abspaths.append({"abspath": full_path, "instance": dir})
|
||||||
# print(f"\t[construct_ordered_abspaths]: Full path: {full_path}")
|
# print(f"\t[construct_ordered_abspaths]: Full path: {full_path}")
|
||||||
for child in dir.children:
|
for child in dir.children:
|
||||||
child_abspath = os.path.join(root_dir, child.path).lower()
|
child_abspath = os.path.join(root_dir, child.path)
|
||||||
if os.path.isdir(child_abspath):
|
if os.path.isdir(child_abspath):
|
||||||
construct_ordered_abspaths(child, ordered_abspaths)
|
construct_ordered_abspaths(child, ordered_abspaths)
|
||||||
elif os.path.isfile(child_abspath):
|
elif os.path.isfile(child_abspath):
|
||||||
|
|||||||
Reference in New Issue
Block a user