commit 9ba8a0ecc75a00a2cb3a9939ba62bb5077f880e1 Author: Dave Riches dcr226@fedorapeople.org Date: Mon Jan 10 21:07:22 2011 +0000
added cli options for directory and usb device
multiboot-media-creator.py | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) --- diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py index 1ad0a4f..979576f 100644 --- a/multiboot-media-creator.py +++ b/multiboot-media-creator.py @@ -21,13 +21,38 @@ __version__ = "$Revision: 4 $"
VERSION = '0.4.0'
-variables = {} +from optparse import OptionParser
-enable = ('yes', 'on', 'true', '1') -disable = ('no', 'off', 'false', '0') +parser = OptionParser() +parser.add_option("-d", "--directory", dest="directory", + help="Directory containing ISO images", metavar="DIR") +parser.add_option("-q", "--quiet", + action="store_false", dest="verbose", default=True, + help="don't print status messages to stdout (curently not implemented)") +parser.add_option("-D", "--device", dest="device", + help="USB device to create media", metavar="USB") +(options, args) = parser.parse_args() + +#print options.directory + +#variables = {} + +#enable = ('yes', 'on', 'true', '1') +#disable = ('no', 'off', 'false', '0') + +if options.directory==None: + path=os.getcwd() +else: + path=options.directory
-path=os.getcwd() # ok, so this will need to change mytemp=tempfile.mkdtemp(suffix=".mmc") +dev=options.device +print path +print dev + +def mount_device(device): + os.system("mount %s %s" % (dev, mytemp)) +
def getisos(isopath,isotype): """getisos returns a list of isos inside a specific path
multiboot-media-creator@lists.fedorahosted.org