~ubuntu-branches/ubuntu/karmic/quodlibet/karmic

« back to all changes in this revision

Viewing changes to quodlibet/qltk/information.py

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-07-27 14:02:54 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20090727140254-zxutnf2kkhtpubnp
Tags: 2.1-2ubuntu1
* Resync from debian unstable (LP: #401965)
* debian/patches:
  - fix-context-crashes.patch: Dropped. Included Upstream.
  - 60-popen2-deprecated.patch: Dropped. Included Upstream.
* debian/quodlibet-ext.install: Changed 'site-packages' to '*-packages'.
* debian/rules: Changed 'site-packages' to '*-packages'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# it under the terms of the GNU General Public License version 2 as
6
6
# published by the Free Software Foundation
7
7
#
8
 
# $Id: information.py 4330 2008-09-14 03:19:26Z piman $
 
8
# $Id: information.py 0a66840a1115 2008/11/30 19:57:32 $
9
9
 
10
10
import time
11
11
 
21
21
from quodlibet.qltk.lyrics import LyricsPane
22
22
from quodlibet.qltk.x import Window
23
23
from quodlibet.util import tag
 
24
from quodlibet.util.titlecase import title
24
25
 
25
26
def Label(*args):
26
27
    l = gtk.Label(*args)
188
189
                if len(song.list(tag_)) == 1: name = tag(tag_)
189
190
                else: name = _(names)
190
191
                vb.pack_start(Frame(util.capitalize(name), l), expand=False)
 
192
        performers = {}
 
193
        for tag_ in song:
 
194
            if "performer:" in tag_:
 
195
                for person in song[tag_].split('\n'):
 
196
                    try:
 
197
                        performers[str(person)]
 
198
                    except:
 
199
                        performers[str(person)] = []
 
200
                    performers[str(person)].append(util.title(tag_[tag_.find(":")+1 : ]))
 
201
        if len(performers) > 0:
 
202
            performerstr = ''
 
203
            for performer in performers:
 
204
                performerstr += performer + ' ('
 
205
                i = 0
 
206
                for part in performers[performer]:
 
207
                    if i != 0:
 
208
                        performerstr += ', '
 
209
                    performerstr += part
 
210
                    i += 1
 
211
                performerstr += ')\n'
 
212
            l = Label(performerstr)
 
213
            l.set_ellipsize(pango.ELLIPSIZE_END)
 
214
            if len(performers) == 1: name = tag("performer")
 
215
            else: name = _("performers")
 
216
            vb.pack_start(Frame(util.capitalize(name), l), expand=False)
191
217
        if not vb.get_children(): vb.destroy()
192
218
        else: box.pack_start(Frame(title, vb), expand=False, fill=False)
193
219