File: titlecase.py

package info (click to toggle)
quodlibet-plugins 20060823-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 288 kB
  • ctags: 611
  • sloc: python: 3,375; makefile: 23; sh: 11
file content (20 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gtk
import util

from plugins.editing import EditTagsPlugin

class TitleCase(EditTagsPlugin):
    PLUGIN_ID = "Title Case"
    PLUGIN_NAME = _("Title Case")
    PLUGIN_DESC = _("Title-case tag values in the tag editor.")
    PLUGIN_ICON = gtk.STOCK_SPELL_CHECK
    PLUGIN_VERSION = "1"

    def __init__(self, tag, value):
        super(TitleCase, self).__init__(_("Title-_case Value"))
        self.set_image(
            gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_MENU))
        self.set_sensitive(util.title(value) != value)

    def activated(self, tag, value):
        return [(tag, util.title(value))]