Mercurial > urwid-satext
comparison urwid_satext/files_management.py @ 93:900014ae36b8
fixed unicode issue invalid method call in files_management
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 08 Sep 2014 15:42:25 +0200 |
parents | fdd0543677d4 |
children | 5bb3b7e25bf6 |
comparison
equal
deleted
inserted
replaced
92:fdd0543677d4 | 93:900014ae36b8 |
---|---|
89 break | 89 break |
90 else: | 90 else: |
91 return self._w.keypress(size, key) | 91 return self._w.keypress(size, key) |
92 | 92 |
93 def showDirectory(self, path): | 93 def showDirectory(self, path): |
94 path = path.encode('utf-8') | |
94 self.path = path | 95 self.path = path |
95 del self.files_list[:] | 96 del self.files_list[:] |
96 directories = [] | 97 directories = [] |
97 files = [] | 98 files = [] |
98 try: | 99 try: |
231 self.files_wid.showDirectory(path) | 232 self.files_wid.showDirectory(path) |
232 | 233 |
233 def onPreviousDir(self, wid): | 234 def onPreviousDir(self, wid): |
234 path = os.path.abspath(self.path_wid.get_edit_text()) | 235 path = os.path.abspath(self.path_wid.get_edit_text()) |
235 if not os.path.isdir(path): | 236 if not os.path.isdir(path): |
236 path = dirname(path) | 237 path = os.path.dirname(path) |
237 self.path_wid.set_edit_text(os.path.split(path)[0]) | 238 self.path_wid.set_edit_text(os.path.split(path)[0]) |
238 | 239 |
239 def onDirClick(self, wid): | 240 def onDirClick(self, wid): |
240 path = os.path.abspath(self.path_wid.get_edit_text()) | 241 path = os.path.abspath(self.path_wid.get_edit_text()) |
241 if not os.path.isdir(path): | 242 if not os.path.isdir(path): |
242 path = dirname(path) | 243 path = os.path.dirname(path) |
243 self.path_wid.set_edit_text(os.path.join(path,wid.get_text())) | 244 self.path_wid.set_edit_text(os.path.join(path,wid.get_text())) |
244 | 245 |
245 def onFileClick(self, wid): | 246 def onFileClick(self, wid): |
246 self.ok_cb(os.path.abspath(os.path.join(self.files_wid.path,wid.get_text()))) | 247 self.ok_cb(os.path.abspath(os.path.join(self.files_wid.path,wid.get_text()))) |