~nikolai/picard/plugins

« back to all changes in this revision

Viewing changes to contrib/plugins/SearchLortelArchives3.py

  • Committer: Nikolai Prokoschenko
  • Date: 2009-01-06 17:02:13 UTC
  • Revision ID: nikolai@prokoschenko.de-20090106170213-g2m4x41p0x4d4mmf
add all plugins from the wiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
PLUGIN_NAME = u"Search the Lortel Archives for Release (codebase 4.1)"
 
4
PLUGIN_AUTHOR = u"Brian Schweitzer"
 
5
PLUGIN_DESCRIPTION = "Search the Lortel Archives"
 
6
PLUGIN_VERSION = "0.1"
 
7
PLUGIN_API_VERSIONS = ["0.9.0"]
 
8
 
 
9
from PyQt4 import QtCore
 
10
from picard.cluster import Cluster
 
11
from picard.util import webbrowser2
 
12
from picard.ui.itemviews import BaseAction, register_cluster_action
 
13
from picard.ui.itemviews import BaseAction, register_album_action
 
14
 
 
15
 
 
16
class SearchLortelArchives(BaseAction):
 
17
    NAME = "Search the Lortel Archives"
 
18
    def callback(self, objs):
 
19
        cluster = objs[0]
 
20
        url = "http://www.lortel.org/LLA_archive/index.cfm?keyword="
 
21
        url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"])
 
22
        url += "&COMMITT=YES&search_by=ALL&Go.x=0&Go.y=0"
 
23
        webbrowser2.open(url)
 
24
register_cluster_action(SearchLortelArchives())
 
25
register_album_action(SearchLortelArchives())