ScriptFailed! New line problem??
#1
I am not using list item function just play in py script and it works
Quote:#import re
#import sys
#import urllib
#import urlparse
#import xbmc
import xbmcgui
import xbmcplugin

file = 'rtmp://thereisanrtmpfiletoplay.com/'
xbmc.executebuiltin("xbmc.PlayMedia("+file+")")


I tried to make an error exeption saying:

Quote:file = 'rtmp://thereisanrtmpfiletoplay.com/'
now='Could not connect!'

#state if file is true just play item
#state if file is false show notification
def check():
if file:
print "1 - Got a true expression value"
print file
xbmc.executebuiltin("xbmc.PlayMedia("+file+")")
else:
print "1 - Got a false expression value"
print file
xbmc.executebuiltin('Notification(ERROR,'+now+',3000,)')

check()
#executing function ^

that is my log file?

Quote:instantiating addon using automatically obtained id of "plugin.video.teststv1" dependent on version 2.1.0 of the xbmc.python api
12:55:03 T:2156 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('expected an indented block', ('C:\\Users\\pythonprofile\\AppData\\Roaming\\XBMC\\addons\\plugin.video.teststv1\\default.py', 25, 2, 'if file:\n'))
IndentationError: ('expected an indented block', ('C:\\Users\\pythonprofile\\AppData\\Roaming\\XBMC\\addons\\plugin.video.teststv1\\default.py', 25, 2, 'if file:\n'))
-->End of Python script error report<--
12:55:03 T:2156 INFO: Python script stopped

Quote:default.py', 25, 2, 'if file:\n

so I cant make an new line in python script? I do not get that.
Reply
#2
Those are indentation errors. Python relies on specific indentation. Its kind of fundamental.

Just google Python Indentation.
Reply
#3
Thanks got it, the problem wasnt with code, it was with notepad++ as i saved file propably utf 8 was not applied, never thought that it would be a problem.

I am begginer in python development but with Your support it has came easy to understand problems with codding. Thanks.

Python dev its not same as implementing xbmc build in functions in code, but slowly i understand more and more,

How do You debug xbmc within python idle? Or you use something else. I know you can debug via log file but is it any way to debug it with breakstops or live as in other languages?

Thanks again.
Reply
#4
You can look for xbmcstubs.

I dont use it, though. So dont know how to set it all up.
Reply

Logout Mark Read Team Forum Stats Members Help
ScriptFailed! New line problem??0