| 287 | .show(initialdir=initdir, initialfile=initfile) |
| 288 | |
| 289 | def browse_file(self): |
| 290 | filetypes = [ |
| 291 | ("HTML Files", "*.htm *.html", "TEXT"), |
| 292 | ("Text Files", "*.txt", "TEXT"), |
| 293 | ("All Files", "*")] |
| 294 | path = self.pathvar.get() |
| 295 | if path: |
| 296 | dir, base = os.path.split(path) |
| 297 | else: |
| 298 | base = None |
| 299 | if platform[:3] == 'win': |
| 300 | dir = os.path.join(os.path.dirname(executable), 'Doc') |
| 301 | if not os.path.isdir(dir): |
| 302 | dir = os.getcwd() |
| 303 | else: |
| 304 | dir = os.getcwd() |
| 305 | file = self.askfilename(filetypes, dir, base) |
| 306 | if file: |
| 307 | self.pathvar.set(file) |
| 308 | |
| 309 | item_ok = SectionName.entry_ok # localize for test override |
| 310 | |