Пример #1
0
 def activated(self, tag, value):
     spls = config.get("editing", "split_on").decode("utf-8", "replace").split()
     title, versions = util.split_title(value, spls)
     return [(tag, title)] + [("version", v) for v in versions]
Пример #2
0
 def test_custom_splitter(self):
     self.failUnlessEqual(
         util.split_title("foo [b c]", " "), ("foo", ["b", "c"]))
Пример #3
0
 def __init__(self, tag, value):
     super(SplitTitle, self).__init__(_("Split _Version out of Title"))
     self.set_image(gtk.image_new_from_stock(gtk.STOCK_FIND_AND_REPLACE, gtk.ICON_SIZE_MENU))
     spls = config.get("editing", "split_on").decode("utf-8", "replace").split()
     self.set_sensitive(bool(util.split_title(value, spls)[1]))
Пример #4
0
 def test_two_versions(self):
     self.failUnlessEqual(
         util.split_title("foo [b, c]"), ("foo", ["b", "c"]))
Пример #5
0
 def test_simple(self):
     self.failUnlessEqual(util.split_title("foo (baz)"), ("foo", ["baz"]))
Пример #6
0
 def test_prefix_and_version(self):
     self.failUnlessEqual(util.split_title("~foo ~bar~"), ("~foo", ["bar"]))
Пример #7
0
 def test_prefix_and_trailing(self):
     self.failUnlessEqual(util.split_title("~foo ~"), ("~foo ~", []))
Пример #8
0
 def test_prefixed(self):
     self.failUnlessEqual(util.split_title("~foo "), ("~foo ", []))