mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-07-06 01:42:02 +02:00
Merge pull request #64 from jkrauska/ruffVersionFix
Bump ruff version - fix open call from lang work
This commit is contained in:
@@ -26,7 +26,7 @@ jobs:
|
|||||||
key: ruff-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/ruff.toml') }}
|
key: ruff-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/ruff.toml') }}
|
||||||
|
|
||||||
- name: Install Ruff
|
- 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)
|
# Lint (with GitHub annotation format for inline PR messages)
|
||||||
- name: Ruff check
|
- name: Ruff check
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- 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:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix, --exit-non-zero-on-fix] # fail if it had to change files
|
args: [--fix, --exit-non-zero-on-fix] # fail if it had to change files
|
||||||
|
|||||||
+4
-4
@@ -1335,7 +1335,7 @@ async def nodegraph(request):
|
|||||||
|
|
||||||
edge_pair = (node.node_id, packet.from_node_id)
|
edge_pair = (node.node_id, packet.from_node_id)
|
||||||
edges_map[edge_pair]["weight"] += 1
|
edges_map[edge_pair]["weight"] += 1
|
||||||
edges_map[edge_pair]["type"] = ("neighbor")
|
edges_map[edge_pair]["type"] = "neighbor"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error decoding NeighborInfo packet: {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}"
|
f"Error decoding NeighborInfo packet {getattr(packet, 'id', '?')}: {e}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@routes.get("/api/lang")
|
@routes.get("/api/lang")
|
||||||
async def api_lang(request):
|
async def api_lang(request):
|
||||||
# Language from ?lang=xx, fallback to config, then to "en"
|
# 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")
|
lang_file = os.path.join(LANG_DIR, "en.json")
|
||||||
|
|
||||||
# Load JSON translations
|
# 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)
|
translations = json.load(f)
|
||||||
|
|
||||||
if section:
|
if section:
|
||||||
@@ -1711,8 +1712,7 @@ async def api_lang(request):
|
|||||||
return web.json_response(translations[section])
|
return web.json_response(translations[section])
|
||||||
else:
|
else:
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
{"error": f"Section '{section}' not found in {lang_code}"},
|
{"error": f"Section '{section}' not found in {lang_code}"}, status=404
|
||||||
status=404
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# if no section requested → return full translation file
|
# if no section requested → return full translation file
|
||||||
|
|||||||
Reference in New Issue
Block a user