Kodi Community Forum
Python Scripts Development - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Python Scripts Development (/showthread.php?tid=2045)

Pages: 1 2 3 4 5 6 7 8


- burriko - 2004-02-26

i've been trying to close a script using sys.exit(), but it just seems to freeze xbmc. is this a known issue?

is there another way to stop a python script during execution?


- alx5962 - 2004-02-26

(burriko @ feb. 26 2004,13:27 Wrote:i've been trying to close a script using sys.exit(), but it just seems to freeze xbmc.  is this a known issue?

is there another way to stop a python script during execution?
del <name of the class> should work
or close() if you are using the xbmc library


- darkie - 2004-02-26

Quote:i've been trying to close a script using sys.exit(), but it just seems to freeze xbmc.  is this a known issue?
known issue and it is not a bug. sys.exit() just exits the process in which the script is currently running, and since xbmc and python are both running in the same process xbmc will freeze to.

and you don't have to exit scripts, it is all done automaticly. but it would be nice to clean up everything that is used in the script with del in the end


- burriko - 2004-02-26

thanks for the replies. xbmc.close() did the trick.


- Zinger - 2004-03-03

i was wondering about dummy "imports" that would just print a list instead of displaying the xmbcgui selection dialog, for example. or even wrap an existing windows python dialog.

anyway i'd more appreciate help with a script thats driving me mad. i'm scraping info from shoutcast and presenting in selection dialogs genres/stations and finally retrieving the audio stream from a pls and passing to xmbc. it's only pulling info from selections made not leaching the whole site at once. this all works but after repeated url requests, network response times slow, current playing song starts skipping. then i start to receive socket read errors and have to recycle xmbc to get network moving again. any suggestions?

url code:

Quote: req = urllib2.request(url)
req.add_header('authorization', 'basic ')
try:
progress.create("attempting to connect to:\n %s" % url)
time.sleep(2)
urlhandle = urllib2.urlopen(req)
remotedata = urlhandle.read()
urlhandle.close()
return remotedata

thanks,
brian


- Zinger - 2004-03-04

network will eventually start working again if i wait a long time. i'm wondering if there is something else i can do to close the socket connection. i tried adding:

Quote:timeout = 20.0
socket.setdefaulttimeout(timeout)

but i does not seem to improve things.

thanks,
brian

of python: the indentation was killing me at first but i'm liking it now. no more hunts for missing braces :}


- alx5962 - 2004-03-05

scripts page (in french)

the google script works with english news too, just edit the script!


- gaogao - 2004-03-08

very interesting and promising news here...

btw, wouldn't it be more convenient to have a stand-alone python interpreter, i.e. not needing to get in xbmc to execure phyton code? would it be difficult to separate from xbmc so that we can run a .py from whatever dashboard?

gg


- alx5962 - 2004-03-08

my scripts

the bit-torrent client is here, and an english doc included too Smile


- contrast - 2004-03-09

this is really great alx !! thanks !

now i have some additions, it would so rock if you could script it..

#1.the updating of the downloading, is it possible to have it sticky somewhere like the red "recording", so that i dont have to go all the way into settings/script/blablabla and press info, then i'm watching a movie or listening to some music..

maybe it should be just under "rec", so that when i record a song, i see them both with the same color (?)
oh man that would be so cool !

#2.it would be great if the bandwidth would update everytime it downloads 10 kb or so.

#3.is it possible to make a bittorrent fileselector so that i don't have to edit the source in the script itself ?


- burriko - 2004-03-11

alx5962 - it might be a good idea to start a new thread about your bittorent client, as this thread has been pulled off topic quite a bit.

btw, can i pm you the link to a nice menu i made for it that makes it really easy to download the last tv show episodes, you could include it in the bitxbox package. i don't want to post it here because i don't think the mods will like it as it links to a torrent site that distributes copyrighted material.


- alx5962 - 2004-03-11

bit torrent update

read the readmexbox !


- silentyl - 2004-03-12

nice work with the bt script ...i can just use the .torrent file i've downloaded...by #'ing the other source line instead

a question..is it normal to have sevel pages of output..or is it possible to just use 1 page and refresh it over and over...or maybe press "black button" for just current results like:

upspeed, downspeed, upmb, downmb, % complete


- LaSnow - 2004-03-23

none of my scripts are not working, debug says: os module missing, or something like that.
i didnt install phyton last time i just extracted whole phyton (phyton.rar) in a dir and it was working fine. suddently it stopped working. how do i reinstall ?  i erased everything again and started from scrath but it still say the same.
"no os module" . looked on phyton www but didnt find any answers there.
im a total newbe. how do i reinstall phyton?  please help me, im going nuts, nothing works.

may-day may-day, sos :  ladies and gentlemen, we are about to krash and burn   Sad


- burriko - 2004-03-29

is there currently any way to get details about the current song that is playing? i've tried the getdescription(), getduration(), getfilename() methods but they seem to only work if you're creating a playlist in python. i don't want to influence what's being played just find out details about what xbmc is currently playing.
the reason i'm interested in this is that i was going to attempt to write an audioscrobbler plugin, but i'd need to know the title, artist, total length and current position of the currently playing song in xbmc.
could this info be made available to python?

thank you.