X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fpython%2Fyaffs_browser.py;h=28fb49f3655839caac943e9df995172e48ecca52;hb=e3344eda11a9656644f9c7fe345f1283cdd46b20;hp=37245ebf1874b89df6a51d4bb0b89cea0cc3dd10;hpb=d99e6f1914e0019b3e1a7d4d25d2beca56af5989;p=yaffs2.git diff --git a/direct/python/yaffs_browser.py b/direct/python/yaffs_browser.py index 37245eb..28fb49f 100755 --- a/direct/python/yaffs_browser.py +++ b/direct/python/yaffs_browser.py @@ -70,7 +70,7 @@ class editor(): length_of_file=yaffs_lseek(self.yaffs_handle, 0, 2) ##seeks to the end of the file yaffs_lseek(self.yaffs_handle, 0, 0)## returns the handle to the front of th file print "length of file to be opened:", length_of_file - if isLink==True: + if isLink==True and False ==True : ##this alows the symlink to be edited and is no longer used. to renable it delete "and False ==True" print "opening symlink" self.file_contents=ctypes.create_string_buffer(1000) yaffs_readlink(self.file_path,self.file_contents,1000) @@ -88,6 +88,7 @@ class editor(): def load_dir(): global current_directory_dict print "loading a new directory*******************************************************************" + ##deleate current items in text box name_list_box.delete(0, tk.END) current_directory_dict=yaffs_ls(mount_list_text_variable.get()) print "new directory", current_directory_dict @@ -96,13 +97,21 @@ def load_dir(): name_list_box.insert(x,(current_directory_dict[x]["inodes"]+" "+ current_directory_dict[x]["type"]+" "+ current_directory_dict[x]["size"]+" "+ current_directory_dict[x]["path"]+" "+current_directory_dict[x]["extra_data"])) name_list_box.grid(column=0, row=1) return current_directory_dict - + +def remount_yaffs(): + ##this isn't working. somethihg need to be changed in the config of the simulator to release the handle of the emfile + print "remounting yaffs" + print"unmounting yaffs:", yaffs_unmount("yaffs2/") + print "mounting yaffs", yaffs_mount("/yaffs2/") + load_dir() + def load_file(link=0): global open_windows_list open_windows_list.append(editor(link)) def load_command(self=0): - global current_directory_dict + global current_directory_dictls + print "you loaded a file/dir/link" x=name_list_box.curselection() x=int(x[0]) @@ -271,8 +280,6 @@ def delete_selected(selected_dir=0): output=yaffs_rmdir(path) print "rmdir output:", output - - load_dir() @@ -478,6 +485,8 @@ browser_menu_bar=tk.Menu(root_window) browser_file_menu=tk.Menu(browser_menu_bar) browser_file_menu.add_command(label="Reload", command=load_dir) +browser_file_menu.add_command(label="Remount yaffs", command=remount_yaffs) + #browser_file_menu.add_command(label="Open") #browser_file_menu.add_command(label="Save") browser_menu_bar.add_cascade(label="File", menu=browser_file_menu)