Kodi Community Forum

Full Version: Is it possible to condition an addon import requirement?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Since UWP doesn't allow for the cherrypy python module, I adjusted Skin Helper code to except import error for cherrypy and tick off the use of its Webservice.
Only problem is in the addon.xml under <requires> I want to exclude cherrypy import for UWP, there's already the System.Platform.UWP Bool but is it possible to use it in the addon.xml?
nope, not possible.
(2019-03-04, 16:17)ronie Wrote: [ -> ]nope, not possible.
So what's the alternative? having a skin for uwp and one for all other platfroms, that each call its own skin helper? with the only thing that differs is the required line? Sad
i don't think i fully understand the problem?
why would a skin need to import the cherrypy module? that should be done by the skin helper addon, no?
Are you sure you can’t use the cherrypy module? What happens if you include it within your add-on package?

I ask because I’m fairly sure, when I was testing this module, granted it wasn’t added as a dependency but rather included within my test add-on, it did work. There is a modded cherrypy version, forked from marcelveldt’s cherrypy package for Kodi, that was modded to run without the packages that do not work on UWP and Android.
(2019-03-04, 16:59)ronie Wrote: [ -> ]i don't think i fully understand the problem?
why would a skin need to import the cherrypy module? that should be done by the skin helper addon, no?


The skin depends on the skin helper which depends on cherrypy.
(2019-03-04, 16:59)ronie Wrote: [ -> ]i don't think i fully understand the problem?
why would a skin need to import the cherrypy module? that should be done by the skin helper addon, no?
 Titan is heavily reliant on Skin Helper, so skin requires SH -> requires CherryPy...
I have to check how much of an impact will result if SH is not required by the skin, but this is the current situation.

(2019-03-04, 16:59)angelblue05 Wrote: [ -> ]Are you sure you can’t use the cherrypy module? What happens if you include it within your add-on package?

I ask because I’m fairly sure, when I was testing this module, granted it wasn’t added as a dependency but rather included within my test add-on, it did work. There is a modded cherrypy version, forked from marcelveldt’s cherrypy package for Kodi, that was modded to run without the packages that do not work on UWP and Android.
Could you share a link to this fork?
ok, so skin helper imports cherrypy and gracefully handles the import exception.
so what problem remains?
If you are interested. This was the version I used for testing.

https://github.com/TheTimeWalker/script.module.cherrypy

Good luck
(2019-03-04, 17:05)ronie Wrote: [ -> ]ok, so skin helper imports cherrypy and gracefully handles the import exception.
so what problem remains?
 that skin helper's addon.xml has cherrypy module under required imports, otherwise I wouldn't be able to import it via script.
@angelblue05 

Correct me if I'm wrong, but in our cherrypy tests we were able to have this module running on the UWP app? I cannot remember if we tested both of our webservice implementations.
(2019-03-04, 17:10)sualfred Wrote: [ -> ]@angelblue05 

Correct me if I'm wrong, but in our cherrypy tests we were able to have this module running on the UWP app? I cannot remember if we tested both of our webservice implementations.


Yes that’s right. We tested with cherrypy with that fork I linked above.
i'm sorry, still not able to understand the problem... perhaps someone else can help you out.