mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-16 04:43:52 +08:00
15 lines
298 B
Python
15 lines
298 B
Python
"""
|
|
Decorator definitions
|
|
"""
|
|
from typing import Callable
|
|
|
|
|
|
def check_main_thread(func: Callable) -> Callable:
|
|
"""Declarator: check if you are on main thread"""
|
|
|
|
def wrapper(self, *args, **kwargs):
|
|
if self.is_main_thread:
|
|
func(self, *args, **kwargs)
|
|
|
|
return wrapper
|