Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 06-20-2025, 11:37 PM   #1
kodermike
Member
kodermike is on a distinguished road
 
kodermike's Avatar
 
Posts: 15
Karma: 60
Join Date: Dec 2024
Location: PNW, US
Device: kobo
Question Best way for a plugin to interact with another plugin? [SSH.koplugin]

I have a plugin I've been working on, and one of the things it does is disable the SSH plugin (along with a bunch of other things, of course). What I discovered in a no-duh moment was that if dropbear is running when the plugin is disabled, dropbear just keeps running. Fun times can ensue.

Is there a good way to call a function in another plugin? I know outright killing dropbear if it's running kills the pid, and that's what I have at the moment, but that feels so dirty. Is using userpatch from within a plugin a better idea, so I can access the function for ssh to stop? Or is using userpatch from a plugin frowned on?

Thanks!
kodermike is offline   Reply With Quote
Old 06-21-2025, 12:41 AM   #2
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,179
Karma: 3592925
Join Date: Sep 2014
Location: Ukraine
Device: Kindle
Every plugin has an access to the parent module (FM or Reader) as self.ui.
The parent has an access to any plugin as self.plugin_name.
Finally, a plugin can call other plugin's method as self.ui.plugin_name:method_name.
hius07 is offline   Reply With Quote
Advert
Old 06-21-2025, 12:24 PM   #3
kodermike
Member
kodermike is on a distinguished road
 
kodermike's Avatar
 
Posts: 15
Karma: 60
Join Date: Dec 2024
Location: PNW, US
Device: kobo
Quote:
Originally Posted by hius07 View Post
Finally, a plugin can call other plugin's method as self.ui.plugin_name:method_name.
Thank you!
kodermike is offline   Reply With Quote
Reply

Tags
plugin, ssh


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] LOI-Generator - edit] plugin to generate a List of Illustrations KevinH Plugins 1 01-19-2023 04:31 PM
[GUI Plugin] Sending (syncing) by SSH/RSH janvanmaar Plugins 23 04-22-2021 12:19 PM
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 08:07 PM
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) www KOReader 4 09-28-2017 10:34 AM


All times are GMT -4. The time now is 07:55 PM.


MobileRead.com is a privately owned, operated and funded community.