コード例 #1
0
ファイル: const.py プロジェクト: Braingate/picard
    'plugins':          "http://musicbrainz.org/doc/MusicBrainz_Picard/Plugins",
    'forum':            "http://forums.musicbrainz.org/viewforum.php?id=2",
    'donate':           "http://metabrainz.org/donate",
    'chromaprint':      "http://acoustid.org/chromaprint#download",
    'acoustid_apikey':  "http://acoustid.org/api-key",
}

# Various Artists MBID
VARIOUS_ARTISTS_ID = '89ad4ac3-39f7-470e-963a-56509c546377'

# Release formats
from picard.attributes import MB_ATTRIBUTES
RELEASE_FORMATS = {}
RELEASE_PRIMARY_GROUPS = {}
RELEASE_SECONDARY_GROUPS = {}
for k, v in MB_ATTRIBUTES.iteritems():
    if k.startswith(u'DB:medium_format/name:'):
        RELEASE_FORMATS[v] = v
    elif k.startswith(u'DB:release_group_primary_type/name:'):
        RELEASE_PRIMARY_GROUPS[v] = v
    elif k.startswith(u'DB:release_group_secondary_type/name:'):
        RELEASE_SECONDARY_GROUPS[v] = v

# Release countries
from picard.countries import RELEASE_COUNTRIES

# List of available user interface languages
UI_LANGUAGES = [
    #(u'af', u'Afrikaans', N_(u'Afrikaans')),
    #(u'ar', u'العربية', N_(u'Arabic')),
    #(u'ast', u'Asturianu', N_(u'Asturian')),
コード例 #2
0
ファイル: coverartarchive.py プロジェクト: InfInt/picard
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from picard.attributes import MB_ATTRIBUTES
from picard.i18n import ugettext_attr

# list of types from http://musicbrainz.org/doc/Cover_Art/Types
# order of declaration is preserved in selection box
CAA_TYPES = []
for k, v in sorted(MB_ATTRIBUTES.items(), key=lambda (k,v): k):
    if k.startswith(u'DB:cover_art_archive.art_type/name:'):
        CAA_TYPES.append({'name': v.lower(), 'title': v})

# pseudo type, used for the no type case
CAA_TYPES.append({'name': "unknown", 'title': N_(u"Unknown")})

CAA_TYPES_TR = {}
for t in CAA_TYPES:
    CAA_TYPES_TR[t['name']] = t['title']

def translate_caa_type(name):
    if name == 'unknown':
        return _(CAA_TYPES_TR[name])
    else:
        return ugettext_attr(CAA_TYPES_TR[name], u"cover_art_type")
コード例 #3
0
    'donate': "http://metabrainz.org/donate",
    'chromaprint': "http://acoustid.org/chromaprint#download",
    'acoustid_apikey': "http://acoustid.org/api-key",
    'doc_cover_art_types': "http://musicbrainz.org/doc/Cover_Art/Types",
}

# Various Artists MBID
VARIOUS_ARTISTS_ID = '89ad4ac3-39f7-470e-963a-56509c546377'

# Release formats
from picard.attributes import MB_ATTRIBUTES

RELEASE_FORMATS = {}
RELEASE_PRIMARY_GROUPS = {}
RELEASE_SECONDARY_GROUPS = {}
for k, v in MB_ATTRIBUTES.iteritems():
    if k.startswith(u'DB:medium_format/name:'):
        RELEASE_FORMATS[v] = v
    elif k.startswith(u'DB:release_group_primary_type/name:'):
        RELEASE_PRIMARY_GROUPS[v] = v
    elif k.startswith(u'DB:release_group_secondary_type/name:'):
        RELEASE_SECONDARY_GROUPS[v] = v

# Release countries
from picard.countries import RELEASE_COUNTRIES

# List of available user interface languages
UI_LANGUAGES = [
    #(u'af', u'Afrikaans', N_(u'Afrikaans')),
    #(u'ar', u'العربية', N_(u'Arabic')),
    #(u'ast', u'Asturianu', N_(u'Asturian')),
コード例 #4
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from picard.attributes import MB_ATTRIBUTES
from picard.i18n import ugettext_attr

# list of types from http://musicbrainz.org/doc/Cover_Art/Types
# order of declaration is preserved in selection box
CAA_TYPES = []
for k, v in sorted(MB_ATTRIBUTES.items(), key=lambda (k, v): k):
    if k.startswith(u'DB:cover_art_archive.art_type/name:'):
        CAA_TYPES.append({'name': v.lower(), 'title': v})

# pseudo type, used for the no type case
CAA_TYPES.append({'name': "unknown", 'title': N_(u"Unknown")})

CAA_TYPES_TR = {}
for t in CAA_TYPES:
    CAA_TYPES_TR[t['name']] = t['title']


def translate_caa_type(name):
    if name == 'unknown':
        return _(CAA_TYPES_TR[name])
    else: