Exemplo n.º 1
0
 def test_originally_by(self):
     self.failUnlessEqual(
         split_people("title (originally by artist)"),
         ("title", ["artist"]))
     self.failUnlessEqual(
         split_people("title [originally by artist & artist2]"),
         ("title", ["artist", "artist2"]))
Exemplo n.º 2
0
 def test_originally_by(self):
     self.failUnlessEqual(
         split_people("title (originally by artist)"),
         ("title", ["artist"]))
     self.failUnlessEqual(
         split_people("title [originally by artist & artist2]"),
         ("title", ["artist", "artist2"]))
Exemplo n.º 3
0
 def __init__(self, tag, value):
     super(SplitPerson, self).__init__(label=self.title, use_underline=True)
     self.set_image(Gtk.Image.new_from_icon_name(
         Icons.EDIT_FIND_REPLACE, Gtk.IconSize.MENU))
     spls = config.get("editing", "split_on").decode(
         'utf-8', 'replace').split()
     self.set_sensitive(bool(split_people(value, spls)[1]))
Exemplo n.º 4
0
 def __init__(self, tag, value):
     super(SplitPerson, self).__init__(label=self.title, use_underline=True)
     self.set_image(
         Gtk.Image.new_from_icon_name(Icons.EDIT_FIND_REPLACE,
                                      Gtk.IconSize.MENU))
     spls = config.gettext("editing", "split_on").split()
     self.set_sensitive(bool(split_people(value, spls)[1]))
Exemplo n.º 5
0
 def __init__(self, tag, value):
     super(SplitPerson, self).__init__(label=self.title, use_underline=True)
     self.set_image(Gtk.Image.new_from_stock(
         Gtk.STOCK_FIND_AND_REPLACE, Gtk.IconSize.MENU))
     spls = config.get("editing", "split_on").decode(
         'utf-8', 'replace').split()
     self.set_sensitive(bool(split_people(value, spls)[1]))
Exemplo n.º 6
0
    def __init__(self, tag, value):
        super().__init__(label=self.title, use_underline=True)
        self.set_image(Gtk.Image.new_from_icon_name(
            Icons.EDIT_FIND_REPLACE, Gtk.IconSize.MENU))
        tag_spls = config.gettext("editing", "split_on").split()
        sub_spls = config.gettext("editing", "sub_split_on").split()

        artist, others = split_people(value, tag_spls, sub_spls)
        if others:
            artist = artist if len(artist) <= 64 else artist[:64] + "…"
            others = [other if len(other) <= 64 else other[:64] + "…"
                      for other in others]
            string = (", ".join(["{}={}".format(tag, artist)] +
                                ["{}={}".format(self.needs[0], o) for o in
                                 others]))
            self.set_label(string)

        self.set_sensitive(bool(others))
Exemplo n.º 7
0
 def activated(self, tag, value):
     spls = config.get("editing", "split_on").decode('utf-8',
                                                     'replace').split()
     artist, others = split_people(value, spls)
     return [(tag, artist)] + [(self.needs[0], o) for o in others]
Exemplo n.º 8
0
 def test_cover(self):
     self.failUnlessEqual(
         split_people("Pyscho Killer [Talking Heads Cover]"),
         ("Pyscho Killer", ["Talking Heads"]))
Exemplo n.º 9
0
 def activated(self, tag, value):
     tag_spls = config.gettext("editing", "split_on").split()
     sub_spls = config.gettext("editing", "sub_split_on").split()
     artist, others = split_people(value, tag_spls, sub_spls)
     return [(tag, artist)] + [(self.needs[0], o) for o in others]
Exemplo n.º 10
0
 def test_featuring_two_people(self):
     self.failUnlessEqual(split_people("foo featuring bar, qx"),
                          ("foo", ["bar", "qx"]))
Exemplo n.º 11
0
 def test_featuring_person_bracketed(self):
     self.failUnlessEqual(split_people("foo (Ft. bar)"), ("foo", ["bar"]))
     self.failUnlessEqual(split_people("foo(feat barman)"),
                          ("foo", ["barman"]))
Exemplo n.º 12
0
 def test_parened_person(self):
     self.failUnlessEqual(split_people("foo (bar)"), ("foo", ["bar"]))
Exemplo n.º 13
0
 def test_with_with_person(self):
     self.failUnlessEqual(split_people("foo (with with bar)"),
                          ("foo", ["with bar"]))
Exemplo n.º 14
0
 def test_parened_person(self):
     self.failUnlessEqual(split_people("foo (bar)"), ("foo", ["bar"]))
Exemplo n.º 15
0
 def activated(self, tag, value):
     spls = config.gettext("editing", "split_on").split()
     artist, others = split_people(value, spls)
     return [(tag, artist)] + [(self.needs[0], o) for o in others]
Exemplo n.º 16
0
 def test_custom_splitter(self):
     self.failUnlessEqual(
         split_people("foo |With bar|", " ", ["||"]), ("foo", ["bar"]))
Exemplo n.º 17
0
 def test_with_with_person(self):
     self.failUnlessEqual(
         split_people("foo (with with bar)"), ("foo", ["with bar"]))
Exemplo n.º 18
0
 def test_cover(self):
     self.failUnlessEqual(
         split_people("Psycho Killer [Talking Heads Cover]"),
         ("Psycho Killer", ["Talking Heads"]))
Exemplo n.º 19
0
 def test_featuring_two_people(self):
     self.failUnlessEqual(
         split_people("foo featuring bar, qx"), ("foo", ["bar", "qx"]))
Exemplo n.º 20
0
 def test_featuring_person_bracketed(self):
     self.failUnlessEqual(
         split_people("foo (Ft. bar)"), ("foo", ["bar"]))
     self.failUnlessEqual(
         split_people("foo(feat barman)"), ("foo", ["barman"]))