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

Method _detect_os_info

server_capabilities.py:217–222  ·  view source on GitHub ↗

Detect OS information

(self)

Source from the content-addressed store, hash-verified

215 for line in f:
216 if line.startswith('MemTotal:'):
217 # Value is in kB
218 kb = int(line.split()[1])
219 self.capabilities.total_ram_gb = kb / (1024 ** 2)
220 elif line.startswith('MemAvailable:'):
221 kb = int(line.split()[1])
222 self.capabilities.available_ram_gb = kb / (1024 ** 2)
223 except Exception as e:
224 logger.warning(f"Could not read /proc/meminfo: {e}")
225

Callers 1

detect_capabilitiesMethod · 0.95

Calls 1

releaseMethod · 0.80

Tested by

no test coverage detected