Mercurial > cpython-lru_cache-weakref
annotate Lib/stdwin/dirwin.py @ 363:d70754a96310 legacy-trunk
path.cat --> join
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 16 Aug 1991 13:28:23 +0000 |
| parents | 71ac0e37236a |
| children | 683edb0c4463 |
| rev | line source |
|---|---|
| 5 | 1 # Module 'dirwin' |
| 2 | |
| 3 # Directory windows, a subclass of listwin | |
| 4 | |
| 5 import gwin | |
| 6 import listwin | |
| 7 import anywin | |
| 8 import path | |
| 9 import dircache | |
| 10 | |
| 11 def action(w, string, i, detail): | |
| 12 (h, v), clicks, button, mask = detail | |
| 13 if clicks = 2: | |
| 363 | 14 name = path.join(w.name, string) |
| 5 | 15 try: |
|
19
71ac0e37236a
Set 'parent' field of new created subwindows so wdiff can implement
Guido van Rossum <guido@python.org>
parents:
5
diff
changeset
|
16 w2 = anywin.open(name) |
|
71ac0e37236a
Set 'parent' field of new created subwindows so wdiff can implement
Guido van Rossum <guido@python.org>
parents:
5
diff
changeset
|
17 w2.parent = w |
| 5 | 18 except posix.error, why: |
| 19 stdwin.message('Can\'t open ' + name + ': ' + why[1]) | |
| 20 | |
| 21 def open(name): | |
| 363 | 22 name = path.join(name, '') |
| 5 | 23 list = dircache.opendir(name)[:] |
| 24 list.sort() | |
| 25 dircache.annotate(name, list) | |
| 26 w = listwin.open(name, list) | |
| 27 w.name = name | |
| 28 w.action = action | |
| 29 return w |
