GNOME Bugzilla – Bug 742410
Implement logic in Lua instead of using Lua C API
Last modified: 2015-02-14 20:33:08 UTC
Instead of implementing all of the loader's logic using Lua's C API we should implement it in Lua itself using internal.lua This is the Lua companion bug for the Python plugin loader's conversion: https://bugzilla.gnome.org/show_bug.cgi?id=742349
Created attachment 294847 [details] [review] Shorten Lua plugin loader filenames Using "peas-plugin-loader-lua" as a prefix is just too long.
Created attachment 294848 [details] [review] Use Lua to implement the plugin loader's logic This allows us to avoid using Lua's C API and have a more understandable implementation.
Created attachment 295058 [details] [review] Use Lua to implement the plugin loader's logic v2 This allows us to avoid using Lua's C API and have a more understandable implementation. ---- Update to specially format the traceback when loading a plugin, as done in the Python plugin loader.
Review of attachment 294847 [details] [review]: Sure.
Review of attachment 295058 [details] [review]: At a quick check just that minor comment specially since I do not know much of this api... let me know if you want me to check something specific ::: loaders/lua5.1/peas-lua-compile.lua @@ +3,3 @@ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Library General Public License as published by ditto for the previous stuff, we should change the license @@ +41,3 @@ + +local function main(arg) + for i=1,#arg,2 do I'm not a fan of this styling... is it on purpose or c&p error?
Created attachment 295197 [details] [review] Use Lua to implement the plugin loader's logic v3 (In reply to comment #5) > Review of attachment 295058 [details] [review]: > > At a quick check just that minor comment specially since I do not know much of > this api... let me know if you want me to check something specific > Mainly just knowing if anything seems especially odd/stupid and if the *.lua files seem sane is good. > ::: loaders/lua5.1/peas-lua-compile.lua > @@ +3,3 @@ > +-- > +-- This program is free software; you can redistribute it and/or modify > +-- it under the terms of the GNU Library General Public License as published > by > > ditto for the previous stuff, we should change the license > I'll do this as another patch to the original bug. > @@ +41,3 @@ > + > +local function main(arg) > + for i=1,#arg,2 do > > I'm not a fan of this styling... is it on purpose or c&p error? Copied from the Lua tutorial, changed to more sane coding style. Also, update the file a bit as my Lua has gotten a bit better.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.