dandar3 wrote:Alternatively, why not use Python native commands? like shutil.copyfile() and os.delete() or shutile.move()?
Right...that's what I finally came up with:
Code: Select all
import shutil
import os
rmfile = 'Q://UserData/script_data/CU LRC Lyrics/settings.xml'
filename = 'Q://skin/rapier-clarity-mod/scripts/CU LRC Lyrics/settings.xml'
destination = 'Q://scripts/CU LRC Lyrics/resources/settings.xml'
shutil.copyfile(filename,destination)
os.remove(rmfile)
This
whole thing has got me pulling my hair out...but I finally found a work around for that at least. When installed CU LRC Lyrics (1.0.7) works, but some of the default settings in the settings.xml make it not xbmc4xbox friendly. The whole point of this script is to place it in the script folder of my skin, replace all of the files that need fixing for us, and then delete them when it's finished (the above code isn't finished yet...still need to replace a couple of scrapers in the same manner along with musicosd). I figure rather than hosting the link, or modding it to work, I can get away with just replacing specific files in this manner once it's installed. A really dirty hack, but what's up above is working so far
I'm getting a script error from the "os.remove" but is working...to lazy to paste a debug right now, been working on this for hours.
Really the goal is just to make a button install a script for the user (all about easy logical use of the software), and then be able to run it without the hassle of manually installing it...really appreciate the post, tyvm! BTW, how exactly does os.remove work? Does what I have up there work?