PyDev Predefined Completions for XBMC modules

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
giftie Offline
Skilled Python Coder
Posts: 2,036
Joined: Mar 2010
Reputation: 35
Post: #41
Look 4 messages up.. #36.

(2012-10-06 16:13)pewpew1 Wrote:  I checked out the source from svn (trunk), but I get the below error, when I try to run it.

Code:
WARNING: XFILE::CFileFactory::CreateLoader - Unsupported protocol(addons) in addons://more/executable.tbn
16:02:22 T:2592  NOTICE: -->Python Interpreter Initialized<--
16:02:22 T:2592   ERROR: Error Type: <type 'exceptions.Exception'>
16:02:22 T:2592   ERROR: Error Contents: Could not get AddonPtr given a script id of XBMC. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
16:02:22 T:2592   ERROR: Traceback (most recent call last):
                                              File "C:\Users\traesprit\AppData\Roaming\XBMC\addons\script.pypredefcom\addon.py", line 56, in <module>
                                                Addon = xbmcaddon.Addon( id=os.path.basename( os.getcwd() ) )
                                            Exception: Could not get AddonPtr given a script id of XBMC. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
16:02:51 T:4472 WARNING: XFILE::CFileFactory::CreateLoader - Unsupported protocol(addons) in addons://more/executable.tbn
16:02:52 T:3288  NOTICE: -->Python Interpreter Initialized<--
16:02:52 T:3288   ERROR: Error Type: <type 'exceptions.Exception'>
16:02:52 T:3288   ERROR: Error Contents: Could not get AddonPtr given a script id of XBMC. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
16:02:52 T:3288   ERROR: Traceback (most recent call last):
                                              File "C:\Users\traesprit\AppData\Roaming\XBMC\addons\script.pypredefcom\addon.py", line 56, in <module>
                                                Addon = xbmcaddon.Addon( id=os.path.basename( os.getcwd() ) )
                                            Exception: Could not get AddonPtr given a script id of XBMC. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.

XBMC info: XBMC (11.0 Git:20120321-14feb09), Platform: Windows 7, 64-bit (WoW) Service Pack 1 build 7601. Built on Mar 21 2012 (compiler 1600)

Anyone else got this problem? If needed I can post the whole debug log - just thought the above snipplet was enough.

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
pewpew1 Offline
Junior Member
Posts: 24
Joined: Sep 2010
Reputation: 0
Post: #42
I am so sorry - I quickly looked through the post and at first glace I thought it was related to the ASCII stuff. I will look closer next time, before I post Smile
find quote
chrisdibartolo Offline
Junior Member
Posts: 2
Joined: Dec 2012
Reputation: 0
Post: #43
I've been able to get this partially working for Eden 11.0 on Mac OS X 10.6 (python 2.6.1 is installed)

I'm using Eclipse Juno, but only xbmcplugin and xbmcaddon predefined completions are functional.

Both xbmc and xbmcgui fail with an unresolved import.

Additionally, any attempt at debugging (module being debugged has no reference to xbmc) results in the following error:
Traceback (most recent call last):
File "/Applications/eclipse/plugins/org.python.pydev_2.7.1.2012100913/pysrc/pydevd.py", line 4, in <module>
from pydevd_comm import CMD_CHANGE_VARIABLE, \
File "/Applications/eclipse/plugins/org.python.pydev_2.7.1.2012100913/pysrc/pydevd_comm.py", line 82, in <module>
import pydevd_file_utils
File "/Applications/eclipse/plugins/org.python.pydev_2.7.1.2012100913/pysrc/pydevd_file_utils.py", line 48, in <module>
import xbmc
ImportError: No module named xbmc
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,915
Joined: Dec 2004
Reputation: 17
Post: #44
http://xbmc-addons.googlecode.com/svn/ad...ipt.pydocs

combines jfcarolls pydev and my pydocs scripts. it should work.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
chrisdibartolo Offline
Junior Member
Posts: 2
Joined: Dec 2012
Reputation: 0
Post: #45
thank you for the prompt response and for the updated link to the new scripts.

i’m able to run these on frodo, however on eden an exception is thrown due to mkdirs only being available on frodo.

rather than updating the scripts i upgraded to frodo.

however, using Frodo, the same unresolved imports for xbmc and xbmcgui remained on os x.

i'm able to resolve this with the following src files: https://github.com/twinther/xbmcstubs by adding a directory containing these (checked out with git) via Project>Properties>PYTHONPATH>External Libraries>Add Source Folder

i’ve also tested this on ubuntu Ubuntu 12.04.1 LTS (Precise Pangolin), which was unable to resolve imports for xbmc, xbmcgui, xbmcplugin, xbmcaddon, and xbmcvfs until the xbmcstubs src directory was added as an external library
find quote
nightjar Offline
Junior Member
Posts: 1
Joined: Dec 2012
Reputation: 0
Post: #46
I'm new to XBMC and Python, but I got it to work by commenting out the mkdirs part and creating the directory structure by hand (e.g. docs/PyDocs and docs/PyPredefs) then setting it to use 'docs'.
find quote
schlameel Offline
Junior Member
Posts: 7
Joined: Mar 2012
Reputation: 0
Post: #47
Deleted
(This post was last modified: 2012-12-30 23:00 by schlameel.)
find quote
Martijn Offline
Team-XBMC
Posts: 7,696
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #48
(2012-12-30 22:39)schlameel Wrote:  
(2012-12-03 14:27)Nuka1195 Wrote:  http://xbmc-addons.googlecode.com/svn/ad...ipt.pydocs

combines jfcarolls pydev and my pydocs scripts. it should work.

Nuka, first thanks. Second, on line 92 of addon.py, you've got a typo. There is an 's' on 'mkdir' (mkdirs).

Code:
xbmcvfs.mkdirs(_path)

should be
Code:
xbmcvfs.mkdir(_path)

No that is correct

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
schlameel Offline
Junior Member
Posts: 7
Joined: Mar 2012
Reputation: 0
Post: #49
Hmm. The first couple times I ran it it complained about 'mkdirs' not being part of the object or something. I changed it to 'mkdir' and it ran. I changed it back after your comment and it runs with 'mkdirs'. I'll change my comment. Thank you.
find quote
Post Reply