commit ac03bfbe1a4e22c364561d3cefc6ac3df9f6d7f7
Author: Robert 'Bob' Jensen <rpjensen(a)ws02.home.bobjensen.com>
Date: Wed Jan 5 14:50:33 2011 -0600
Cleaned up imports
multiboot-media-creator.py | 34 ++++++++++------------------------
1 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 160707c..c530ca5 100644
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -14,10 +14,7 @@
### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
### multiboot-media-creator Copyright 2010-2011 Robert 'Bob' Jensen
<bob(a)fedoraunity.org>, Dave Riches <email>, Dennis Johnson <email>, Ben
Williams <email>
-import os
-import glob
-import tempfile
-import shutil
+import os, glob, tempfile, shutil
def lives():
"""This part handles live images"""
@@ -32,18 +29,18 @@ def getisos(isopath):
isopath=os.path.join(isopath, "*.iso")
return glob.glob(isopath)
-def makedirs(iso):
- BN=iso.strip(".iso"+path)
- os.makedirs(os.path.join(mytemp, BN,"boot"))
- os.makedirs(os.path.join(mytemp, BN,"images"))
- os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
- os.makedirs(os.path.join(mytemp, BN,"tmp"))
+def makedirs():
+ for i in getisos(path):
+ BN=i.strip(".iso"+path)
+ os.makedirs(os.path.join(mytemp, BN,"boot"))
+ os.makedirs(os.path.join(mytemp, BN,"images"))
+ os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
+ os.makedirs(os.path.join(mytemp, BN,"tmp"))
print mytemp
def mount_iso(iso):
BN=iso.strip(".iso"+path)
os.system("mount -o loop %s %s" % (iso, os.path.join(mytemp, BN,
"tmp")))
- return os.path.join(mytemp, BN, "tmp")
def umount_iso(iso):
BN=iso.strip(".iso"+path)
@@ -52,16 +49,5 @@ def umount_iso(iso):
def removetemps():
shutil.rmtree(mytemp)
-def mount_and_steal():
- """Realistically, this is only here to prove things are working. It
will create the temps
-then mount the isos, then steal the kernels, then un-mount the isos. You get the
idea"""
- for i in getisos(path):
- makedirs(i)
- BN=i.strip(".iso"+path)
- mount_path=mount_iso(i)
- print "Mounted iso: %s" % i
- print "Mount point is: %s" % mount_path
- shutil.copy2(mount_path+"/isolinux/vmlinuz0",os.path.join(mytemp,
BN,"images/"))
- print "Stole the kernel"
- umount_iso(i)
- print "Un-mounted iso: %s" % i
+if __name__ == "__main__":
+ makedirs()