~ubuntu-branches/ubuntu/trusty/serpentine/trusty

« back to all changes in this revision

Viewing changes to serpentine/mastering.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-03-03 11:12:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060303111242-01ogkka2273vre4x
Tags: 0.6.91-0ubuntu1
New upstream version (UVF exception approved by mdz)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from os import path
27
27
from types import IntType, TupleType
28
28
from gettext import gettext as _
 
29
from gettext import ngettext as N_
29
30
 
30
31
# Local modules
31
32
import operations
62
63
            for l in self.listeners:
63
64
                l.on_finished (e)
64
65
            return
65
 
                
66
 
        elif len (self.errors) > 1:
67
 
            title = _("Unsupported file types")
68
 
        else:
69
 
            title = _("Unsupported file type")
70
 
            
 
66
 
71
67
        filenames = []
72
68
        for e in self.errors:
73
69
            filenames.append (urlutil.basename(e.hints['location']))
74
70
        del self.__errors
75
71
        
76
 
        if len (filenames) == 1:
77
 
            msg = _("The following files were not added:") + "\n"
78
 
        else:
79
 
            msg = _("The following files were not added:") + "\n"
80
 
        
81
 
        msg += " "
82
 
        msg += ", ".join (filenames)
83
 
 
84
 
        gtkutil.dialog_error (title, msg, parent = self.parent)
 
72
        title = N_(
 
73
            "Unsupported file type",
 
74
            "Unsupported file types",
 
75
            len(filenames)
 
76
        )
 
77
 
 
78
        msg = N_(
 
79
            "The following file was not added:",
 
80
            "The following files were not added:",
 
81
            len(filenames)
 
82
        )
 
83
 
 
84
        gtkutil.list_dialog(
 
85
            title,
 
86
            _("If you're having problems opening certain files make sure you "
 
87
              "have the GStreamer plugins needed to decode them."),
 
88
            list_title=msg,
 
89
            parent=self.parent,
 
90
            items=filenames,
 
91
            stock = gtk.STOCK_DIALOG_ERROR,
 
92
            buttons =(gtk.STOCK_CLOSE, gtk.RESPONSE_OK),
 
93
        )
85
94
        
86
95
        e = operations.FinishedEvent (self, operations.SUCCESSFUL)
87
96
        for l in self.listeners:
103
112
    
104
113
    def start (self):
105
114
        if self.app.preferences.useGnomeVfs:
106
 
            oper = audio.gvfsAudioMetadata(self.hints["location"])
 
115
            oper = audio.get_metadata(audio.GVFS_SRC, self.hints["location"])
107
116
            
108
117
        else:
109
118
            url = urlutil.UrlParse(self.hints["location"])
115
124
                return
116
125
                
117
126
            filename = url.path
118
 
            oper = audio.fileAudioMetadata (filename)
 
127
            oper = audio.get_metadata("filesrc", filename)
119
128
 
120
129
        oper.listeners.append (self)
121
130
        try: