Rebrand Pinscope to Periscope across product and codebase.
Rename the core package to periscopex, update UI/docs/Docker/deploy defaults to periscope.michelebigi.it, and keep legacy version/storage key aliases so existing projects keep working. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
try:
|
||||
from . import pinscope_plugin # noqa: F401
|
||||
from . import periscope_plugin # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Locate pinscope-findings.json and decide schematic vs PCB focus.
|
||||
"""Locate periscope-findings.json and decide schematic vs PCB focus.
|
||||
|
||||
Imported by the KiCad action plugin. No pcbnew/wx at import time so tests
|
||||
can run in the repo venv.
|
||||
@@ -15,7 +15,7 @@ def find_bridge_file(start: str | Path, *, max_up: int = 6) -> Path | None:
|
||||
if cur.is_file():
|
||||
cur = cur.parent
|
||||
for _ in range(max_up + 1):
|
||||
cand = cur / "pinscope-findings.json"
|
||||
cand = cur / "periscope-findings.json"
|
||||
if cand.is_file():
|
||||
return cand
|
||||
if cur.parent == cur:
|
||||
@@ -27,7 +27,7 @@ def find_bridge_file(start: str | Path, *, max_up: int = 6) -> Path | None:
|
||||
def load_bridge(path: str | Path) -> dict:
|
||||
raw = json.loads(Path(path).read_text(encoding="utf-8"))
|
||||
if not isinstance(raw, dict):
|
||||
raise ValueError("pinscope-findings.json is not an object")
|
||||
raise ValueError("periscope-findings.json is not an object")
|
||||
return raw
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def focus_target(finding: dict) -> dict:
|
||||
kind = finding.get("target")
|
||||
if kind not in ("sch", "pcb"):
|
||||
rid = str(finding.get("rule_id") or "")
|
||||
kind = "pcb" if rid.startswith(("PS-PLC", "PS-SI", "PS-LAY", "PS-3W", "PS-CLR")) else "sch"
|
||||
kind = "pcb" if rid.startswith(("PE-PLC", "PE-SI", "PE-LAY", "PE-3W", "PE-CLR")) else "sch"
|
||||
return {
|
||||
"kind": kind,
|
||||
"ref": ref,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Pinscope KiCad 9/10 action plugin — load pinscope-findings.json and focus.
|
||||
"""Periscope KiCad 9/10 action plugin — load periscope-findings.json and focus.
|
||||
|
||||
Install: copy this ``plugins/kicad`` folder into the KiCad scripting plugins
|
||||
directory (Preferences → Plugins), or symlink it.
|
||||
@@ -13,11 +13,11 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class PinscopeAction:
|
||||
class PeriscopeAction:
|
||||
def defaults(self) -> None:
|
||||
self.name = "Pinscope findings"
|
||||
self.category = "Pinscope"
|
||||
self.description = "Jump to a Pinscope finding on the schematic or board"
|
||||
self.name = "Periscope findings"
|
||||
self.category = "Periscope"
|
||||
self.description = "Jump to a Periscope finding on the schematic or board"
|
||||
self.show_toolbar_button = True
|
||||
|
||||
def Run(self) -> None:
|
||||
@@ -30,25 +30,25 @@ class PinscopeAction:
|
||||
bridge_path = find_bridge_file(start)
|
||||
if bridge_path is None:
|
||||
wx.MessageBox(
|
||||
"No pinscope-findings.json next to the project. "
|
||||
"Run Pinscope and copy that file beside the .kicad_pro.",
|
||||
"Pinscope",
|
||||
"No periscope-findings.json next to the project. "
|
||||
"Run Periscope and copy that file beside the .kicad_pro.",
|
||||
"Periscope",
|
||||
wx.OK | wx.ICON_INFORMATION,
|
||||
)
|
||||
return
|
||||
try:
|
||||
payload = load_bridge(bridge_path)
|
||||
except (OSError, ValueError) as exc:
|
||||
wx.MessageBox(str(exc), "Pinscope", wx.OK | wx.ICON_ERROR)
|
||||
wx.MessageBox(str(exc), "Periscope", wx.OK | wx.ICON_ERROR)
|
||||
return
|
||||
findings = list(payload.get("findings") or [])
|
||||
if not findings:
|
||||
wx.MessageBox("The bridge file has no findings.", "Pinscope", wx.OK)
|
||||
wx.MessageBox("The bridge file has no findings.", "Periscope", wx.OK)
|
||||
return
|
||||
dlg = wx.SingleChoiceDialog(
|
||||
None,
|
||||
"Select a finding",
|
||||
"Pinscope",
|
||||
"Periscope",
|
||||
[_label(f) for f in findings],
|
||||
)
|
||||
if dlg.ShowModal() != wx.ID_OK:
|
||||
@@ -63,7 +63,7 @@ class PinscopeAction:
|
||||
wx.MessageBox(
|
||||
f"Focus {target['kind']} {target['ref']}\n"
|
||||
f"sheet={target['sheet']}\nuuid={target['uuid']}",
|
||||
"Pinscope",
|
||||
"Periscope",
|
||||
wx.OK | wx.ICON_INFORMATION,
|
||||
)
|
||||
|
||||
@@ -121,9 +121,9 @@ def _try_focus(target: dict) -> bool:
|
||||
try:
|
||||
import pcbnew
|
||||
|
||||
class PinscopePcbnewPlugin(pcbnew.ActionPlugin, PinscopeAction):
|
||||
class PeriscopePcbnewPlugin(pcbnew.ActionPlugin, PeriscopeAction):
|
||||
pass
|
||||
|
||||
PinscopePcbnewPlugin().register()
|
||||
PeriscopePcbnewPlugin().register()
|
||||
except ImportError:
|
||||
pass
|
||||
Reference in New Issue
Block a user