•  Previous
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 14
  • Next 
 
Thread Rating:
  • 5 Vote(s) - 4.2 Average
Your 1st Add-On: Hello World!
#31
XBMC Stubs allows auto-completion and documentation lookup in some IDEs. I think there is a walk-through about how to set it up in PyCharm.

https://github.com/romanvm/xbmcstubs
Reply
#32
(2014-12-20, 14:26)LandRover Wrote: [quote pieman]
Thanks for adding the ATV2 path details and obviously they will be different for different set ups. Hopefully users can locate their xbmc.log and modify the tail command accordingly.

The modules that are prefixed with xbmc like xbmcgui and xbmc itself are not available in standalone Python.They will only run via XBMC. It maybe that the techies have worked out how to use them in an IDE but I certainly haven't found a way. It would be nice to use the IDE's we are familiar with but unless someone advises otherwise it is not possible. Even if you added the modules to Python I don't think they would work as they were developed to work within XBMC.

I'll just have to get used to using the logs, as a beginner I find the IDE easier to find Python formatting issues Sad . Hopefully I figure it out as obviously everyone else has managed to do. Smile

Time to keep moving forward.
[/quote]

Once you get used to using tail it is not really that much different to a regular IDE.

(2014-12-20, 14:28)Karnagious Wrote: XBMC Stubs allows auto-completion and documentation lookup in some IDEs. I think there is a walk-through about how to set it up in PyCharm.

https://github.com/romanvm/xbmcstubs

Looks like this is what we have been looking for LandRover. Thanks again Karnagious.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#33
Not sure what I have done with the format of quotes in my last few posts but hopefully readers can make some sense of it.

xbmcstubs and PyXBMCt were written by the same person so he (?) obviously knows the ropes when it comes to Python and XBMC.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#34
Yeah, ROMAN_V_M is a beast Smile
Yeah, Me, Myself, and I, The Three Musketeers
Image
Reply
#35
(2014-12-20, 14:40)pieman Wrote: Not sure what I have done with the format of quotes in my last few posts but hopefully readers can make some sense of it.

xbmcstubs and PyXBMCt were written by the same person so he (?) obviously knows the ropes when it comes to Python and XBMC.

