willforde / script.module.codequick

Kodi addon framework
GNU General Public License v2.0
33 stars 6 forks source link

[question] Possibility to put the framework directly in the addon #7

Closed sy6sy2 closed 6 years ago

sy6sy2 commented 6 years ago

Hi!

Do you know if is it possible to directly copy Codequick in our lib's addon folder?

Thank you

willforde commented 6 years ago

Yeah, it should be possible. The only dependency for Codequick itself is "script.module.youtube.dl", and that's only when you are using "Resolver.extract_source".

May I ask, why? I will be submitting the version that's in the dev branch soon if no more changes are required.

sy6sy2 commented 6 years ago

Thank you for your quick answer. But what about the media folder with next.png etc? For example this line local_image = ensure_native_str(os.path.join(Script.get_info("path"), u"resources", u"media", u"{}")) would not work no?

Just because the latest version is not on the official Kodi repo, but if you submit the dev branch version soon I will wait ;-)

willforde commented 6 years ago

Forgot about that part, but things would still work without them. You might just be missing an image here and there. Also you could add "script.module.codequick" as a dependency in your addon.xml and just import your local version, It would pickup everything else from the installed version. If you get me.

I will give one last look over it and submit it tonight.

sy6sy2 commented 6 years ago

Yes I already use the latest version directly by download the zip version of your framework on GitHub and add "script.module.codequick" with the dev branch number version. There is no problem for me ; but I think of the users that use our add-on. For them the only solution is to directly include the correct version of Codequick in our plugin OR the necessity of having the correct version number of Codequick on the official Kodi repo ;-)

Cool! Thank your for your reactivity!

willforde commented 6 years ago

Well it's submitted. Just waiting for it to be accepted and merged.

willforde commented 6 years ago

Sorry for the delay, still waiting for the pull request to be merged.

sy6sy2 commented 6 years ago

No problem, we know that the delay may be long to submit an addon update.

willforde commented 6 years ago

Bad news. I finally got a response from the Kodi team, and am not allowed to directly parse the strings.po file. So I will have to remove gettext support. Sorry.

sy6sy2 commented 6 years ago

Oh :-( Can you keep this feature in a branch or something like that?

willforde commented 6 years ago

I have created a new branch called gettext witch containes a module that you can directly package with your own add-on. And all you have to do is import it and call gettext_kodi.load_strings() and it will add the string references to codequick for you.

willforde commented 6 years ago

The update has finally been merged into the Kodi krypton repository.

sy6sy2 commented 6 years ago

Good news! We will test this new version, thank you for your work.

sy6sy2 commented 6 years ago

But I think about that; we actually use the simpleplugin framework in our plugin and this framework has the "gettext" feature. But we never had any problem to submit our addon on the official Kodi repo...

Do you know why the Kodi team doesn't want to merge your framework with this feature? Because we can ask why you can't submit your version while we can submit our addon with the code to parse the strings.po file...

willforde commented 6 years ago

The Kodi team is getting more strict with what is allowed and not allowed recently. You most likely won't be able to submit you're add-on either then with that code. Here is the response that I got from them.

you're not allowed to directly parse/mess with those files. Use the API only please. I know you're trying to add support for strings instead of numeric id's but nevertheless, you need to use another approach that does not rely on reading the strings.po file directly

What I do with my add-on's is to set some global constants like ALL_VIDEOS = 30001 at the top of the file. Then pass that constant to script.localize(ALL_VIDEOS)

sy6sy2 commented 6 years ago

Oh ok, thank you for sharing this information!