mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
BatteryStat plugin and instruction of KoboLight plugin (#2643)
* Start battery stat plugin * BatteryStat & kobolight * Several minor improvements * Remove a useless function * flush settings * Some review feedbacks * Resolve review comments * Remaining Minutes -> Remaining Hours * Add dump_file * typo * realpath * realpath on folder * Remove useless os.time() * Resolve review comments * warning * Add BatteryStat.debugging flag * treat log as txt * Minor improvement * Charging hour should be positive * Use warn instead of info * onSuspend in Kobo * Charging events for kobo and kindle * More events * dumpOrLog * Warnings * Typo * More space * Singleton * slightly format change * BatteryStat singleton * Init * Remove debugging flag * sleeping percentage is still negative * Read settings * Do not need to change was_suspending and was_charging * Typo * Remove debugging flag * Not charging should happen before suspend * Resolve review comments * was_suspend and was_charging should be updated each time in onCallback()
This commit is contained in:
@@ -22,13 +22,14 @@ function PluginLoader:loadPlugins()
|
||||
local ok, plugin_module = pcall(dofile, mainfile)
|
||||
if not ok or not plugin_module then
|
||||
logger.warn("Error when loading", mainfile, plugin_module)
|
||||
end
|
||||
if ok and plugin_module and not plugin_module.disabled then
|
||||
elseif type(plugin_module.disabled) ~= "boolean" or not plugin_module.disabled then
|
||||
package.path = package_path
|
||||
package.cpath = package_cpath
|
||||
plugin_module.path = path
|
||||
plugin_module.name = plugin_module.name or path:match("/(.-)%.koplugin")
|
||||
table.insert(self.plugins, plugin_module)
|
||||
else
|
||||
logger.info("Plugin ", mainfile, " has been disabled.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user