mirror of
https://gitea.com/Lerking/XtendR.git
synced 2026-07-01 06:00:05 +02:00
#31 - Creating thread with callback, on pre_load(). /JL
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import threading
|
||||
import time
|
||||
from xtendr.xtendrbase import XtendRBase
|
||||
|
||||
class ExamplePlugin(XtendRBase):
|
||||
@@ -14,9 +15,6 @@ class ExamplePlugin(XtendRBase):
|
||||
>>> plugin.stop()
|
||||
ExamplePlugin has stopped!
|
||||
"""
|
||||
self.pre_load_done = threading.Event()
|
||||
self.use_pre_load:bool = False #Indicate that pre-loading isn't neccessary
|
||||
|
||||
def run(self, *args, **kwargs):
|
||||
arglen = len(args)
|
||||
keylen = len(kwargs)
|
||||
@@ -36,5 +34,6 @@ class ExamplePlugin(XtendRBase):
|
||||
def stop(self):
|
||||
print("ExamplePlugin has stopped!")
|
||||
|
||||
def pre_load(self):
|
||||
pass
|
||||
def pre_load(self, callback):
|
||||
time.sleep(5) # Indicate long running pre-load.
|
||||
callback()
|
||||
|
||||
Reference in New Issue
Block a user