forked from iarv/meshview
Bump ruff version - fix open call from lang work
This commit is contained in:
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
key: ruff-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/ruff.toml') }}
|
||||
|
||||
- name: Install Ruff
|
||||
run: pip install "ruff==0.6.9"
|
||||
run: pip install "ruff==0.13.3"
|
||||
|
||||
# Lint (with GitHub annotation format for inline PR messages)
|
||||
- name: Ruff check
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.6.9 # pin the latest you’re comfortable with
|
||||
rev: v0.13.3 # pin the latest you’re comfortable with
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [--fix, --exit-non-zero-on-fix] # fail if it had to change files
|
||||
|
||||
@@ -1335,7 +1335,7 @@ async def nodegraph(request):
|
||||
|
||||
edge_pair = (node.node_id, packet.from_node_id)
|
||||
edges_map[edge_pair]["weight"] += 1
|
||||
edges_map[edge_pair]["type"] = ("neighbor")
|
||||
edges_map[edge_pair]["type"] = "neighbor"
|
||||
except Exception as e:
|
||||
logger.error(f"Error decoding NeighborInfo packet: {e}")
|
||||
|
||||
@@ -1691,6 +1691,7 @@ async def api_edges(request):
|
||||
f"Error decoding NeighborInfo packet {getattr(packet, 'id', '?')}: {e}"
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/api/lang")
|
||||
async def api_lang(request):
|
||||
# Language from ?lang=xx, fallback to config, then to "en"
|
||||
@@ -1702,7 +1703,7 @@ async def api_lang(request):
|
||||
lang_file = os.path.join(LANG_DIR, "en.json")
|
||||
|
||||
# Load JSON translations
|
||||
with open(lang_file, "r", encoding="utf-8") as f:
|
||||
with open(lang_file, encoding="utf-8") as f:
|
||||
translations = json.load(f)
|
||||
|
||||
if section:
|
||||
@@ -1711,8 +1712,7 @@ async def api_lang(request):
|
||||
return web.json_response(translations[section])
|
||||
else:
|
||||
return web.json_response(
|
||||
{"error": f"Section '{section}' not found in {lang_code}"},
|
||||
status=404
|
||||
{"error": f"Section '{section}' not found in {lang_code}"}, status=404
|
||||
)
|
||||
|
||||
# if no section requested → return full translation file
|
||||
|
||||
Reference in New Issue
Block a user