File: write_iso.py

package info (click to toggle)
gnome-python-desktop 2.32.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,548 kB
  • sloc: sh: 10,214; xml: 8,851; ansic: 3,428; python: 1,457; makefile: 664
file content (22 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys
sys.path.append ('..')
import nautilusburn
import gtk
import gobject

if len(sys.argv) != 2:
	print "Usage: write_iso <iso>"
	print "Writes an ISO in maximum speed in simulation mode."
	sys.exit (1)

def on_progress_changed (recorder, fract):
	print "%d%%" % (fract * 100)
	
r = nautilusburn.Recorder()
drives = nautilusburn.get_drives_list(True)
d = drives[0]
t = nautilusburn.DataTrack()
t.filename = sys.argv[1]
r.connect ('progress-changed', on_progress_changed)
print r.write_tracks (d, [t], d.get_max_speed_write(), nautilusburn.RECORDER_WRITE_DUMMY_WRITE | nautilusburn.RECORDER_WRITE_EJECT)
print "done"