-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.py
More file actions
42 lines (27 loc) · 818 Bytes
/
Copy pathtimer.py
File metadata and controls
42 lines (27 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import bpy
from . import addon_updater_ops
def on_startup_timer():
addon_updater_ops.check_for_update_background()
return None
def check_updates_timer():
bpy.ops.kanistra.check_updates_operator()
return 30
def show_update_popup_timer():
addon_updater_ops.updater_run_install_popup_handler(None)
return None
timers = [
(on_startup_timer, {"first_interval": 0}),
(show_update_popup_timer, {"first_interval": 3}),
(check_updates_timer, {"first_interval": 3}),
]
def register_timers():
if bpy.app.background:
return
for t, kw in timers:
bpy.app.timers.register(t, **kw)
def unregister_timers():
if bpy.app.background:
return
for t, kw in timers:
if bpy.app.timers.is_registered(t):
bpy.app.timers.unregister(t)