+class new_file():
+ path_entry_box=0
+ new_file_window=0
+ def open_the_file(self):
+ global mount_list_text_variable
+ print "trying to create", mount_list_text_variable.get()+self.path_entry_box.get()
+ yaffs_handle=yaffs_open(self.path_entry_box.get(),66,0666)
+ yaffs_close(yaffs_handle)
+ self.new_file_window.destroy()
+ load_dir()
+
+ def cancel(self):
+ ##del self
+ self.new_file_window.destroy()
+ def __init__(self):
+ global mount_list_text_variable
+ self.new_file_window =tk.Toplevel(takefocus=True)
+ path_frame=tk.Frame(self.new_file_window)
+ path_label=tk.Label(path_frame, text="file path")
+ path_label.pack(side=tk.LEFT)
+ text=tk.StringVar()
+ text.set(mount_list_text_variable.get())
+ print "############################",mount_list_text_variable.get()
+ self.path_entry_box= tk.Entry(path_frame, textvariable=text)
+ self.path_entry_box.pack(side=tk.RIGHT)
+ path_frame.pack()
+ button_frame=tk.Frame(self.new_file_window)
+ create_button=tk.Button(button_frame, text="Create", command=self.open_the_file)
+ create_button.pack(side=tk.LEFT)
+ cancel_button=tk.Button(button_frame, text="Cancel", command=self.cancel)
+ cancel_button.pack(side=tk.RIGHT)
+ button_frame.pack()
+
+class new_folder():
+ path_entry_box=0
+ new_folder_window=0
+ def create_the_folder(self):
+ global mount_list_text_variable
+ print "trying to create", mount_list_text_variable.get()+self.path_entry_box.get()
+ yaffs_mkdir(self.path_entry_box.get(),0666)
+ self.new_folder_window.destroy()
+
+ load_dir()
+
+ def cancel(self):
+ ##del self
+ self.new_folder_window.destroy()
+ def __init__(self):
+ global mount_list_text_variable
+ self.new_folder_window =tk.Toplevel(takefocus=True)
+ path_frame=tk.Frame(self.new_folder_window)
+ path_label=tk.Label(path_frame, text="directory path")
+ path_label.pack(side=tk.LEFT)
+ text=tk.StringVar()
+ text.set(mount_list_text_variable.get())
+ print "############################",mount_list_text_variable.get()
+ self.path_entry_box= tk.Entry(path_frame, textvariable=text)
+ self.path_entry_box.pack(side=tk.RIGHT)
+ path_frame.pack()
+ button_frame=tk.Frame(self.new_folder_window)
+ create_button=tk.Button(button_frame, text="Create", command=self.create_the_folder)
+ create_button.pack(side=tk.LEFT)
+ cancel_button=tk.Button(button_frame, text="Cancel", command=self.cancel)
+ cancel_button.pack(side=tk.RIGHT)
+ button_frame.pack()
+
+
+
+