Closed s0600204 closed 4 years ago
So, I've looked at it, the user directory part seems fine to me :+1:
I'm not sure about the zip loading, not the code itself, but as a feature and how useful it can be, considering that is also have a few limitations.
I think that my original idea was to provide the ability to install third-party plugins via zip file using some kind of functionality (with a UI) that would extract the archive and hide a few steps from the user.
This second approach would have the following advantages:
Since currently I don't think there will be many users for this feature we can simply add support for loading the plugins from the user directory, and at a later point we could provide all the functionality mentioned above.
This is my opinion obviously, maybe I'm missing something, if you have some counter arguments let me know :)
Fair enough. In which case, only the first commit is actually needed.
I'll rebase and push that so it's easier to review.
gitter, December 2018:
This set of changes is an attempt to permit the above.
With this PR, it is possible to place a plugin in the folder
$XDG_DATA_HOME/LinuxShowPlayer/$LiSP_Version/plugins/
(e.g.~/.local/share/LinuxShowPlayer/0.6/plugins/
) and LiSP will load it on next program restart.As an example, I've created a plugin over at https://github.com/s0600204/protocol_monitor. To test, you can clone the repo into
~/.local/share/LinuxShowPlayer/0.6/plugins/protocol_monitor
(such that that is the root folder of the repo) and (re)start LiSP. (Or alternatively, move one of the plugins included with LiSP out.)It is also possible with this PR to have a plugin zipped up. Unfortunately, downloading a zip-file from GitHub and using it directly is not possible (GitHub doesn't create the subfolder within the zip-file with the correct name), however creating a zip-file manually with the layout:
should work.
There is a caveat with using a zip-file: whilst python code is included automatically, other files have to be extracted programmatically before being usable. The
default.json
file is example of this, and this pull-request includes code that creates a temporary folder and extracts it automatically on plugin load (the temporary folder is removed again when LiSP closes).