Bugfix regarding callbackInfos
This commit is contained in:
@@ -35,7 +35,7 @@ public class PythonScriptable : IScriptable
|
|||||||
}
|
}
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
using (Py.GIL())
|
using (Py.GIL())
|
||||||
@@ -52,8 +52,8 @@ public class PythonScriptable : IScriptable
|
|||||||
PythonEngine.Initialize();
|
PythonEngine.Initialize();
|
||||||
using (Py.GIL())
|
using (Py.GIL())
|
||||||
{
|
{
|
||||||
ToolSet.callbackInfos = callbackInfos;
|
|
||||||
pyToolSet = ToolSet.ToPython();
|
pyToolSet = ToolSet.ToPython();
|
||||||
|
pyToolSet.SetAttr("callbackInfos", callbackInfos.ToPython());
|
||||||
scope.Set("toolset", pyToolSet);
|
scope.Set("toolset", pyToolSet);
|
||||||
scope.Exec("update(toolset)");
|
scope.Exec("update(toolset)");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ def update(toolset: Toolset):
|
|||||||
print("Py-DEBUG@update")
|
print("Py-DEBUG@update")
|
||||||
print("This is the update function from the python example script")
|
print("This is the update function from the python example script")
|
||||||
callbackInfos:ICallbackInfos = toolset.callbackInfos
|
callbackInfos:ICallbackInfos = toolset.callbackInfos
|
||||||
if (callbackInfos is IntervalCallbackInfos):
|
if (str(callbackInfos) == "Indexer.Models.IntervalCallbackInfos"):
|
||||||
print("It was called via an interval callback")
|
print("It was called via an interval callback")
|
||||||
|
else:
|
||||||
|
print("It was called, but the origin of the call could not be determined")
|
||||||
example_counter += 1
|
example_counter += 1
|
||||||
mycounter = example_counter
|
|
||||||
print(f"example_counter: {example_counter}")
|
print(f"example_counter: {example_counter}")
|
||||||
index_files(toolset)
|
index_files(toolset)
|
||||||
|
|
||||||
|
|||||||
@@ -112,14 +112,15 @@ class Client:
|
|||||||
pass
|
pass
|
||||||
async def EntityDeleteAsync(searchdomain:str, entityName:str) -> EntityDeleteResults:
|
async def EntityDeleteAsync(searchdomain:str, entityName:str) -> EntityDeleteResults:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@dataclass
|
||||||
class ICallbackInfos:
|
class ICallbackInfos:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class IntervalCallbackInfos(ICallbackInfos):
|
class IntervalCallbackInfos(ICallbackInfos):
|
||||||
sender: Optional[object]
|
sender: Optional[object]
|
||||||
e: object
|
e: object
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Toolset:
|
class Toolset:
|
||||||
|
|||||||
Reference in New Issue
Block a user