Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some major fixes, added check for data option

  • Loading branch information...
commit c6a3174acd341924d6a038a39e9b64ecb0e85ed4 1 parent 5324cbe
Marcin Karpezo authored
Showing with 11 additions and 8 deletions.
  1. +3 −3 README
  2. +8 −5 simpleburner.py
View
6 README
@@ -20,9 +20,9 @@ OPTIONS:
* h, help - print help message
* t, test - run in test burn mode
* b, burn-only - run without making iso image (‘—name=/full/path/to/image.iso’iso option must be defined)
- * m, makeiso - make only iso image (without burn), by default Your iso file will be stored in /tmp
- * data=s - set directory willth data to burn (default /tmp/burner)
- * name=s - set name of iso file (defaultault cd.iso)
+ * m, makeiso - make only iso image (without burn)
+ * data=s - set directory willth data to burn
+ * name=s - set name and path of iso file (by defaultault /tmp/cd.iso)
* device=s - set device to use (default /dev/sr0)
* speed=s - set burning speed
View
13 simpleburner.py
@@ -39,6 +39,10 @@ def programcheck():
else:
print >>sys.stderr, "Not found: Please install cdrkit or cdrtools!"
sys.exit(1)
+def optcheck():
+ if not datadir:
+ print >>sys.stderr, "Failed! You must deine --data option."
+ sys.exit(1)
def makeiso():
print "Making iso image..."
command = "%s -U -o %s %s" % (isomaker, isoname, datadir)
@@ -47,7 +51,7 @@ def makeiso():
print >>sys.stderr, "Failed!"
sys.exit(1)
else:
- print "[OK]"
+ print "[OK]\nFile stored in %s" % isoname
def burniso():
print "Burning iso..."
if speed:
@@ -70,8 +74,8 @@ def burniso():
parser = OptionParser(usage=usage)
parser.add_option("--data", dest="datadir",
help="set directory with data to burn")
- parser.add_option("--name", dest="isoname",
- help="set path and/or name of iso image")
+ parser.add_option("--name", dest="isoname", default="/tmp/cd.iso",
+ help="set path and/or name of iso image (by default /tmp/cd.iso)")
parser.add_option("--device", dest="device", default="/dev/sr0",
help="set device to use (default /dev/sr0)")
parser.add_option("--speed", dest="speed",
@@ -92,9 +96,8 @@ def burniso():
burn = options.burn
make = options.make
- print burn, make
programcheck()
-
+ optcheck()
if burn == True:
burniso()
elif make == True:
Please sign in to comment.
Something went wrong with that request. Please try again.