But this suggestion is invalid. When the __name__ is __main__ you cannot do a relative import... and it seems that this is how Kodi runs the addon. https://stackoverflow.com/a/66895066/11214013
The relative imports work if you import the file into an existing python instance, but not when you run python ./service.py.
Is there anyway to skip the refactoring? It also causes a second problem if my dependencies are installed to the addon directory (./resources/lib)... there will thousands of warnings. Excluding specific directories would be beneficial.
This tool suggests refactoring my code as shown here.
INFO: ./service.themerr/service.py
But this suggestion is invalid. When the
__name__
is__main__
you cannot do a relative import... and it seems that this is how Kodi runs the addon. https://stackoverflow.com/a/66895066/11214013The relative imports work if you import the file into an existing python instance, but not when you run
python ./service.py
.Is there anyway to skip the refactoring? It also causes a second problem if my dependencies are installed to the addon directory (
./resources/lib
)... there will thousands of warnings. Excluding specific directories would be beneficial.