def main(): class Unbuffered(object): def __init__(self, file): self.file = file def write(self, arg): self.file.write(arg) self.file.flush() def __getattr__(self, attr): return getattr(self.file, attr) sys.stdout = Unbuffered(sys.stdout) gtk.icon_theme_get_default().append_search_path(paths.icon_dir()) app = MeldApp() app.parse_args(sys.argv[1:]) gtk.main()
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os import gobject import gtk import gnomeglade import paths COL_PATH, COL_STATE, COL_TEXT, COL_ICON, COL_END = range(5) from vc._vc import STATE_IGNORED, STATE_NONE, STATE_NORMAL, STATE_NOCHANGE, \ STATE_ERROR, STATE_EMPTY, STATE_NEW, \ STATE_MODIFIED, STATE_CONFLICT, STATE_REMOVED, \ STATE_MISSING, STATE_MAX load = lambda x,s=14: gnomeglade.load_pixbuf(paths.icon_dir(x), s) pixbuf_folder = load("tree-folder-normal.png", 20) pixbuf_folder_new = load("tree-folder-new.png", 20) pixbuf_folder_changed = load("tree-folder-changed.png", 20) pixbuf_folder_missing = load("tree-folder-missing.png", 20) pixbuf_file = load("tree-file-normal.png") pixbuf_file_new = load("tree-file-new.png") pixbuf_file_changed = load("tree-file-changed.png") pixbuf_file_missing = load("tree-file-missing.png") class DiffTreeStore(gtk.TreeStore): def __init__(self, ntree = 3, num_col = COL_END): types = [type("")] * num_col * ntree types[COL_ICON*ntree:COL_ICON*ntree+ntree] = [type(pixbuf_file)] * ntree gtk.TreeStore.__init__(self, *types) self.ntree = ntree
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os import gobject import gtk import gnomeglade import paths COL_PATH, COL_STATE, COL_TEXT, COL_ICON, COL_END = range(5) from vc._vc import STATE_IGNORED, STATE_NONE, STATE_NORMAL, STATE_NOCHANGE, \ STATE_ERROR, STATE_EMPTY, STATE_NEW, \ STATE_MODIFIED, STATE_CONFLICT, STATE_REMOVED, \ STATE_MISSING, STATE_MAX load = lambda x, s=14: gnomeglade.load_pixbuf(paths.icon_dir(x), s) pixbuf_folder = load("tree-folder-normal.png", 20) pixbuf_folder_new = load("tree-folder-new.png", 20) pixbuf_folder_changed = load("tree-folder-changed.png", 20) pixbuf_folder_missing = load("tree-folder-missing.png", 20) pixbuf_file = load("tree-file-normal.png") pixbuf_file_new = load("tree-file-new.png") pixbuf_file_changed = load("tree-file-changed.png") pixbuf_file_missing = load("tree-file-missing.png") class DiffTreeStore(gtk.TreeStore): def __init__(self, ntree=3, num_col=COL_END): types = [type("")] * num_col * ntree types[COL_ICON * ntree:COL_ICON * ntree + ntree] = [type(pixbuf_file)] * ntree