PyDev Predefined Completions for XBMC modules
#31
Where can this addon be downloaded? I cannot locate it in the xbmc.org repo using the instructions from http://wiki.xbmc.org/index.php?title=How...ptional.29
Reply
#32
I'm not sure why it's not showing up in the repository. If you install it by hand though, it should work.

cd to your addon directory (on Linux it's ~/.xbmc/addon).
run svn using:

Code:
svn co http://xbmc-pydev-predefcom.googlecode.com/svn/trunk/script.pypredefcom/ script.pypredefcom

Then run xbmc and the plugin should be under the "Programs" menu.

Sorry about the issue.
Reply
#33
There's a bug in it anyway. Give me a day to get that resolved and I'll post back here.
Reply
#34
I said "a day" but I didn't say which. :-p

Sorry. I've been busy. I should be able to get this taken care of this weekend.
Reply
#35
Bug 
Svn'ed addon manually as mentioned above. But problem still exist:

Code:
ERROR: Traceback (most recent call last):

File "C:\Program Files\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.

Any prospects to fix it?
Reply
#36
Yup. Sorry. If you change that to

Code:
Addon = xbmcaddon.Addon( id='script.pypredefcom' )

... it will work. I'm moving the project to GitHub and rereleasing it. Sorry for the trouble.
Reply
#37
(2012-09-10, 13:22)jfcarroll Wrote: ... it will work. I'm moving the project to GitHub and rereleasing it. Sorry for the trouble.
Sure, I did find this by myself... Thanks a lot, it works fine now!

Only as remark...
Addon works perfect if the full path to goal folder has ASCII English. For localized names it crashes:

Code:
INFO: -->Python script returned the following error<--
ERROR: Error Type: <type 'exceptions.UnicodeDecodeError'>
ERROR: Error Contents: 'ascii' codec can't decode byte 0xd0 in position 13: ordinal not in range(128)
ERROR: Traceback (most recent call last):
File "/home/mefody/.xbmc/addons/script.pypredefcom/addon.py", line 84, in <module>
  pDialog.update(count * 25, Addon.getLocalizedString(30711 ) % (module + ".pypredef", ), Addon.getLocalizedString(30712) % (predefcompath, ) )
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 13: ordinal not in range(128)
INFO: -->End of Python script error report<--
Reply
#38
(2012-09-10, 14:29)Mefody Wrote:
(2012-09-10, 13:22)jfcarroll Wrote: ... it will work. I'm moving the project to GitHub and rereleasing it. Sorry for the trouble.
Sure, I did find this by myself... Thanks a lot, it works fine now!

Only as remark...
Addon works perfect if the full path to goal folder has ASCII English. For localized names it crashes:

Code:
INFO: -->Python script returned the following error<--
ERROR: Error Type: <type 'exceptions.UnicodeDecodeError'>
ERROR: Error Contents: 'ascii' codec can't decode byte 0xd0 in position 13: ordinal not in range(128)
ERROR: Traceback (most recent call last):
File "/home/mefody/.xbmc/addons/script.pypredefcom/addon.py", line 84, in <module>
  pDialog.update(count * 25, Addon.getLocalizedString(30711 ) % (module + ".pypredef", ), Addon.getLocalizedString(30712) % (predefcompath, ) )
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 13: ordinal not in range(128)
INFO: -->End of Python script error report<--
Well known problem
try adding:
PHP Code:
.decode('utf-8'

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#39
(2012-09-10, 14:52)Martijn Wrote: Well known problem
try adding:
PHP Code:
.decode('utf-8'
It's not a problem for me - I use English path/names from times of old good MSDOS & Turbo C Smile
But for this "PyDev PreCom addon" newbies it will be a good remark in FAQ - to use only ASCII names...

Thanks a lot for cooperation!
Reply
#40
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.
Reply
#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.

Reply
#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
Reply
#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
Reply
#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/
Reply
#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
Reply

Logout Mark Read Team Forum Stats Members Help
PyDev Predefined Completions for XBMC modules3