Exemple #1
0
    def test_no_cover(self):
        pb = get_no_cover_pixbuf(5, 10)
        self.assertEqual(pb.get_width(), 5)
        self.assertEqual(pb.get_height(), 5)

        pb = get_no_cover_pixbuf(10, 5)
        self.assertEqual(pb.get_width(), 5)
        self.assertEqual(pb.get_height(), 5)
    def test_no_cover(self):
        pb = get_no_cover_pixbuf(5, 10)
        self.assertEqual(pb.get_width(), 5)
        self.assertEqual(pb.get_height(), 5)

        pb = get_no_cover_pixbuf(10, 5)
        self.assertEqual(pb.get_width(), 5)
        self.assertEqual(pb.get_height(), 5)
Exemple #3
0
    def _no_cover(self):
        """Returns a cairo surface of pixbuf representing a missing cover"""

        cover_size = Album.COVER_SIZE
        scale_factor = get_scale_factor(self)
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_pbosf_for_pixbuf(self, pb)
Exemple #4
0
    def _no_cover(self):
        """Returns a cairo surface representing a missing cover"""

        cover_size = get_cover_size()
        scale_factor = self.get_scale_factor()
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_surface_for_pixbuf(self, pb)
Exemple #5
0
    def _no_cover(self):
        """Returns a cairo surface representing a missing cover"""

        cover_size = get_cover_size()
        scale_factor = self.get_scale_factor()
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_surface_for_pixbuf(self, pb)
Exemple #6
0
    def _no_cover(self):
        """Returns a cairo surface of pixbuf representing a missing cover"""

        cover_size = Album.COVER_SIZE
        scale_factor = get_scale_factor(self)
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_pbosf_for_pixbuf(self, pb)
Exemple #7
0
    def _no_cover(self) -> Optional[cairo.Surface]:
        """Returns a cairo surface representing a missing cover"""

        mag = config.getfloat("browsers", "covergrid_magnification", 3.)

        cover_size = get_cover_size()
        scale_factor = self.get_scale_factor() * mag
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_surface_for_pixbuf(self, pb)
Exemple #8
0
    def _no_cover(self):
        """Returns a cairo surface representing a missing cover"""

        mag = config.getfloat("browsers", "covergrid_magnification", 3.)

        cover_size = get_cover_size()
        scale_factor = self.get_scale_factor() * mag
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        return get_surface_for_pixbuf(self, pb)
Exemple #9
0
    def _no_cover(self) -> Optional[cairo.Surface]:
        """Returns a cairo surface representing a missing cover"""

        cover_size = get_cover_size()
        scale_factor = self.get_scale_factor()
        pb = get_no_cover_pixbuf(cover_size, cover_size, scale_factor)
        if not pb:
            raise IOError("Can't find / scale missing art image")
        return get_surface_for_pixbuf(self, pb)
Exemple #10
0
    def init(klass, library):
        try:
            text = file(PATTERN_FN).read().rstrip()
            #Migrate <=2.2 pattern.
            #This breaks people, title.. so remove it someday.
            text = text.replace("<people", "<~people")
            text = text.replace("<title", "<album")
            klass._pattern_text = text
        except EnvironmentError:
            klass._pattern_text = PATTERN

        cover_size = Album.COVER_SIZE
        klass.__no_cover = get_no_cover_pixbuf(cover_size, cover_size)
        klass._pattern = XMLFromMarkupPattern(klass._pattern_text)