| 1 | |
| 2 | from wxPython.wx import * |
| 3 | import os |
| 4 | |
| 5 | #--------------------------------------------------------------------------- |
| 6 | |
| 7 | wildcard = "Python source (*.py)|*.py|" \ |
| 8 | "Compiled Python (*.pyc)|*.pyc|" \ |
| 9 | "All files (*.*)|*.*" |
| 10 | |
| 11 | def runTest(frame, nb, log): |
| 12 | log.WriteText("CWD: %s\n" % os.getcwd()) |
| 13 | dlg = wxFileDialog(frame, "Choose a file", os.getcwd(), "", wildcard, |
| 14 | wxOPEN |
| 15 | | wxMULTIPLE |
| 16 | #| wxCHANGE_DIR |
| 17 | ) |
| 18 | if dlg.ShowModal() == wxID_OK: |
| 19 | paths = dlg.GetPaths() |
| 20 | log.WriteText('You selected %d files:' % len(paths)) |
| 21 | for path in paths: |
| 22 | log.WriteText(' %s\n' % path) |
| 23 | log.WriteText("CWD: %s\n" % os.getcwd()) |
| 24 | dlg.Destroy() |
| 25 | |
| 26 | #--------------------------------------------------------------------------- |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | overview = """\ |
| 35 | This class provides the file chooser dialog. |
| 36 | |
| 37 | """ |
| 38 | |
| 39 | |
| 40 | if __name__ == '__main__': |
| 41 | import sys,os |
| 42 | import run |
| 43 | run.main(['', os.path.basename(sys.argv[0])]) |
| 44 | |