summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/test/dragtest.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-11-19 14:34:18 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-11-19 14:34:18 (GMT)
commit28ecf70db57828db2ca279643bf9aeca7662f35c (patch)
tree09b7767bbc411f85313b58d6fe7e5e67d9392973 /Mac/Lib/test/dragtest.py
parent6045b9c93511c767f6cfa2d2fa299c76181acd9b (diff)
downloadcpython-28ecf70db57828db2ca279643bf9aeca7662f35c.zip
cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.gz
cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.bz2
Getting rid of support for MacOS9 and earlier. This is the first step,
and the biggest in size, but probably the easiest. Hunting through the source code comes next.
Diffstat (limited to 'Mac/Lib/test/dragtest.py')
-rw-r--r--Mac/Lib/test/dragtest.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/Mac/Lib/test/dragtest.py b/Mac/Lib/test/dragtest.py
deleted file mode 100644
index 28eb1a9..0000000
--- a/Mac/Lib/test/dragtest.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from Carbon import Drag
-import time
-xxxx=1
-def decode_hfs(data):
- import struct, macfs
- tp = data[0:4]
- cr = data[4:8]
- flags = struct.unpack("h", data[8:10])
- fss = macfs.RawFSSpec(data[10:])
- return tp, cr, flags, fss
-
-def tracker(msg, dragref, window):
- pass
-
-def dropper(dragref, window):
- global xxxx
- n = dragref.CountDragItems()
- print 'Drop %d items:'%n
- for i in range(1, n+1):
- refnum = dragref.GetDragItemReferenceNumber(i)
- print '%d (ItemReference 0x%x)'%(i, refnum)
- nf = dragref.CountDragItemFlavors(refnum)
- print ' %d flavors:'%nf
- for j in range(1, nf+1):
- ftype = dragref.GetFlavorType(refnum, j)
- fflags = dragref.GetFlavorFlags(refnum, ftype)
- print ' "%4.4s" 0x%x'%(ftype, fflags)
- if ftype == 'hfs ':
- datasize = dragref.GetFlavorDataSize(refnum, ftype)
- data = dragref.GetFlavorData(refnum, ftype, datasize, 0)
- print ' datasize', `data`
- xxxx = data
- print ' ->', decode_hfs(data)
-
-
-def main():
- print "Drag things onto output window. Press command-. to quit."
- Drag.InstallTrackingHandler(tracker)
- Drag.InstallReceiveHandler(dropper)
- while 1:
- time.sleep(100)
-
-main()