Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs (/showthread.php?tid=173780) |
RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - twilight0 - 2016-08-13 Hi there, I find Kodistubs really-really helpful, however I think there are a couple of things missing, ex.: Several items in Player class: http://mirrors.kodi.tv/docs/python-docs/16.x-jarvis/xbmc.html#Player EDIT: Sorry my mistake, didn't properly typed some command. Please ignore this message. RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - user5 - 2016-11-19 That is amazing. Thank you so much. One thing. Im working with pyxbmct and the import is red. "Unresolved import: pyxbmct" Maybe its my mistake, but is there someway I can add that to kodistubs too? RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2016-11-19 (2016-11-19, 07:41)user5 Wrote: That is amazing. Thank you so much. pyxbmct is a separate library and has nothing to do with Kodistubs. Add pyxbmct to your project's Python dependencies the same way as you do this for Kodistubs. RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2018-04-14 I just wanted to announce that I pushed to GitHub a totally re-worked version of Kodistubs. The stub files are now generated (indirectly) from Kodi sources so they re-create Kodi Python API as thoroughly as possible. Now Kodistubs also include PEP-484 type annotations that provide information about actual arguments/return values of Kodi Python API functions and methods. Some Python IDE/code editors (e.g. PyCharm) support such type annotations and warn you if you are trying to pass incompatible arguments to functions/methods. If you previously installed Kodistubs using pip, run pip install --upgrade git+https://github.com/romanvm/Kodistubs.git#egg=Kodistubs to upgrade.
RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - SpAiK - 2019-01-28 Hi, is it possible to use Kodistubs with VS Code? I've created a virtual environment and installed them through pip but I can't get them to show up. RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2019-01-28 @SpAiK Have you selected your virtual environment via VSCode command palette? BTW, Kodistubs 18 are almost ready . RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - SpAiK - 2019-01-29 It seems to be working now as I've discovered that I actually was not into the venv because a Powershell run policy that was not executing the activate script. Now I got all the stuff, although linter is still complaining about import xbmc and xbmcgui (not xbmcaddon): RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2019-01-30 @SpAiK You are not using a right version of Python. Currently Kodi provides Python 2.7 interpreter (and 18.x is planned to be the last version with Python 2) so Kodistubs use Python 2 syntax. @ All I'm please to announce that Kodistubs v.18.0.0 have been released. They include functions and classes from Kodi 18 "Leia" Python API, including the new xbmcdrm module for interacting with DRM (I don't even know how this works). To upgrade Kodistubs in your working virtual environment simply run: pip install --upgrade Kodistubs. RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - dsime42 - 2019-02-10 Hi, Quick question Has anyone mention a syntax error in xbmcgui? I created a one line bob.py file import xbmcgui Ran pylint against it pylint bob.py ************* Module bob bob.py:4:0: E0001: Cannot import 'xbmcgui' due to syntax error 'invalid syntax (<unknown>, line 1090)' (syntax-error) bob.py:4:0: W0611: Unused import xbmcgui (unused-import) ----------------------------------------------------------------------- Your code has been rated at -50.00/10 (previous run: -16.67/10, -33.33) RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2019-02-10 @dsime42 Quick question: have you read 2 posts just above yours? RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - dsime42 - 2019-02-11 Ignore my post. :-) I ran it in Python3 and the "0L" returned on line 1090 is no longer valid in Python3 should just be "0" So it works when run under Python2 RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - ZacWolf - 2019-02-27 I'm still working with krypton, 17.6. What version of kodistubs do I need to install for that code base? THANKS! RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2019-02-27 17.6 can still be installed with pip install or downloaded from respective tags on GitHub. But v. 17 is missing callback methods for xbmc.Player and xbmcgui.Window classes as a result of a bug in the generator script. It was fixed only in v. 18. RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - noobCreator - 2019-12-25 Hi, I am new to creating Kodi addon. Thanks @Roman_V_M , all your discussions/blogs have been super helpful with getting into addon creation. So far I have created Virtual environment and installed Kodistubs18, xbmcswift2 (using VS Code and Python 3.8). While trying to create a "Hello World" addon, I get the following error (same as @dsime42) : import xbmcgui return 0L ^ SyntaxError: invalid syntax I understand that switching to Python2 can help resolve this issue. However, as per this blog post, it looks like Python2 will not be supported in near future. So, is there a way for me to create addon in Python3 and not get this compatibility error? This is my python code so far: import xbmcgui var = "hello world" print(var) I do not have an addon.xml yet and I am just trying to run this code from VS Code using python console for now, just to check if I can import xbmc libraries successfully (taking baby steps). RE: Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs - Roman_V_M - 2019-12-26 (2019-12-25, 21:16)noobCreator Wrote: I do not have an addon.xml yet and I am just trying to run this code from VS Code using python console for now, just to check if I can import xbmc libraries successfully (taking baby steps). Please carefully read Kodistubs description in the 1st post of this topic. Kodistubs are not meant to run your code outside Kodi unless you know exactly what you are doing. As for addon development in general, the current Kodi version supports Python 2 so the best way is to work in a Python 2 virtual environment and use helper libraries like six or future to ensure Python 2/3 compatibility. |