Plugins: serpentine.py

File serpentine.py, 1.3 kB (added by b2besses@free.fr, 1 year ago)

Burn a CD with serpentine (based on K3B Burning plugin)

Line 
1 # Copyright 2005 Joe Wreschnig
2 # Modified for serpentine by Benjamin De Besses
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 as
6 # published by the Free Software Foundation
7 #
8 # $Id: serpentine.py 3644 2006-07-16 23:11:24Z piman $
9
10 import os
11 import util
12 from qltk import ErrorMessage
13 from plugins.songsmenu import SongsMenuPlugin
14
15 class Serpentine(SongsMenuPlugin):
16     PLUGIN_ID = 'BurnWithSerpentine'
17     PLUGIN_NAME = _('Burn Audio CD')
18     PLUGIN_DESC = 'Burn Audio CDs with Serpentine'
19     PLUGIN_ICON = 'gtk-cdrom'
20     PLUGIN_VERSION = '0.1'
21
22     def plugin_songs(self, songs):
23         if not util.iscommand("serpentine"):
24             ErrorMessage(
25                 None, "Serpentine not found",
26                 "The Serpentine burning program was not found. "
27                 "You can get Serpentine at http://s1x.homelinux.net/projects/serpentine.").run()
28         else:
29             files = [song['~filename'] for song in songs]
30             try: util.spawn
31             except:
32                 if len(files) == 1: filelist = "%r" % files[0]
33                 else: filelist = ("%r " * len(files)) % tuple(files)
34                 os.system('serpentine -o %s &' % filelist)
35             else:
36                 util.spawn(["serpentine", "-o"] + files)