Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #16
(2013-10-02 23:49)jerimiah797 Wrote:  Here you go!

Thanks! Added your info to the OP.

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
find quote
robweber Offline
Posting Freak
Posts: 1,079
Joined: Sep 2009
Reputation: 32
Post: #17
Just came across this and want to say thanks for this project. I use Eclipse as my IDE of choice and always just had to ignore any xbmc library errors when doing addon editing. This makes things a lot easier and a ton more helpful. Not constantly going through the XBMC python docs in a web browser to find the function I'm looking for.

Thanks!
find quote
queeup Offline
Posting Freak
Posts: 817
Joined: Feb 2009
Reputation: 16
Post: #18
Could you update for latest modules?
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #19
(2015-03-13 15:43)queeup Wrote:  Could you update for latest modules?

Could you be more specific what is missing?

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
find quote
queeup Offline
Posting Freak
Posts: 817
Joined: Feb 2009
Reputation: 16
Post: #20
ListItem.setArt() missing for example.

also you should fix: https://github.com/romanvm/xbmcstubs/blo...ui.py#L690
Code:
addStreamInfo(type, values):
to
Code:
addStreamInfo(self, type, values):
find quote
queeup Offline
Posting Freak
Posts: 817
Joined: Feb 2009
Reputation: 16
Post: #21
Next time I will PR. Promise.
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #22
Thanks for the info and pointing out the bug. As for API changes, reference to relevant docstrings from Kodi sources will help. Unfortunately, the info about Python API changes is not readily available and needs to be picked out from different sources.

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
find quote
queeup Offline
Posting Freak
Posts: 817
Joined: Feb 2009
Reputation: 16
Post: #23
You are right. I guess best place is pydocs: http://mirrors.xbmc.org/docs/python-docs/14.x-helix/

They are not up to date always tho.

Thx for your work btw. It helps alot while coding on IDE.
find quote
queeup Offline
Posting Freak
Posts: 817
Joined: Feb 2009
Reputation: 16
Post: #24
I think easiest way to find class and function names is modify one kodi "addon.py" or "default.py" file with import all xbmc modules, then print them one by one after import lines adding like this: "print help(xbmcaddon)".
On kodi.log it gives this: http://xbmclogs.com/py1sxwiyp

Unfortunately no help printed. Just class & function names. After get them you can check pydoc from site.
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #25
(2015-03-14 03:41)queeup Wrote:  You are right. I guess best place is pydocs: http://mirrors.xbmc.org/docs/python-docs/14.x-helix/

They are not up to date always tho.

Yes, that's the issue. Basically, the most reliable source is Kodi source (no pun intended Smile), but you need to monitor a number of C++ files which is not very convenient, especially for an amateur programmer with very basic knowledge of C++ like myself. But suggestions and PRs are always welcomed.

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
(This post was last modified: 2015-03-18 12:16 by Roman_V_M.)
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,206
Joined: Mar 2009
Reputation: 117
Location: Cologne, Germany
Post: #26
Thx for this. Just started using it in conjunction with ST + Anaconda. Works great.
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #27
Just want to note that XBMCstubs are renamed to Kodistubs to reflect the XBMC > Kodi name change. I'd also like to announce some upcoming changes for Kodistubs:
- All docstrings will have Sphinx/reStructuredText formatting.
- For all function/methods that return something returned objects will be changed from types to default instances of the respective types. E.g. if previously a stub function returned str, now it will return str(), int will be replaced with int() and so on. This is done to prevent import side-effects when an addon script referencing Kodistubs is imported outside Kodi, e.g for unit-testing.

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
find quote
yocoldrain Offline
Senior Member
Posts: 203
Joined: Jan 2014
Reputation: 9
Post: #28
is there anyway, this can work with notepad++ ?, I know its not an actual IDE, but just wondering if there is a way.
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #29
(2015-12-17 17:19)yocoldrain Wrote:  is there anyway, this can work with notepad++ ?, I know its not an actual IDE, but just wondering if there is a way.

Good question. Personally, I've never used Notepadd++ for other than quick glance into some file or making quick fixes in the code, and I guess it can do only as much. Personally, I prefer PyCharm Community for any serious Python development (if my amateur efforts can be called so Smile ).

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 800
Joined: Jun 2011
Reputation: 30
Location: Kyiv, Ukraine
Post: #30
As announced, Kodistubs are updated. Major changes:
- All docstrings now have Sphinx-compatible reStructuredText formatting.
- For all function/methods that return something, returned objects are changed from types to default instances of the respective types, e.g str -> str().
- New Sphinx-generated website for documentation: http://romanvm.github.io/Kodistubs/ This website can also be used as a reference point for intersphinx if you are writing your own docs with Sphinx.

AMD A4-3300 + AsRock A75M-ITX - Kodi 15.x on Windows 10
Acer IconiaTab A510 - Kodi 14.2 for Android
(This post was last modified: 2016-01-16 21:15 by Roman_V_M.)
find quote
Post Reply