To be honest, I've forked xbmcstubs from another Github repo that got stale some time ago and try to keep it up to date with XBMC/Kodi Python development. And xbmcstubs just help you write code in your favorite IDE, it doesn't let you actually run the code.
As for IDE, I prefer PyCharm Community Edition. There I have created a virtual environment with xmbcstubs and some other popular XBMC Python modules, which helps me with my amateur (I'm not an IT guy actually Smile) experiments.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#36
(2014-12-20, 20:39)Roman_V_M Wrote:
(2014-12-20, 14:40)pieman Wrote: Not sure what I have done with the format of quotes in my last few posts but hopefully readers can make some sense of it.

xbmcstubs and PyXBMCt were written by the same person so he (?) obviously knows the ropes when it comes to Python and XBMC.

To be honest, I've forked xbmcstubs from another Github repo that got stale some time ago and try to keep it up to date with XBMC/Kodi Python development. And xbmcstubs just help you write code in your favorite IDE, it doesn't let you actually run the code.
As for IDE, I prefer PyCharm Community Edition. There I have created a virtual environment with xmbcstubs and some other popular XBMC Python modules, which helps me with my amateur (I'm not an IT guy actually Smile) experiments.
Just downloading PyCharm Community Edition now. So xbmcstubs will not allow us to run the xbmc code in a regular IDE? I think you are saying the virtual environment of PyCharm will allow us to run the code though. Thanks for the mod to the format of the PyXBMCt demo zip file and the dependencies are now met in Gotham.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#37
No. PyCharm will not allow you to run xbmc code in a gui/ide.
If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
Reply
#38
(2014-12-20, 21:16)nickr Wrote: No. PyCharm will not allow you to run xbmc code in a gui/ide.

So we need to stick with 'tail' then, right?
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#39
If you want a log of the code running, yes.
If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
Reply
#40
Smile 
(2014-12-20, 21:19)nickr Wrote: If you want a log of the code running, yes.

Specifically I want the log of the code NOT running i.e. all my bugs Smile
I don't like the word log in this context as it suggests a passed record of events whereas tail gives a live view of the code in operation.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#41
(2014-12-20, 21:24)pieman Wrote:
(2014-12-20, 21:19)nickr Wrote: If you want a log of the code running, yes.

Specifically I want the log of the code NOT running i.e. all my bugs Smile
I don't like the word log in this context as it suggests a passed record of events whereas tail gives a live view of the code in operation.
Not sure what your point is.
If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
Reply
#42
(2014-12-20, 21:27)nickr Wrote:
(2014-12-20, 21:24)pieman Wrote:
(2014-12-20, 21:19)nickr Wrote: If you want a log of the code running, yes.

Specifically I want the log of the code NOT running i.e. all my bugs Smile
I don't like the word log in this context as it suggests a passed record of events whereas tail gives a live view of the code in operation.
Not sure what your point is.

I think that what pieman and I are looking for a is process or tool (or explanation) of how to review Python syntax errors, EOL errors, indent errors, parsing errors etc. before we attempt to run the code through Kodi/XMBC. How does a developer try to correct these errors for XMBC specific scripts given we can't seem to do this in IDE?

Pieman sorry if I got that wrong.
_______________________
XBMC Coding Novice Learner
Reply
#43
(2014-12-20, 22:48)LandRover Wrote:
(2014-12-20, 21:27)nickr Wrote:
(2014-12-20, 21:24)pieman Wrote: Specifically I want the log of the code NOT running i.e. all my bugs Smile
I don't like the word log in this context as it suggests a passed record of events whereas tail gives a live view of the code in operation.
Not sure what your point is.

I think that what pieman and I are looking for a is process or tool (or explanation) of how to review Python syntax errors, EOL errors, indent errors, parsing errors etc. before we attempt to run the code through Kodi/XMBC. How does a developer try to correct these errors for XMBC specific scripts given we can't seem to do this in IDE?

Pieman sorry if I got that wrong.

You are spot on but I am happy that tail gives me a pretty good idea of where my code is at fault.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#44
A good python ide or even an editor like notepad++ will show syntax etc errors and may also do auto-completion. It won't show logic/algorithm errors.
If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
Reply
#45
(2014-12-20, 22:48)LandRover Wrote: I think that what pieman and I are looking for a is process or tool (or explanation) of how to review Python syntax errors, EOL errors, indent errors, parsing errors etc. before we attempt to run the code through Kodi/XMBC. How does a developer try to correct these errors for XMBC specific scripts given we can't seem to do this in IDE?

Pieman sorry if I got that wrong.

Yes, debugging addons using Kodi logs is difficult. I remember seeing in Wiki an article about remote debugging XBMC scripts in Eclipse + PyDev. I don't use Eclipse so I haven't read the article.

However, a good IDE can help you avoid many obvious errors. E.g. PyCharm have quite advanced code inspection that can pinpoint potential problems in your code.
Also best practices of programming recommend you to divide your code into structural parts and to separate presentation logic from business-logic. In terms of Kodi addons business logic is responsible for requesting data from web-servers, processing those data, etc. And business logic should (I'd say must) be put into separate modules that don't use Kodi-specific calls (if possible). This way your business logic can be wrapped in unit tests or other testing code and tested separately, outside Kodi. This way, the only thing that needs to be tested inside Kodi is presentation logic (e.g. presenting your music collection with art, descriptions etc.), and this greatly reduces debugging/testing efforts.
To put it simple: if parts of your addon can work outside Kodi, put them in separate modules and test/debug the usual way using IDE and Python for your OS.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
  •  Previous
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 14
  • Next 



Your 1st Add-On: Hello World!4.25