How to use the picard.config.setting function in picard

To help you get started, we’ve selected a few picard examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metabrainz / picard / test / test_scripttofilename.py View on Github external
def _test_ascii_windows_compatibility(self):
        metadata = Metadata()
        metadata['artist'] = '\u2216/\\\u2215'
        settings = config.setting.copy()
        settings['ascii_filenames'] = True
        filename = script_to_filename('%artist%/\u2216\\\\\u2215', metadata, settings=settings)
        self.assertEqual('____/_\\_', filename)
github metabrainz / picard / picard / ui / options / network.py View on Github external
def save(self):
        config.setting["use_proxy"] = self.ui.web_proxy.isChecked()
        config.setting["proxy_server_host"] = self.ui.server_host.text()
        config.setting["proxy_server_port"] = self.ui.server_port.value()
        config.setting["proxy_username"] = self.ui.username.text()
        config.setting["proxy_password"] = self.ui.password.text()
        self.tagger.webservice.setup_proxy()
        config.setting["browser_integration"] = self.ui.browser_integration.isChecked()
        config.setting["browser_integration_port"] = self.ui.browser_integration_port.value()
        config.setting["browser_integration_localhost_only"] = \
            self.ui.browser_integration_localhost_only.isChecked()
        self.update_browser_integration()
github metabrainz / picard-plugins / plugins / format_performer_tags / __init__.py View on Github external
def format_performer_tags(album, metadata, *args):
    word_dict = get_word_dict(config.setting)
    for key, values in list(filter(lambda filter_tuple: filter_tuple[0].startswith('performer:') or filter_tuple[0].startswith('~performersort:'), metadata.rawitems())):
        rewrite_tag(key, values, metadata, word_dict, config.setting)
github metabrainz / picard / picard / ui / options / interface.py View on Github external
def update_layout_config(self):
        config.setting['toolbar_layout'] = self._all_list_items()
        self._update_toolbar()
github metabrainz / picard / picard / plugin.py View on Github external
def __iter__(self):
        enabled_plugins = config.setting["enabled_plugins"]
        for name in self.__dict:
            if name is None or name in enabled_plugins:
                for item in self.__dict[name]:
                    yield item
github metabrainz / picard-plugins / plugins / musixmatch / __init__.py View on Github external
def load(self):
        self.ui.api_key.setText(config.setting["musixmatch_api_key"])
github metabrainz / picard / picard / coverart / __init__.py View on Github external
def next_in_queue(self):
        """Downloads next item in queue.
           If there are none left, loading of album will be finalized.
        """
        if self.album.id not in self.album.tagger.albums:
            # album removed
            return

        if (self.front_image_found
            and config.setting["save_images_to_tags"]
            and not config.setting["save_images_to_files"]
            and config.setting["embed_only_one_front_image"]):
            # no need to continue
            self.album._finalize_loading(None)
            return

        if self._queue_empty():
            try:
                # requeue from next provider
                provider = next(self.providers)
                ret = CoverArtProvider._STARTED
                try:
                    instance = provider.cls(self)
                    if provider.enabled and instance.enabled():
                        log.debug("Trying cover art provider %s ..." %
                                  provider.name)
                        ret = instance.queue_images()
                    else:
github metabrainz / picard / picard / metadata.py View on Github external
def images_to_be_saved_to_tags(self):
        if not config.setting["save_images_to_tags"]:
            return ()
        images = [img for img in self.images if img.can_be_saved_to_tags]
        if config.setting["embed_only_one_front_image"]:
            front_image = self.get_single_front_image(images)
            if front_image:
                return front_image
        return images
github metabrainz / picard / picard / formats / vorbis.py View on Github external
def _save(self, filename, metadata):
        """Save metadata to the file."""
        log.debug("Saving file %r", filename)
        file = self._File(encode_filename(filename))
        if file.tags is None:
            file.add_tags()
        if config.setting["clear_existing_tags"]:
            file.tags.clear()
        if self._File == mutagen.flac.FLAC and (
            config.setting["clear_existing_tags"] or
            (config.setting['save_images_to_tags'] and metadata.images)):
            file.clear_pictures()
        tags = {}
        for name, value in metadata.items():
            if name == '~rating':
                # Save rating according to http://code.google.com/p/quodlibet/wiki/Specs_VorbisComments
                if config.setting['rating_user_email']:
                    name = 'rating:%s' % config.setting['rating_user_email']
                else:
                    name = 'rating'
                value = unicode(float(value) / (config.setting['rating_steps'] - 1))
            # don't save private tags
            elif name.startswith("~"):
                continue
            if name.startswith('lyrics:'):
                name = 'lyrics'
            elif name == "date" or name == "originaldate":