Agent x - zip file stuff
#1
Image

i've decided to try some python as of late by adopting a few code examples out there into a download/content manager that downloads files from a repository and extracts them directly onto the xbox.

you can check it out here: http://www.xr8d.net/dev/

although it works fine, i've run into a couple of minor issues...

first, zip files use cp437 encodings where as i believe the xbox uses latin-1. so when extracting files with foreign (ie: non-english) characters, it would bomb. i figured out how to re-encode the file/directory names from the zip so that appears to work fine now.

the second problem is one that i suspect there is no real good answer for, but i am hoping you xbmc python gurus can steer me in the right direction. the zipfile module in python loads individual files from a zip archive to memory which you then write to disk in binary format. this works perfect for 99% of everything i tried. the only time i came across an issue was when one of the files inside the zip was over 30 megs in size. i am guessing this eats too much memory on the xbox and it just freezes.

the last problem i had was with using agent x to upgrade xbmc itself. certain files will not overwrite themselves. for example the skin texture files and the current running script. i don't know if there is a way to 'unlock' these files for writing or if that is simply impossible.

-prestige

ps: for the record, i hate python! indentation... argh. let's see a perl port to the xbox and then we'll be cooking! Smile
Reply
#2
heh im liking python alot more than perl. my stuff is always indented right anyway.

i dont think you can overwrite locked files if xbmc is currently running... you could hack something to download things to a temp dir and then run a small unleashx program with a script that will replace xbmc files with the ones in the temp dir....

actually im not sure if you can run xbe's, the api is pretty limited to tell you the truth. i wish we had the spin and toggle button controls :-)
Reply
#3
try deleting said files via xbmc, or your dashboard. i sometimes run into ftp not deleting files when it says it has
Reply
#4
ooo also, overwriting a file is a lil dif

Quote:import os

os.unlink(filename)

to delete
Reply

Logout Mark Read Team Forum Stats Members Help
Agent x - zip file stuff0