MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / activate_network

Method activate_network

network_storage.py:37–47  ·  view source on GitHub ↗

Activate storage for the provided SSID (None => default).

(self, ssid: Optional[str])

Source from the content-addressed store, hash-verified

35 return self._build_context(self.active_ssid, self.active_slug or '')
36
37 def activate_network(self, ssid: Optional[str]) -> Dict[str, str]:
38 """Activate storage for the provided SSID (None => default)."""
39 slug = self._slugify(ssid)
40 normalized_ssid = ssid.strip() if ssid else None
41
42 if slug != self.active_slug or normalized_ssid != self.active_ssid:
43 self.active_slug = slug
44 self.active_ssid = normalized_ssid
45 self._write_last_ssid(normalized_ssid)
46
47 return self._build_context(self.active_ssid, self.active_slug or '')
48
49 def get_context_snapshot(self, ssid: Optional[str]) -> Dict[str, str]:
50 """Return a storage context for SSID without changing the active network."""

Callers 3

__init__Method · 0.95
get_active_contextMethod · 0.95
set_active_networkMethod · 0.80

Calls 3

_slugifyMethod · 0.95
_write_last_ssidMethod · 0.95
_build_contextMethod · 0.95

Tested by

no test coverage detected