commit d543540c8e64a8b91814c0f3f976da86bfb52bf9 Author: Dave Riches dcr226@fedorapeople.org Date: Fri Jan 7 09:41:04 2011 +0000
getisos() now has the ability to determine the type of iso. it is called like getisos(path,type). example getisos(./,live) would return a list of the live iso's in the cwd
multiboot-media-creator.py | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) --- diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py index be0db4f..6a7f18b 100644 --- a/multiboot-media-creator.py +++ b/multiboot-media-creator.py @@ -29,9 +29,17 @@ disable = ('no', 'off', 'false', '0') path=os.getcwd() # ok, so this will need to change mytemp=tempfile.mkdtemp(suffix=".mmc")
-def getisos(isopath): +def getisos(isopath,isotype): isopath=os.path.join(isopath, "*.iso") - return glob.glob(isopath) + for i in glob.glob(isopath): + os.system("mount -o loop %s %s &>/dev/null" % (i, mytemp)) + if os.path.isfile(os.path.join(mytemp+"/.discinfo")) == True: + info="dvd" + else: + info="live" + os.system("umount %s &>/dev/null" % i) + if info==isotype: + print i,info
def makedirs(iso): BN=iso.strip(".iso"+path)
multiboot-media-creator@lists.fedorahosted.org