示例#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)
示例#2
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)
示例#3
0
文件: main.py 项目: pfps/quodlibet
    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)
示例#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)
示例#5
0
文件: main.py 项目: urielz/quodlibet
    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)
示例#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)
示例#7
0
文件: main.py 项目: tralph3/quodlibet
    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)
示例#8
0
文件: main.py 项目: urielz/quodlibet
    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)
示例#9
0
文件: main.py 项目: tralph3/quodlibet
    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)
示例#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)