def __cols_changed(self, songlist): headers = [col.header_name for col in songlist.get_columns()] try: headers.remove('~current') except ValueError: pass if len(headers) == len(get_columns()): # Not an addition or removal (handled separately) set_columns(headers) SongList.headers = headers
def test_get_set_columns(self): self.failIf(config.get("settings", "headers", None)) self.failIf(config.get("settings", "columns", None)) columns = ["first", "won't", "two words", "4"] set_columns(columns) self.failUnlessEqual(columns, get_columns()) columns += ["~~another~one"] set_columns(columns) self.failUnlessEqual(columns, get_columns()) self.failIf(config.get("settings", "headers", None))
def setUp(self): config.init() init_fake_app() # Avoid warnings when running with empty config set_columns(["artist", "title"]) self.win = PreferencesWindow(None)