[+] update status

1. make sure it handles properly
    time jumps due to suspend for example;
This commit is contained in:
Siarhei Siniak 2025-12-09 13:32:03 +03:00
parent 8633bd0724
commit c0125914d2
3 changed files with 22 additions and 4 deletions

@ -5,7 +5,7 @@ project(
).stdout().strip('\n'),
# 'online.fxreader.uv',
# ['c', 'cpp'],
version: '0.1.5.43',
version: '0.1.5.44',
# default_options: [
# 'cpp_std=c++23',
# # 'prefer_static=true',

@ -197,10 +197,25 @@ printf '% 3.0f%%' $(upower -d | grep -Po 'percentage:\\s+\\d+(\\.\\d+)?%' | grep
sys.stdout.write('\n')
sys.stdout.flush()
now_ts = datetime.datetime.now()
spent = (now_ts - last_ts).total_seconds()
is_late = False
last_ts = last_ts + datetime.timedelta(seconds=options.repeat_interval)
new_ts = last_ts
while True:
now_ts = datetime.datetime.now()
spent = (now_ts - last_ts).total_seconds()
new_ts = last_ts + datetime.timedelta(
seconds=options.repeat_interval
)
if new_ts > now_ts:
if is_late:
last_ts = new_ts
break
else:
last_ts = new_ts
is_late = True
if spent < options.repeat_interval:
time.sleep(options.repeat_interval - spent)

BIN
releases/whl/online_fxreader_pr34-0.1.5.44-py3-none-any.whl (Stored with Git LFS) Normal file

Binary file not shown.