diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index a922f49..7353ec9 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -19,7 +19,7 @@ jobs: strategy: max-parallel: 12 matrix: - python-version: ["3.10"] + python-version: ["3.11"] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d9cfec..bfe3ca9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.5.0" + rev: "v4.6.0" hooks: - id: check-added-large-files exclude: | @@ -19,7 +19,7 @@ repos: # - id: trailing-whitespace - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.2.0" + rev: "v0.5.2" hooks: - id: ruff - repo: https://github.com/djlint/djLint @@ -40,18 +40,18 @@ repos: src/kweb/static/bootstrap/.* )$ - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.9.0.6 + rev: v0.10.0.1 hooks: - id: shellcheck - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.12.0 + rev: v2.14.0 hooks: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: diff --git a/README.md b/README.md index b2b9acd..083abcd 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ KWeb offers two basic apps: ### Development -#### Clone & Installl +#### Clone & Install ```bash diff --git a/pyproject.toml b/pyproject.toml index 7f0a5f2..9b74663 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ classifiers = [ "Operating System :: OS Independent" ] dependencies = [ - "klayout >= 0.28.17", + "klayout >= 0.29.4", "fastapi", "uvicorn[standard]", "jinja2", @@ -21,7 +21,7 @@ dependencies = [ description = "KLayout API implementation of gdsfactory" name = "kweb" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.11" version = "2.0.1" [project.optional-dependencies] diff --git a/src/kweb/layout_server.py b/src/kweb/layout_server.py index ac38d3c..5b31798 100755 --- a/src/kweb/layout_server.py +++ b/src/kweb/layout_server.py @@ -679,13 +679,13 @@ async def reader(self, websocket: WebSocket, data: str) -> None: ) case "rdb-selected": await self.draw_items(js["items"]) + case "reload": + self.layout_view.reload_layout( + self.layout_view.active_cellview().index() + ) + if self.rdb_file is not None: + self.db.load(self.rdb_file) def meta_json_serializer(obj: object) -> str: return str(obj) - - -# class EditableLayoutViewServerEndpoint( -# LayoutViewServerEndpoint, editable=True, add_missing_layers=True -# ): -# pass diff --git a/src/kweb/static/viewer.js b/src/kweb/static/viewer.js index 2a9c15f..8dd2559 100644 --- a/src/kweb/static/viewer.js +++ b/src/kweb/static/viewer.js @@ -217,6 +217,15 @@ function showMenu(modes, annotations) { socket.send(JSON.stringify({ msg: "zoom-f" })); }; menuElement.appendChild(zoomFit); + let reload = document.createElement("button"); + reload.textContent = "Reload"; + reload.className = "col-auto btn btn-primary mx-2"; + reload.setAttribute("type", "button"); + reload.onclick = function() { + socket.send(JSON.stringify({ msg: "reload" })); + }; + menuElement.appendChild(reload); + let index = 0;