Staging
v0.5.1
https://github.com/python/cpython
Revision 6afff6139a445de62a9cb45dadf1b9ca905f2540 authored by Guido van Rossum on 17 June 1996, 17:10:11 UTC, committed by Guido van Rossum on 17 June 1996, 17:10:11 UTC
1 parent 7c46a92
Raw File
Tip revision: 6afff6139a445de62a9cb45dadf1b9ca905f2540 authored by Guido van Rossum on 17 June 1996, 17:10:11 UTC
Memoize _deepcopy_tuple() -- maybe this helps Tommy's problem.
Tip revision: 6afff61
dirwin.py
# Module 'dirwin'

# Directory windows, a subclass of listwin

import os
import gwin
import listwin
import anywin
import dircache

def action(w, string, i, detail):
	(h, v), clicks, button, mask = detail
	if clicks == 2:
		name = os.path.join(w.name, string)
		try:
			w2 = anywin.open(name)
			w2.parent = w
		except os.error, why:
			stdwin.message('Can\'t open ' + name + ': ' + why[1])

def open(name):
	name = os.path.join(name, '')
	list = dircache.opendir(name)[:]
	list.sort()
	dircache.annotate(name, list)
	w = listwin.open(name, list)
	w.name = name
	w.action = action
	return w
back to top