Esempio 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"]))
Esempio 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"]))
Esempio 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]))
Esempio 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]))
Esempio 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]))
Esempio 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))
Esempio 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]
Esempio n. 8
0
 def test_cover(self):
     self.failUnlessEqual(
         split_people("Pyscho Killer [Talking Heads Cover]"),
         ("Pyscho Killer", ["Talking Heads"]))
Esempio 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]
Esempio n. 10
0
 def test_featuring_two_people(self):
     self.failUnlessEqual(split_people("foo featuring bar, qx"),
                          ("foo", ["bar", "qx"]))
Esempio 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"]))
Esempio n. 12
0
 def test_parened_person(self):
     self.failUnlessEqual(split_people("foo (bar)"), ("foo", ["bar"]))
Esempio n. 13
0
 def test_with_with_person(self):
     self.failUnlessEqual(split_people("foo (with with bar)"),
                          ("foo", ["with bar"]))
Esempio n. 14
0
 def test_parened_person(self):
     self.failUnlessEqual(split_people("foo (bar)"), ("foo", ["bar"]))
Esempio 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]
Esempio n. 16
0
 def test_custom_splitter(self):
     self.failUnlessEqual(
         split_people("foo |With bar|", " ", ["||"]), ("foo", ["bar"]))
Esempio n. 17
0
 def test_with_with_person(self):
     self.failUnlessEqual(
         split_people("foo (with with bar)"), ("foo", ["with bar"]))
Esempio n. 18
0
 def test_cover(self):
     self.failUnlessEqual(
         split_people("Psycho Killer [Talking Heads Cover]"),
         ("Psycho Killer", ["Talking Heads"]))
Esempio n. 19
0
 def test_featuring_two_people(self):
     self.failUnlessEqual(
         split_people("foo featuring bar, qx"), ("foo", ["bar", "qx"]))
Esempio 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"]))