Python Development Tools and modules/libraries for XBMC Scripters (outdated)
#1
as you might know, in addition to writing fun and helpful scripts (well...i think they're fun and helpful...) like xmovieguide, i've also been working on several utilities to make scripting for the xbox easier and more pleasant.

so far, i've released an xbmc emulator (discussion thread) that allows limited testing of your xbox scripts on a pc with a python installation, a script management utility (discussion thread) that's a little friendlier than xbmc's built-in (and will get even better, if i have the time), and i've rewritten alx5962's excellent scripting tutorial with some additional features and some fancier formatting (i'm a technical writer by trade--fancy formatting is what i do).

when i first released the emulator, the admins here were kind enough to pin the thread concerning it to keep it easily available. once i released a couple more of these utility functions (and realized how many others you guys have provided, like bitplane's py9 dictionary and xml-based skin reader), we decided we needed a better pinned thread to keep up-to-date on what scripting tools had been developed.

so this thread will replace the emulator thread at the top of the scripting forums. you can still find the old thread here (and i linked it above, too), for emulator-specific discussion. this thread is intended for announcements, as well as brainstorming what additional tools are needed. it will contain links and updates to all the other scripting tools i release (such as my new xbmc gui widgets, if i ever get around to them).

i also invite you to post announcements, discussion, and links for any scripting tools you've developed that have been useful to you. this is intended to be a standard place to discuss development tools available, not just an ad for my webpage. :-)

alexpoet
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#2
i've just released the image transitions library.

this is a script (and a folderful of utility images) that you drop into your q:/python/lib/ folder to provide powerpoint-like image transitions to jazz up scene changes.

so far this includes the following:
- fade-to-black
- fade-from-black
- crossfade (one image fades out, a new one fades in)
- slide-from-right
- slide-from-below (i'm waiting on the devs before i can do from left and above)
- zoom in (expand from center to fill screen)
- zoom out (shrink current image off of screen)
- crosszoom (one image zooms out, a new one zooms in)

i've posted a discussion thread in case you have any specific questions/comments.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
okies, here's mine: (so far)

py9 dictionary
like a nokia t9 dictionary for typing sms, but better cos it'll work on your xbox.

skin reader library
separate the aesthetics from the mechanics, someone else can make it look pretty :d
Reply
#4
not my work but i found it useful!!


Quote:pysmb

pysmb is an experimental smb/cifs library written in python.
the library has been tested to be able to connect win 98 se and samba 2.0 machines, and upload/download files to and from these machines. unfortunately, some users have reported that pysmb is unable to work with windows 2000 and windows xp in version 0.3.1 and earlier. version 0.4.0 has been tested to work with win2k. unforunately, i have not been able to test it with winxp and win me as i do not have access to these operating systems. please send me feedback if you have used pysmb on these operating systems.

http://miketeo.net/projects/pysmb/

http://miketeo.net/projects/pysmb/pysmb-0.4.4.zip
Reply
#5
i have developed a console debugger... you run script on xbmc and debug on your pc... :thumbsup: (not thread yet)

here:
xbmc script debugger

here the forum:
debugger forum

read readme in zip for details...
Reply
#6
Star 
cachedhttp.py: a convenience script that makes it easier to write download code for xbmc.

find it at http://www.xbmcscripts.com/

advantages over using standard urllib:
* timeouts (prevents freeze)
* cache
* useragent
* can evaluate relative urls
* cancel-able progress bar. (optional)
* cookie support
Reply
#7
settingsmgr.py: a generic settings manager.

find it at http://www.xbmcscripts.com/

extremely simple to use:
Quote:import settingsmgr
fname='c:\testsettings.xml'
settings=settingsmgr.readsettings(fname)
timeout=settings['timeout']
print('timeout:'+str(timeout))
settingsmgr.opencontrolpanel(fname)
Reply
#8
i never found any info on how the get drive free space, so i'm posting this for others who need it. please let me know if there is any better way (i realize some of the code in the ftp part could be done better, but i wrote it when i was first learning, and i'm too lazy to fix it =] )

this code first tries to use the httpapi (available after july 21, 05) and then defaults to getting it via ftp. if you don't want to support older versions, you can modify this to use the httpapi inteface only.

hope this helps someone

ruuk

Quote:# returns number of full megabytes

def free(drive,ip,user,password):
return space(drive,ip,user,password)

ftpmode = false
try:
from xbmc import executehttpapi
except:
ftpmode = true

space = none
if not ftpmode:
def space(drive,ip,user,password):
drives = {'c':'115',
'e':'117',
'f':'118',
'g':'119'}
free = executehttpapi('getsysteminfo(' + drives[drive] + ')')
val = free.split(drive + ': ',1)[1]
val , type = val.split(' ',1)
type = type[:2].upper()
return convert_value(val,type)
else:
def space(drive,ip,user,password):
try:
from ftplib import ftp
ftp = ftp(ip,user,password)
space_line = ftp.retrlines('list', blah)
ftp.quit()
bits = space_line.split(drive + ':\\ ')
last = bits.pop()
final = last.split(' ')
amount = float(final[0])
type_get = final[1]
bits = type_get.split(']')
type = bits[0]
return convert_value(amount,type)
except:
return 0

def blah(line):
pass

def convert_value(val,type):
if type == 'mb':
return int(val)
elif type == 'gb':
return int(float(val) * 1024)
else:
return 0
Reply
#9
good stuff add sample snippets here:
http://manual.xboxmediacenter.de/wakka.p....g&v=vr9
Cool
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
for what it's worth, my personal website is back up again. thanks to everyone who hosted the files elsewhere while it was down.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#11
[dosamba.py: an example of a basic smb file navigator.

find it at http://www.xbmcscripts.com/

This is a fairly crude script but could be usefull to somebody.
Server: FreeNas 9 NAS: 6*3TB - Kodi Sql Database
Kodi Systems: Nvidia Shield Pro, G-Box Q (OpenElec), RikoMagic MK802 IV[
Skin: reFocus
Reply

Logout Mark Read Team Forum Stats Members Help
Python Development Tools and modules/libraries for XBMC Scripters (outdated)1