MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _loop_once

Method _loop_once

core/sysmon.py:123–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121 # ── internals ─────────────────────────────────────────────────────────────
122
123 def _loop_once(self) -> None:
124 cpu = self._read_cpu()
125 ru, rt = self._read_ram()
126 temp = self._read_temp()
127 # Battery is slow (~200ms subprocess) — read every 5th tick (~10s)
128 self._battery_tick += 1
129 if self._battery_tick >= 5:
130 self._battery_tick = 0
131 bpct, bcharging = self._read_battery()
132 with self._lock:
133 self._battery_pct = bpct
134 self._battery_charging = bcharging
135 with self._lock:
136 self._cpu = cpu
137 self._ram_used = ru
138 self._ram_total = rt
139 self._temp = temp
140 self.set_title()
141
142 def _loop(self) -> None:
143 while self._running:

Callers 2

startMethod · 0.95
_loopMethod · 0.95

Calls 5

_read_cpuMethod · 0.95
_read_ramMethod · 0.95
_read_tempMethod · 0.95
_read_batteryMethod · 0.95
set_titleMethod · 0.95

Tested by

no test coverage detected