[pygtk] DirectoryTreeView

spooky.ln at tbs-software.com spooky.ln at tbs-software.com
Mon Mar 24 02:11:59 WST 2008


hi,
can someone help me fill my TreeView with actual directory.
my [working as is ] code:

treestore is (gtk.Pixbuf(), actual_file_or_dir(str),
full_path(str))

def get_file_list(iter, dir, subdirs):
	""" fill my file treestore """
	for file in os.listdir(dir):
	    actual_file = os.path.join(dir, file)
	    if os.path.isfile(actual_file):
		file_store.append(iter, [None, file, None])
	    elif os.path.isdir(actual_file) and subdirs:
		iter = file_store.append(iter, [None, file, None])
		get_file_list(iter, actual_file, subdirs)

self.get_file_list(None, "/home/martin/Develop", True)

thanks a lot



More information about the pygtk mailing list