@JonB , I searched for conditional decorators. So I found some stuff on stackflow. Not exactly what they did, but I did this and it seems to work.

_USE_ASYNC = False def cond_decorator(func): from threading import Thread from functools import wraps @wraps(func) def async_func(*args, **kwargs): func_hl = Thread(target = func, args = args, kwargs = kwargs) func_hl.start() return func_hl if _USE_ASYNC: return async_func else: return ui.in_background(func)

Just so the DropboxFilePicker can work either way.