Skip to content

Commit

Permalink
插件托盘现在会主动将自己挂载到指定注入点,插件事件现在会主动在注入点补充进程信息
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Mar 25, 2023
1 parent 29bd77a commit d3858ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion OlivOS/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def __init__(self, sdk_event=None, log_func=None, Proc=None):
}
self.sdk_event = sdk_event
self.sdk_event_type = type(self.sdk_event)
if type(Proc) is OlivOS.pluginAPI.shallow:
if type(OlivOS.pluginAPI.gProc) is OlivOS.pluginAPI.shallow:
self.plugin_info['control_queue'] = OlivOS.pluginAPI.gProc.Proc_info.control_queue
self.log_func = OlivOS.pluginAPI.gProc.log
if self.plugin_info['control_queue'] is None \
and type(Proc) is OlivOS.pluginAPI.shallow:
self.plugin_info['control_queue'] = Proc.Proc_info.control_queue
if type(self.log_func) is None:
self.log_func = Proc.log
Expand Down
5 changes: 4 additions & 1 deletion OlivOS/pluginAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import OlivOS

gProc = None

def releaseDir(dir_path):
if not os.path.exists(dir_path):
Expand Down Expand Up @@ -109,6 +110,7 @@ def __update_GUI(self):
self.run_plugin(rx_packet_data)

def run(self):
OlivOS.pluginAPI.gProc = self
self.sendPluginList()
releaseDir('./plugin')
releaseDir('./plugin/app')
Expand Down Expand Up @@ -177,7 +179,8 @@ def get_main_root(self):
return self.Proc_data['main_tk']

def run_plugin(self, sdk_event):
plugin_event = OlivOS.API.Event(sdk_event=sdk_event, log_func=self.log, Proc=self)
#plugin_event = OlivOS.API.Event(sdk_event=sdk_event, log_func=self.log, Proc=self)
plugin_event = OlivOS.API.Event(sdk_event=sdk_event)
plugin_event_bot_hash = OlivOS.API.getBotHash(
bot_id=plugin_event.base_info['self_id'],
platform_sdk=plugin_event.platform['sdk'],
Expand Down

0 comments on commit d3858ec

Please sign in to comment.