From 28d6bd9f0f6f7e13875ad77a85150de516df467b Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6015fed2-1504-0410-9fe1-9d1591cc4771> Date: Tue, 15 Aug 2000 13:14:27 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'Distutils-0_9_1'. git-svn-id: http://svn.python.org/projects/python/tags/Distutils-0_9_1@16805 6015fed2-1504-0410-9fe1-9d1591cc4771 --- .cvsignore | 8 - BeOS/README | 93 - BeOS/README.readline-2.2 | 56 - BeOS/ar-fake | 157 - BeOS/dl_export.h | 35 - BeOS/linkcc | 76 - BeOS/linkmodule | 78 - Demo/Makefile | 12 - Demo/README | 48 - Demo/classes/Complex.py | 298 - Demo/classes/Dates.py | 218 - Demo/classes/Dbm.py | 66 - Demo/classes/README | 14 - Demo/classes/Range.py | 71 - Demo/classes/Rat.py | 307 - Demo/classes/Rev.py | 89 - Demo/classes/Vec.py | 64 - Demo/classes/bitvec.py | 332 - Demo/classes/class.doc | 110 - Demo/comparisons/README | 60 - Demo/comparisons/patterns | 4 - Demo/comparisons/regextest.py | 50 - Demo/comparisons/sortingtest.py | 50 - Demo/comparisons/systemtest.py | 74 - Demo/dns/README | 16 - Demo/dns/asgethost.py | 35 - Demo/dns/dnsclass.py | 23 - Demo/dns/dnslib.py | 588 - Demo/dns/dnsopcode.py | 16 - Demo/dns/dnstype.py | 41 - Demo/embed/Makefile | 44 - Demo/embed/README | 12 - Demo/embed/demo.c | 66 - Demo/extend/README | 16 - Demo/extend/make_clean | 5 - Demo/extend/make_shared | 16 - Demo/extend/make_static | 15 - Demo/imputil/importers.py | 248 - Demo/md5test/README | 10 - Demo/md5test/foo | 1 - Demo/md5test/md5driver.py | 125 - Demo/metaclasses/Eiffel.py | 113 - Demo/metaclasses/Enum.py | 169 - Demo/metaclasses/Meta.py | 120 - Demo/metaclasses/Simple.py | 45 - Demo/metaclasses/Synch.py | 256 - Demo/metaclasses/Trace.py | 145 - Demo/metaclasses/index.html | 605 - Demo/metaclasses/meta-vladimir.txt | 256 - Demo/parser/FILES | 6 - Demo/parser/Makefile | 30 - Demo/parser/README | 30 - Demo/parser/docstring.py | 2 - Demo/parser/example.py | 190 - Demo/parser/parser.tex | 78 - Demo/parser/simple.py | 1 - Demo/parser/source.py | 27 - Demo/parser/test_parser.py | 50 - Demo/parser/texipre.dat | 100 - Demo/pdist/FSProxy.py | 322 - Demo/pdist/RCSProxy.py | 198 - Demo/pdist/README | 121 - Demo/pdist/client.py | 158 - Demo/pdist/cmdfw.py | 144 - Demo/pdist/cmptree.py | 208 - Demo/pdist/cvslib.py | 364 - Demo/pdist/cvslock.py | 280 - Demo/pdist/mac.py | 19 - Demo/pdist/makechangelog.py | 109 - Demo/pdist/new | 1 - Demo/pdist/rcsbump | 33 - Demo/pdist/rcsclient.py | 71 - Demo/pdist/rcslib.py | 339 - Demo/pdist/rcvs | 8 - Demo/pdist/rcvs.py | 481 - Demo/pdist/rrcs | 8 - Demo/pdist/rrcs.py | 164 - Demo/pdist/security.py | 33 - Demo/pdist/server.py | 145 - Demo/pdist/sumtree.py | 24 - Demo/pysvr/Makefile | 53 - Demo/pysvr/README | 9 - Demo/pysvr/pysvr.c | 372 - Demo/pysvr/pysvr.py | 124 - Demo/rpc/MANIFEST | 10 - Demo/rpc/README | 25 - Demo/rpc/T.py | 22 - Demo/rpc/mountclient.py | 201 - Demo/rpc/nfsclient.py | 201 - Demo/rpc/rnusersclient.py | 98 - Demo/rpc/rpc.py | 891 - Demo/rpc/test | 24 - Demo/rpc/xdr.py | 201 - Demo/scripts/README | 18 - Demo/scripts/beer.py | 14 - Demo/scripts/eqfix.py | 199 - Demo/scripts/fact.py | 48 - Demo/scripts/freeze.py | 480 - Demo/scripts/from.py | 35 - Demo/scripts/ftpstats.py | 144 - Demo/scripts/lpwatch.py | 109 - Demo/scripts/makedir.py | 20 - Demo/scripts/markov.py | 116 - Demo/scripts/mboxconvert.py | 123 - Demo/scripts/mkrcs.py | 60 - Demo/scripts/morse.py | 149 - Demo/scripts/mpzpi.py | 34 - Demo/scripts/newslist.doc | 59 - Demo/scripts/newslist.py | 366 - Demo/scripts/pi.py | 33 - Demo/scripts/pp.py | 138 - Demo/scripts/primes.py | 26 - Demo/scripts/script.py | 33 - Demo/scripts/unbirthday.py | 106 - Demo/scripts/update.py | 91 - Demo/scripts/wh.py | 2 - Demo/sgi/README | 22 - Demo/sgi/al/.cvsignore | 1 - Demo/sgi/al/README | 15 - Demo/sgi/al/alwatch.py | 33 - Demo/sgi/al/broadcast.py | 27 - Demo/sgi/al/cmpaf.py | 64 - Demo/sgi/al/cmpaf_form.fd | 90 - Demo/sgi/al/intercom.py | 212 - Demo/sgi/al/listen.py | 34 - Demo/sgi/al/names.py | 14 - Demo/sgi/al/playaiff.py | 54 - Demo/sgi/al/playback.py | 23 - Demo/sgi/al/playold.py | 51 - Demo/sgi/al/radio.py | 21 - Demo/sgi/al/rec_play.py | 28 - Demo/sgi/al/record.py | 23 - Demo/sgi/al/unicast.py | 26 - Demo/sgi/al/x.py | 12 - Demo/sgi/audio/README | 8 - Demo/sgi/audio/play.py | 75 - Demo/sgi/cd/CD.doc | 46 - Demo/sgi/cd/README | 28 - Demo/sgi/cd/cdaiff.py | 33 - Demo/sgi/cd/listcd.py | 24 - Demo/sgi/cd/playcd.py | 102 - Demo/sgi/cd/recvcd.py | 36 - Demo/sgi/cd/sendcd.py | 154 - Demo/sgi/flp/.cvsignore | 1 - Demo/sgi/flp/tcache.fd | 51 - Demo/sgi/flp/tcache.py | 32 - Demo/sgi/flp/test_cb.fd | 75 - Demo/sgi/flp/test_cb.py | 61 - Demo/sgi/flp/test_nocb.fd | 75 - Demo/sgi/flp/test_nocb.py | 45 - Demo/sgi/gl/README | 35 - Demo/sgi/gl/backface.py | 140 - Demo/sgi/gl/glinfo.py | 20 - Demo/sgi/gl/kites.py | 194 - Demo/sgi/gl/kunst.py | 426 - Demo/sgi/gl/mclock.doc | 60 - Demo/sgi/gl/mclock.py | 736 - Demo/sgi/gl/mixing.py | 116 - Demo/sgi/gl/nurbs.py | 171 - Demo/sgi/gl/zrgb.py | 168 - Demo/sgi/sv/README | 23 - Demo/sgi/sv/burstcapt.py | 52 - Demo/sgi/sv/contcapt.py | 107 - Demo/sgi/sv/rgbgrab.py | 81 - Demo/sgi/sv/simpleinput.py | 22 - Demo/sgi/video/.cvsignore | 1 - Demo/sgi/video/DisplayVideoIn.py | 99 - Demo/sgi/video/Dsend.py | 188 - Demo/sgi/video/IN.py | 54 - Demo/sgi/video/LiveVideoIn.py | 139 - Demo/sgi/video/LiveVideoOut.py | 130 - Demo/sgi/video/Makefile | 7 - Demo/sgi/video/OldVcopy.py | 148 - Demo/sgi/video/README | 113 - Demo/sgi/video/VCR.py | 534 - Demo/sgi/video/VFile.py | 1193 - Demo/sgi/video/VGrabber.py | 80 - Demo/sgi/video/Vaddcache.py | 80 - Demo/sgi/video/Vb.py | 962 - Demo/sgi/video/VbForm.fd | 615 - Demo/sgi/video/Vcopy.py | 291 - Demo/sgi/video/VcrIndex.py | 327 - Demo/sgi/video/Vedit.py | 301 - Demo/sgi/video/VeditForm.fd | 435 - Demo/sgi/video/Vfix.py | 90 - Demo/sgi/video/Vgeneric.py | 2 - Demo/sgi/video/Viewer.py | 255 - Demo/sgi/video/Vinfo.py | 174 - Demo/sgi/video/Vmkjpeg.py | 92 - Demo/sgi/video/Vplay.py | 355 - Demo/sgi/video/Vrec.py | 413 - Demo/sgi/video/Vrecb.py | 429 - Demo/sgi/video/Vrecc.py | 281 - Demo/sgi/video/Vreceive.py | 135 - Demo/sgi/video/Vsend.py | 152 - Demo/sgi/video/Vstat.py | 23 - Demo/sgi/video/Vtime.py | 117 - Demo/sgi/video/Vunjpeg.py | 97 - Demo/sgi/video/aplay.py | 167 - Demo/sgi/video/cam.py | 129 - Demo/sgi/video/camcorder.py | 266 - Demo/sgi/video/cmif-film.ms | 200 - Demo/sgi/video/colorsys.py | 106 - Demo/sgi/video/i2v.c | 80 - Demo/sgi/video/imgconv.py | 139 - Demo/sgi/video/makemovie.py | 218 - Demo/sgi/video/rgb2video.py | 79 - Demo/sgi/video/senddefs.py | 11 - Demo/sgi/video/squash.c | 130 - Demo/sgi/video/squash2.c | 72 - Demo/sgi/video/statit.py | 115 - Demo/sgi/video/svgrab24.c | 97 - Demo/sgi/video/syncaudio.py | 94 - Demo/sgi/video/tomono.c | 165 - Demo/sgi/video/tv.py | 79 - Demo/sgi/video/v2i.c | 79 - Demo/sgi/video/vcopy.py | 134 - Demo/sgi/video/video.doc | 109 - Demo/sgi/video/video.py | 218 - Demo/sgi/video/video2rgb.py | 159 - Demo/sgi/video/vinfo.py | 90 - Demo/sgi/video/vpregs.py | 28 - Demo/sgi/video/vtime.py | 106 - Demo/sgi/video/watchcursor.py | 45 - Demo/sockets/ChangeLog | 35 - Demo/sockets/README | 22 - Demo/sockets/broadcast.py | 17 - Demo/sockets/echosvr.py | 31 - Demo/sockets/finger.py | 58 - Demo/sockets/ftp.py | 146 - Demo/sockets/gopher.py | 347 - Demo/sockets/mcast.py | 94 - Demo/sockets/radio.py | 14 - Demo/sockets/rpython.py | 35 - Demo/sockets/rpythond.py | 52 - Demo/sockets/telnet.py | 109 - Demo/sockets/throughput.py | 93 - Demo/sockets/udpecho.py | 63 - Demo/sockets/unicast.py | 16 - Demo/sockets/unixclient.py | 10 - Demo/sockets/unixserver.py | 15 - Demo/threads/Generator.py | 84 - Demo/threads/README | 10 - Demo/threads/bug.py | 69 - Demo/threads/find.py | 154 - Demo/threads/sync.py | 603 - Demo/threads/telnet.py | 114 - Demo/tkinter/README | 11 - Demo/tkinter/Tree.py | 23 - Demo/tkinter/guido/AttrDialog.py | 452 - Demo/tkinter/guido/ManPage.py | 220 - Demo/tkinter/guido/MimeViewer.py | 143 - Demo/tkinter/guido/ShellWindow.py | 151 - Demo/tkinter/guido/brownian.py | 50 - Demo/tkinter/guido/canvasevents.py | 244 - Demo/tkinter/guido/dialog.py | 109 - Demo/tkinter/guido/electrons.py | 91 - Demo/tkinter/guido/hanoi.py | 154 - Demo/tkinter/guido/hello.py | 17 - Demo/tkinter/guido/imagedraw.py | 23 - Demo/tkinter/guido/imageview.py | 12 - Demo/tkinter/guido/kill.py | 99 - Demo/tkinter/guido/listtree.py | 37 - Demo/tkinter/guido/mbox.py | 285 - Demo/tkinter/guido/newmenubardemo.py | 47 - Demo/tkinter/guido/optionmenu.py | 27 - Demo/tkinter/guido/paint.py | 60 - Demo/tkinter/guido/redemo.py | 171 - Demo/tkinter/guido/regexdemo.py | 127 - Demo/tkinter/guido/rmt.py | 159 - Demo/tkinter/guido/solitaire.py | 637 - Demo/tkinter/guido/sortvisu.py | 634 - Demo/tkinter/guido/svkill.py | 128 - Demo/tkinter/guido/switch.py | 55 - Demo/tkinter/guido/tkman.py | 267 - Demo/tkinter/guido/wish.py | 27 - Demo/tkinter/matt/00-HELLO-WORLD.py | 27 - Demo/tkinter/matt/README | 30 - Demo/tkinter/matt/animation-simple.py | 35 - Demo/tkinter/matt/animation-w-velocity-ctrl.py | 44 - Demo/tkinter/matt/bind-w-mult-calls-p-type.py | 44 - Demo/tkinter/matt/canvas-demo-simple.py | 28 - Demo/tkinter/matt/canvas-gridding.py | 61 - Demo/tkinter/matt/canvas-moving-or-creating.py | 65 - Demo/tkinter/matt/canvas-moving-w-mouse.py | 55 - Demo/tkinter/matt/canvas-mult-item-sel.py | 81 - Demo/tkinter/matt/canvas-reading-tag-info.py | 49 - Demo/tkinter/matt/canvas-w-widget-draw-el.py | 36 - Demo/tkinter/matt/canvas-with-scrollbars.py | 60 - Demo/tkinter/matt/dialog-box.py | 64 - Demo/tkinter/matt/entry-simple.py | 25 - Demo/tkinter/matt/entry-with-shared-variable.py | 47 - Demo/tkinter/matt/killing-window-w-wm.py | 42 - Demo/tkinter/matt/menu-all-types-of-entries.py | 250 - Demo/tkinter/matt/menu-simple.py | 118 - Demo/tkinter/matt/not-what-you-might-think-1.py | 28 - Demo/tkinter/matt/not-what-you-might-think-2.py | 30 - Demo/tkinter/matt/packer-and-placer-together.py | 42 - Demo/tkinter/matt/packer-simple.py | 32 - Demo/tkinter/matt/placer-simple.py | 40 - Demo/tkinter/matt/pong-demo-1.py | 54 - Demo/tkinter/matt/printing-coords-of-items.py | 64 - Demo/tkinter/matt/radiobutton-simple.py | 62 - Demo/tkinter/matt/rubber-band-box-demo-1.py | 58 - Demo/tkinter/matt/rubber-line-demo-1.py | 51 - Demo/tkinter/matt/slider-demo-1.py | 36 - Demo/tkinter/matt/subclass-existing-widgets.py | 29 - Demo/tkinter/matt/two-radio-groups.py | 110 - Demo/tkinter/matt/window-creation-more.py | 35 - Demo/tkinter/matt/window-creation-simple.py | 31 - Demo/tkinter/matt/window-creation-w-location.py | 45 - Demo/zlib/minigzip.py | 107 - Demo/zlib/zlibdemo.py | 36 - Doc/.cvsignore | 3 - Doc/Makefile | 358 - Doc/Makefile.deps | 260 - Doc/README | 206 - Doc/TODO | 82 - Doc/api/.cvsignore | 3 - Doc/api/api.tex | 4588 -- Doc/api/refcounts.dat | 1244 - Doc/doc/doc.tex | 1166 - Doc/ext/.cvsignore | 3 - Doc/ext/ext.tex | 2114 - Doc/html/.cvsignore | 12 - Doc/html/Makefile | 165 - Doc/html/about.dat | 24 - Doc/html/icons/blank.gif | Bin 1958 -> 0 bytes Doc/html/icons/blank.png | Bin 1031 -> 0 bytes Doc/html/icons/contents.gif | Bin 438 -> 0 bytes Doc/html/icons/contents.png | Bin 649 -> 0 bytes Doc/html/icons/index.gif | Bin 289 -> 0 bytes Doc/html/icons/index.png | Bin 529 -> 0 bytes Doc/html/icons/modules.gif | Bin 385 -> 0 bytes Doc/html/icons/modules.png | Bin 598 -> 0 bytes Doc/html/icons/next.gif | Bin 253 -> 0 bytes Doc/html/icons/next.png | Bin 511 -> 0 bytes Doc/html/icons/previous.gif | Bin 252 -> 0 bytes Doc/html/icons/previous.png | Bin 511 -> 0 bytes Doc/html/icons/up.gif | Bin 316 -> 0 bytes Doc/html/icons/up.png | Bin 577 -> 0 bytes Doc/html/index.html.in | 89 - Doc/html/stdabout.dat | 48 - Doc/html/style.css | 71 - Doc/info/.cvsignore | 2 - Doc/info/Makefile | 82 - Doc/info/README | 21 - Doc/info/python.dir | 9 - Doc/lib/.cvsignore | 3 - Doc/lib/internet.tex | 13 - Doc/lib/language.tex | 10 - Doc/lib/lib.tex | 310 - Doc/lib/libaifc.tex | 202 - Doc/lib/libal.tex | 181 - Doc/lib/liballos.tex | 9 - Doc/lib/libamoeba.tex | 132 - Doc/lib/libanydbm.tex | 97 - Doc/lib/libarray.tex | 196 - Doc/lib/libascii.tex | 173 - Doc/lib/libasyncore.tex | 196 - Doc/lib/libatexit.tex | 74 - Doc/lib/libaudioop.tex | 254 - Doc/lib/libbase64.tex | 60 - Doc/lib/libbasehttp.tex | 231 - Doc/lib/libbastion.tex | 52 - Doc/lib/libbinascii.tex | 119 - Doc/lib/libbinhex.tex | 47 - Doc/lib/libbisect.tex | 56 - Doc/lib/libbltin.tex | 11 - Doc/lib/libbsddb.tex | 158 - Doc/lib/libcalendar.tex | 61 - Doc/lib/libcd.tex | 304 - Doc/lib/libcfgparser.tex | 180 - Doc/lib/libcgi.tex | 499 - Doc/lib/libcgihttp.tex | 65 - Doc/lib/libchunk.tex | 111 - Doc/lib/libcmath.tex | 91 - Doc/lib/libcmd.tex | 142 - Doc/lib/libcmp.tex | 37 - Doc/lib/libcmpcache.tex | 22 - Doc/lib/libcode.tex | 173 - Doc/lib/libcodecs.tex | 129 - Doc/lib/libcodeop.tex | 43 - Doc/lib/libcolorsys.tex | 54 - Doc/lib/libcommands.tex | 53 - Doc/lib/libcompileall.tex | 42 - Doc/lib/libcopy.tex | 98 - Doc/lib/libcopyreg.tex | 28 - Doc/lib/libcrypt.tex | 46 - Doc/lib/libcrypto.tex | 23 - Doc/lib/libcurses.tex | 1310 - Doc/lib/libdbhash.tex | 90 - Doc/lib/libdbm.tex | 47 - Doc/lib/libdircache.tex | 45 - Doc/lib/libdis.tex | 515 - Doc/lib/libdl.tex | 99 - Doc/lib/liberrno.tex | 149 - Doc/lib/libexcs.tex | 331 - Doc/lib/libfcntl.tex | 85 - Doc/lib/libfilecmp.tex | 138 - Doc/lib/libfileinput.tex | 130 - Doc/lib/libfl.tex | 506 - Doc/lib/libfm.tex | 94 - Doc/lib/libfnmatch.tex | 49 - Doc/lib/libformatter.tex | 329 - Doc/lib/libfpformat.tex | 54 - Doc/lib/libftplib.tex | 270 - Doc/lib/libfuncs.tex | 715 - Doc/lib/libgc.tex | 118 - Doc/lib/libgdbm.tex | 91 - Doc/lib/libgetopt.tex | 115 - Doc/lib/libgetpass.tex | 32 - Doc/lib/libgl.tex | 223 - Doc/lib/libglob.tex | 44 - Doc/lib/libgopherlib.tex | 33 - Doc/lib/libgrp.tex | 47 - Doc/lib/libgzip.tex | 69 - Doc/lib/libhtmllib.tex | 153 - Doc/lib/libhttplib.tex | 148 - Doc/lib/libimageop.tex | 88 - Doc/lib/libimaplib.tex | 297 - Doc/lib/libimgfile.tex | 66 - Doc/lib/libimghdr.tex | 57 - Doc/lib/libimp.tex | 246 - Doc/lib/libintro.tex | 53 - Doc/lib/libjpeg.tex | 78 - Doc/lib/libkeyword.tex | 13 - Doc/lib/liblinecache.tex | 45 - Doc/lib/liblocale.tex | 278 - Doc/lib/libmailbox.tex | 53 - Doc/lib/libmailcap.tex | 82 - Doc/lib/libmain.tex | 9 - Doc/lib/libmarshal.tex | 96 - Doc/lib/libmath.tex | 138 - Doc/lib/libmd5.tex | 72 - Doc/lib/libmhlib.tex | 168 - Doc/lib/libmimetools.tex | 110 - Doc/lib/libmimetypes.tex | 94 - Doc/lib/libmimewriter.tex | 75 - Doc/lib/libmimify.tex | 89 - Doc/lib/libmisc.tex | 7 - Doc/lib/libmm.tex | 8 - Doc/lib/libmmap.tex | 129 - Doc/lib/libmpz.tex | 98 - Doc/lib/libmsvcrt.tex | 85 - Doc/lib/libmultifile.tex | 166 - Doc/lib/libmutex.tex | 57 - Doc/lib/libnetrc.tex | 53 - Doc/lib/libnew.tex | 56 - Doc/lib/libni.tex | 63 - Doc/lib/libnis.tex | 46 - Doc/lib/libnntplib.tex | 275 - Doc/lib/libobjs.tex | 24 - Doc/lib/liboperator.tex | 164 - Doc/lib/libos.tex | 1096 - Doc/lib/libpanel.tex | 77 - Doc/lib/libparser.tex | 711 - Doc/lib/libpdb.tex | 387 - Doc/lib/libpickle.tex | 389 - Doc/lib/libpipes.tex | 84 - Doc/lib/libpopen2.tex | 79 - Doc/lib/libpoplib.tex | 131 - Doc/lib/libposix.tex | 90 - Doc/lib/libposixfile.tex | 175 - Doc/lib/libposixpath.tex | 199 - Doc/lib/libpprint.tex | 175 - Doc/lib/libprofile.tex | 768 - Doc/lib/libpty.tex | 44 - Doc/lib/libpwd.tex | 52 - Doc/lib/libpyclbr.tex | 65 - Doc/lib/libpycompile.tex | 35 - Doc/lib/libpyexpat.tex | 319 - Doc/lib/libpython.tex | 8 - Doc/lib/libqueue.tex | 85 - Doc/lib/libquopri.tex | 38 - Doc/lib/librand.tex | 31 - Doc/lib/librandom.tex | 136 - Doc/lib/libre.tex | 694 - Doc/lib/libreadline.tex | 106 - Doc/lib/libregex.tex | 369 - Doc/lib/libregsub.tex | 74 - Doc/lib/librepr.tex | 127 - Doc/lib/libresource.tex | 207 - Doc/lib/librestricted.tex | 76 - Doc/lib/librexec.tex | 224 - Doc/lib/librfc822.tex | 266 - Doc/lib/librgbimg.tex | 49 - Doc/lib/librlcompleter.tex | 63 - Doc/lib/librobotparser.tex | 68 - Doc/lib/librotor.tex | 107 - Doc/lib/libsched.tex | 97 - Doc/lib/libselect.tex | 54 - Doc/lib/libsgi.tex | 7 - Doc/lib/libsgmllib.tex | 209 - Doc/lib/libsha.tex | 56 - Doc/lib/libshelve.tex | 75 - Doc/lib/libshlex.tex | 164 - Doc/lib/libshutil.tex | 114 - Doc/lib/libsignal.tex | 172 - Doc/lib/libsimplehttp.tex | 71 - Doc/lib/libsite.tex | 88 - Doc/lib/libsmtplib.tex | 264 - Doc/lib/libsndhdr.tex | 41 - Doc/lib/libsocket.tex | 444 - Doc/lib/libsocksvr.tex | 199 - Doc/lib/libsomeos.tex | 10 - Doc/lib/libsoundex.tex | 43 - Doc/lib/libstat.tex | 143 - Doc/lib/libstatcache.tex | 54 - Doc/lib/libstatvfs.tex | 55 - Doc/lib/libstdtypes.tex | 1146 - Doc/lib/libstdwin.tex | 832 - Doc/lib/libstring.tex | 260 - Doc/lib/libstringio.tex | 65 - Doc/lib/libstrings.tex | 7 - Doc/lib/libstruct.tex | 188 - Doc/lib/libsun.tex | 6 - Doc/lib/libsunau.tex | 174 - Doc/lib/libsunaudio.tex | 146 - Doc/lib/libsymbol.tex | 28 - Doc/lib/libsys.tex | 358 - Doc/lib/libsyslog.tex | 76 - Doc/lib/libtabnanny.tex | 62 - Doc/lib/libtelnetlib.tex | 186 - Doc/lib/libtempfile.tex | 78 - Doc/lib/libtermios.tex | 129 - Doc/lib/libthread.tex | 137 - Doc/lib/libthreading.tex | 568 - Doc/lib/libtime.tex | 269 - Doc/lib/libtoken.tex | 41 - Doc/lib/libtokenize.tex | 44 - Doc/lib/libtraceback.tex | 151 - Doc/lib/libtty.tex | 36 - Doc/lib/libturtle.tex | 159 - Doc/lib/libtypes.tex | 151 - Doc/lib/libundoc.tex | 224 - Doc/lib/libunicodedata.tex | 72 - Doc/lib/libunix.tex | 8 - Doc/lib/liburllib.tex | 314 - Doc/lib/liburlparse.tex | 87 - Doc/lib/libuser.tex | 70 - Doc/lib/libuserdict.tex | 113 - Doc/lib/libuu.tex | 44 - Doc/lib/libwave.tex | 169 - Doc/lib/libwebbrowser.tex | 100 - Doc/lib/libwhichdb.tex | 20 - Doc/lib/libwhrandom.tex | 68 - Doc/lib/libwinreg.tex | 418 - Doc/lib/libwinsound.tex | 78 - Doc/lib/libxdrlib.tex | 241 - Doc/lib/libxmllib.tex | 269 - Doc/lib/libzipfile.tex | 169 - Doc/lib/libzlib.tex | 154 - Doc/lib/markup.tex | 10 - Doc/lib/netdata.tex | 7 - Doc/lib/windows.tex | 8 - Doc/libmods.tex | 7 - Doc/libstd.tex | 7 - Doc/longhtml/.cvsignore | 8 - Doc/longhtml/Makefile | 109 - Doc/longhtml/README | 34 - Doc/mac/.cvsignore | 3 - Doc/mac/libctb.tex | 156 - Doc/mac/libframework.tex | 300 - Doc/mac/libmac.tex | 110 - Doc/mac/libmacconsole.tex | 114 - Doc/mac/libmacdnr.tex | 125 - Doc/mac/libmacfs.tex | 227 - Doc/mac/libmacic.tex | 128 - Doc/mac/libmacos.tex | 98 - Doc/mac/libmacostools.tex | 108 - Doc/mac/libmacspeech.tex | 96 - Doc/mac/libmactcp.tex | 181 - Doc/mac/libmacui.tex | 59 - Doc/mac/libminiae.tex | 67 - Doc/mac/mac.tex | 74 - Doc/paper-a4/.cvsignore | 16 - Doc/paper-a4/Makefile | 2 - Doc/paper-a4/pypaper.sty | 5 - Doc/paper-letter/.cvsignore | 16 - Doc/paper-letter/Makefile | 139 - Doc/perl/SynopsisTable.pm | 75 - Doc/perl/distutils.perl | 21 - Doc/perl/howto.perl | 12 - Doc/perl/l2hinit.perl | 531 - Doc/perl/ltxmarkup.perl | 67 - Doc/perl/manual.perl | 15 - Doc/perl/python.perl | 1354 - Doc/ref/.cvsignore | 3 - Doc/ref/ref.tex | 63 - Doc/ref/ref1.tex | 85 - Doc/ref/ref2.tex | 545 - Doc/ref/ref3.tex | 1325 - Doc/ref/ref4.tex | 214 - Doc/ref/ref5.tex | 940 - Doc/ref/ref6.tex | 623 - Doc/ref/ref7.tex | 411 - Doc/ref/ref8.tex | 104 - Doc/ref/reswords.py | 32 - Doc/sgml/catalog | 7 - Doc/sgml/iso/ISOamsa | 66 - Doc/sgml/iso/ISOamsb | 52 - Doc/sgml/iso/ISOamsc | 20 - Doc/sgml/iso/ISOamsn | 70 - Doc/sgml/iso/ISOamso | 29 - Doc/sgml/iso/ISOamsr | 94 - Doc/sgml/iso/ISObox | 62 - Doc/sgml/iso/ISOcyr1 | 77 - Doc/sgml/iso/ISOcyr2 | 36 - Doc/sgml/iso/ISOdia | 24 - Doc/sgml/iso/ISOgrk1 | 59 - Doc/sgml/iso/ISOgrk2 | 30 - Doc/sgml/iso/ISOgrk3 | 53 - Doc/sgml/iso/ISOgrk4 | 53 - Doc/sgml/iso/ISOlat1 | 72 - Doc/sgml/iso/ISOlat2 | 131 - Doc/sgml/iso/ISOnum | 91 - Doc/sgml/iso/ISOpub | 100 - Doc/sgml/iso/ISOtech | 73 - Doc/sgml/iso/catalog | 39 - Doc/sgml/oasis/catalog | 1 - Doc/sgml/oasis/exchange.txt | 301 - Doc/sgml/python.dtd | 52 - Doc/sgml/version.ent | 2 - Doc/templates/howto.tex | 105 - Doc/templates/manual.tex | 82 - Doc/templates/module.tex | 163 - Doc/texinputs/boilerplate.tex | 9 - Doc/texinputs/copyright.tex | 37 - Doc/texinputs/distutils.sty | 33 - Doc/texinputs/fncychap.sty | 433 - Doc/texinputs/howto.cls | 101 - Doc/texinputs/ltxmarkup.sty | 36 - Doc/texinputs/manual.cls | 148 - Doc/texinputs/pypaper.sty | 18 - Doc/texinputs/python.ist | 11 - Doc/texinputs/python.sty | 992 - Doc/tools/anno-api.py | 67 - Doc/tools/buildindex.py | 353 - Doc/tools/checkargs.pm | 112 - Doc/tools/cklatex | 26 - Doc/tools/custlib.py | 73 - Doc/tools/findmodrefs | 63 - Doc/tools/fix_hack | 2 - Doc/tools/fix_libaux.sed | 3 - Doc/tools/fixinfo.el | 15 - Doc/tools/getpagecounts | 88 - Doc/tools/html2texi.pl | 1750 - Doc/tools/indfix.py | 101 - Doc/tools/keywords.py | 20 - Doc/tools/listmodules | 176 - Doc/tools/mkdvi.sh | 77 - Doc/tools/mkhowto | 525 - Doc/tools/mkhtml.sh | 60 - Doc/tools/mkinfo | 48 - Doc/tools/mkmodindex | 213 - Doc/tools/mksourcepkg | 141 - Doc/tools/newind.py | 22 - Doc/tools/node2label.pl | 55 - Doc/tools/refcounts.py | 97 - Doc/tools/sgmlconv/Makefile | 60 - Doc/tools/sgmlconv/README | 73 - Doc/tools/sgmlconv/conversion.xml | 658 - Doc/tools/sgmlconv/docfixer.py | 1030 - Doc/tools/sgmlconv/esis2sgml.py | 265 - Doc/tools/sgmlconv/esistools.py | 83 - Doc/tools/sgmlconv/latex2esis.py | 529 - Doc/tools/sgmlconv/make.rules | 50 - Doc/tools/toc2bkm.py | 143 - Doc/tools/whichlibs | 2 - Doc/tut/.cvsignore | 3 - Doc/tut/tut.tex | 4047 -- Doc/whatsnew/whatsnew20.tex | 812 - Grammar/.cvsignore | 2 - Grammar/Grammar | 95 - Grammar/Makefile | 30 - Include/Makefile | 12 - Include/Python.h | 123 - Include/abstract.h | 946 - Include/bitset.h | 41 - Include/bufferobject.h | 42 - Include/cStringIO.h | 131 - Include/ceval.h | 126 - Include/classobject.h | 79 - Include/cobject.h | 64 - Include/codecs.h | 123 - Include/compile.h | 65 - Include/complexobject.h | 57 - Include/config.h | 82 - Include/dictobject.h | 44 - Include/errcode.h | 41 - Include/eval.h | 24 - Include/fileobject.h | 38 - Include/floatobject.h | 42 - Include/frameobject.h | 97 - Include/funcobject.h | 50 - Include/graminit.h | 61 - Include/grammar.h | 102 - Include/import.h | 60 - Include/intobject.h | 77 - Include/intrcheck.h | 24 - Include/listobject.h | 60 - Include/longintrepr.h | 61 - Include/longobject.h | 69 - Include/marshal.h | 32 - Include/metagrammar.h | 27 - Include/methodobject.h | 74 - Include/modsupport.h | 97 - Include/moduleobject.h | 32 - Include/mymalloc.h | 208 - Include/mymath.h | 82 - Include/myproto.h | 36 - Include/myselect.h | 77 - Include/mytime.h | 38 - Include/node.h | 55 - Include/object.h | 568 - Include/objimpl.h | 279 - Include/opcode.h | 139 - Include/osdefs.h | 54 - Include/parsetok.h | 37 - Include/patchlevel.h | 49 - Include/pgenheaders.h | 65 - Include/pydebug.h | 32 - Include/pyerrors.h | 99 - Include/pyfpe.h | 176 - Include/pymem.h | 179 - Include/pyport.h | 324 - Include/pystate.h | 97 - Include/pythonrun.h | 97 - Include/pythread.h | 58 - Include/rangeobject.h | 25 - Include/rename1.h | 360 - Include/sliceobject.h | 39 - Include/stringobject.h | 118 - Include/structmember.h | 80 - Include/sysmodule.h | 34 - Include/token.h | 77 - Include/traceback.h | 33 - Include/tupleobject.h | 57 - Include/ucnhash.h | 20 - Include/unicodeobject.h | 912 - LICENSE | 1 - Lib/BaseHTTPServer.py | 502 - Lib/Bastion.py | 174 - Lib/CGIHTTPServer.py | 209 - Lib/ConfigParser.py | 454 - Lib/Makefile | 12 - Lib/MimeWriter.py | 128 - Lib/Queue.py | 138 - Lib/SimpleHTTPServer.py | 197 - Lib/SocketServer.py | 437 - Lib/StringIO.py | 174 - Lib/UserDict.py | 40 - Lib/UserList.py | 69 - Lib/UserString.py | 160 - Lib/aifc.py | 958 - Lib/anydbm.py | 86 - Lib/asynchat.py | 315 - Lib/asyncore.py | 474 - Lib/atexit.py | 54 - Lib/audiodev.py | 253 - Lib/base64.py | 79 - Lib/bdb.py | 558 - Lib/binhex.py | 530 - Lib/bisect.py | 23 - Lib/builtin.py | 3 - Lib/calendar.py | 168 - Lib/cgi.py | 989 - Lib/chunk.py | 168 - Lib/cmd.py | 187 - Lib/code.py | 291 - Lib/codecs.py | 555 - Lib/codeop.py | 86 - Lib/colorsys.py | 121 - Lib/commands.py | 82 - Lib/compileall.py | 128 - Lib/compiler/__init__.py | 24 - Lib/compiler/ast.py | 709 - Lib/compiler/consts.py | 9 - Lib/compiler/misc.py | 35 - Lib/compiler/pyassem.py | 541 - Lib/compiler/pycodegen.py | 822 - Lib/compiler/transformer.py | 1234 - Lib/compiler/visitor.py | 117 - Lib/copy.py | 304 - Lib/copy_reg.py | 21 - Lib/curses/__init__.py | 41 - Lib/curses/ascii.py | 100 - Lib/curses/has_key.py | 190 - Lib/curses/textpad.py | 167 - Lib/curses/wrapper.py | 63 - Lib/dbhash.py | 8 - Lib/dircache.py | 37 - Lib/dis.py | 284 - Lib/dos-8x3/basehttp.py | 502 - Lib/dos-8x3/bastion.py | 174 - Lib/dos-8x3/cgihttps.py | 209 - Lib/dos-8x3/compilea.py | 128 - Lib/dos-8x3/configpa.py | 382 - Lib/dos-8x3/exceptio.py | 247 - Lib/dos-8x3/fileinpu.py | 268 - Lib/dos-8x3/formatte.py | 422 - Lib/dos-8x3/gopherli.py | 208 - Lib/dos-8x3/htmlenti.py | 257 - Lib/dos-8x3/linecach.py | 92 - Lib/dos-8x3/macurl2p.py | 94 - Lib/dos-8x3/mimetool.py | 229 - Lib/dos-8x3/mimetype.py | 237 - Lib/dos-8x3/mimewrit.py | 128 - Lib/dos-8x3/multifil.py | 163 - Lib/dos-8x3/nturl2pa.py | 66 - Lib/dos-8x3/posixfil.py | 232 - Lib/dos-8x3/posixpat.py | 375 - Lib/dos-8x3/py_compi.py | 75 - Lib/dos-8x3/queue.py | 138 - Lib/dos-8x3/reconver.py | 186 - Lib/dos-8x3/regex_sy.py | 53 - Lib/dos-8x3/regex_te.py | 289 - Lib/dos-8x3/rlcomple.py | 120 - Lib/dos-8x3/robotpar.py | 97 - Lib/dos-8x3/simpleht.py | 201 - Lib/dos-8x3/socketse.py | 437 - Lib/dos-8x3/sre_comp.py | 229 - Lib/dos-8x3/sre_cons.py | 212 - Lib/dos-8x3/sre_pars.py | 632 - Lib/dos-8x3/statcach.py | 75 - Lib/dos-8x3/stringio.py | 174 - Lib/dos-8x3/stringol.py | 431 - Lib/dos-8x3/telnetli.py | 503 - Lib/dos-8x3/test_arr.py | 138 - Lib/dos-8x3/test_ate.py | 24 - Lib/dos-8x3/test_aud.py | 264 - Lib/dos-8x3/test_bin.py | 46 - Lib/dos-8x3/test_bsd.py | 74 - Lib/dos-8x3/test_bui.py | 13 - Lib/dos-8x3/test_cma.py | 35 - Lib/dos-8x3/test_con.py | 168 - Lib/dos-8x3/test_cpi.py | 107 - Lib/dos-8x3/test_cry.py | 11 - Lib/dos-8x3/test_err.py | 49 - Lib/dos-8x3/test_exc.py | 113 - Lib/dos-8x3/test_ext.py | 143 - Lib/dos-8x3/test_fcn.py | 36 - Lib/dos-8x3/test_for.py | 68 - Lib/dos-8x3/test_gdb.py | 40 - Lib/dos-8x3/test_gra.py | 544 - Lib/dos-8x3/test_gzi.py | 30 - Lib/dos-8x3/test_has.py | 26 - Lib/dos-8x3/test_ima.py | 171 - Lib/dos-8x3/test_img.py | 117 - Lib/dos-8x3/test_lin.py | 20 - Lib/dos-8x3/test_lon.py | 260 - Lib/dos-8x3/test_mat.py | 166 - Lib/dos-8x3/test_mim.py | 170 - Lib/dos-8x3/test_mma.py | 102 - Lib/dos-8x3/test_ntp.py | 41 - Lib/dos-8x3/test_opc.py | 101 - Lib/dos-8x3/test_ope.py | 77 - Lib/dos-8x3/test_pic.py | 75 - Lib/dos-8x3/test_pop.py | 17 - Lib/dos-8x3/test_pye.py | 148 - Lib/dos-8x3/test_reg.py | 110 - Lib/dos-8x3/test_rfc.py | 122 - Lib/dos-8x3/test_rgb.py | 62 - Lib/dos-8x3/test_rot.py | 28 - Lib/dos-8x3/test_sel.py | 64 - Lib/dos-8x3/test_sig.py | 66 - Lib/dos-8x3/test_soc.py | 146 - Lib/dos-8x3/test_str.py | 185 - Lib/dos-8x3/test_sun.py | 20 - Lib/dos-8x3/test_sup.py | 55 - Lib/dos-8x3/test_thr.py | 113 - Lib/dos-8x3/test_tim.py | 21 - Lib/dos-8x3/test_tok.py | 10 - Lib/dos-8x3/test_typ.py | 255 - Lib/dos-8x3/test_uni.py | 50 - Lib/dos-8x3/test_unp.py | 131 - Lib/dos-8x3/test_use.py | 227 - Lib/dos-8x3/test_win.py | 7 - Lib/dos-8x3/test_xml.py | 25 - Lib/dos-8x3/test_zip.py | 26 - Lib/dos-8x3/test_zli.py | 161 - Lib/dos-8x3/threadin.py | 638 - Lib/dos-8x3/threadst.py | 9 - Lib/dos-8x3/tokenize.py | 161 - Lib/dos-8x3/tracebac.py | 268 - Lib/dos-8x3/userdict.py | 36 - Lib/dos-8x3/userlist.py | 69 - Lib/dos-8x3/userstri.py | 158 - Lib/dospath.py | 335 - Lib/dumbdbm.py | 144 - Lib/encodings/__init__.py | 78 - Lib/encodings/aliases.py | 82 - Lib/encodings/ascii.py | 35 - Lib/encodings/charmap.py | 51 - Lib/encodings/cp037.py | 282 - Lib/encodings/cp1006.py | 140 - Lib/encodings/cp1026.py | 282 - Lib/encodings/cp1250.py | 125 - Lib/encodings/cp1251.py | 159 - Lib/encodings/cp1252.py | 78 - Lib/encodings/cp1253.py | 153 - Lib/encodings/cp1254.py | 84 - Lib/encodings/cp1255.py | 145 - Lib/encodings/cp1256.py | 131 - Lib/encodings/cp1257.py | 133 - Lib/encodings/cp1258.py | 92 - Lib/encodings/cp424.py | 282 - Lib/encodings/cp437.py | 174 - Lib/encodings/cp500.py | 282 - Lib/encodings/cp737.py | 174 - Lib/encodings/cp775.py | 174 - Lib/encodings/cp850.py | 174 - Lib/encodings/cp852.py | 174 - Lib/encodings/cp855.py | 174 - Lib/encodings/cp856.py | 174 - Lib/encodings/cp857.py | 173 - Lib/encodings/cp860.py | 174 - Lib/encodings/cp861.py | 174 - Lib/encodings/cp862.py | 174 - Lib/encodings/cp863.py | 174 - Lib/encodings/cp864.py | 172 - Lib/encodings/cp865.py | 174 - Lib/encodings/cp866.py | 174 - Lib/encodings/cp869.py | 174 - Lib/encodings/cp874.py | 173 - Lib/encodings/cp875.py | 283 - Lib/encodings/iso8859_1.py | 49 - Lib/encodings/iso8859_10.py | 92 - Lib/encodings/iso8859_13.py | 102 - Lib/encodings/iso8859_14.py | 77 - Lib/encodings/iso8859_15.py | 54 - Lib/encodings/iso8859_2.py | 103 - Lib/encodings/iso8859_3.py | 74 - Lib/encodings/iso8859_4.py | 96 - Lib/encodings/iso8859_5.py | 140 - Lib/encodings/iso8859_6.py | 94 - Lib/encodings/iso8859_7.py | 120 - Lib/encodings/iso8859_8.py | 77 - Lib/encodings/iso8859_9.py | 52 - Lib/encodings/koi8_r.py | 174 - Lib/encodings/latin_1.py | 35 - Lib/encodings/mac_cyrillic.py | 169 - Lib/encodings/mac_greek.py | 172 - Lib/encodings/mac_iceland.py | 168 - Lib/encodings/mac_latin2.py | 172 - Lib/encodings/mac_roman.py | 169 - Lib/encodings/mac_turkish.py | 169 - Lib/encodings/mbcs.py | 36 - Lib/encodings/raw_unicode_escape.py | 30 - Lib/encodings/undefined.py | 34 - Lib/encodings/unicode_escape.py | 30 - Lib/encodings/unicode_internal.py | 30 - Lib/encodings/utf_16.py | 31 - Lib/encodings/utf_16_be.py | 31 - Lib/encodings/utf_16_le.py | 31 - Lib/encodings/utf_8.py | 31 - Lib/filecmp.py | 328 - Lib/fileinput.py | 268 - Lib/fnmatch.py | 89 - Lib/formatter.py | 422 - Lib/fpformat.py | 141 - Lib/ftplib.py | 720 - Lib/getopt.py | 137 - Lib/getpass.py | 119 - Lib/glob.py | 56 - Lib/gopherlib.py | 208 - Lib/gzip.py | 361 - Lib/htmlentitydefs.py | 257 - Lib/htmllib.py | 426 - Lib/httplib.py | 794 - Lib/idlelib/AutoExpand.py | 92 - Lib/idlelib/AutoIndent.py | 554 - Lib/idlelib/Bindings.py | 67 - Lib/idlelib/CallTipWindow.py | 71 - Lib/idlelib/CallTips.py | 190 - Lib/idlelib/ChangeLog | 1017 - Lib/idlelib/ClassBrowser.py | 224 - Lib/idlelib/ColorDelegator.py | 234 - Lib/idlelib/ConfigParser.py | 382 - Lib/idlelib/Debugger.py | 308 - Lib/idlelib/Delegator.py | 34 - Lib/idlelib/EditorWindow.py | 749 - Lib/idlelib/ExecBinding.py | 198 - Lib/idlelib/FileList.py | 150 - Lib/idlelib/FormatParagraph.py | 155 - Lib/idlelib/FrameViewer.py | 38 - Lib/idlelib/GrepDialog.py | 135 - Lib/idlelib/IOBinding.py | 254 - Lib/idlelib/Icons/folder.gif | Bin 120 -> 0 bytes Lib/idlelib/Icons/minusnode.gif | Bin 75 -> 0 bytes Lib/idlelib/Icons/openfolder.gif | Bin 125 -> 0 bytes Lib/idlelib/Icons/plusnode.gif | Bin 79 -> 0 bytes Lib/idlelib/Icons/python.gif | Bin 895 -> 0 bytes Lib/idlelib/Icons/tk.gif | Bin 85 -> 0 bytes Lib/idlelib/IdleConf.py | 113 - Lib/idlelib/IdleHistory.py | 89 - Lib/idlelib/MultiScrolledLists.py | 138 - Lib/idlelib/MultiStatusBar.py | 32 - Lib/idlelib/NEWS.txt | 130 - Lib/idlelib/ObjectBrowser.py | 151 - Lib/idlelib/OldStackViewer.py | 276 - Lib/idlelib/OutputWindow.py | 279 - Lib/idlelib/ParenMatch.py | 192 - Lib/idlelib/PathBrowser.py | 95 - Lib/idlelib/Percolator.py | 85 - Lib/idlelib/PyParse.py | 569 - Lib/idlelib/PyShell.py | 860 - Lib/idlelib/README.txt | 121 - Lib/idlelib/Remote.py | 101 - Lib/idlelib/ReplaceDialog.py | 172 - Lib/idlelib/ScriptBinding.py | 169 - Lib/idlelib/ScrolledList.py | 139 - Lib/idlelib/SearchBinding.py | 97 - Lib/idlelib/SearchDialog.py | 67 - Lib/idlelib/SearchDialogBase.py | 129 - Lib/idlelib/SearchEngine.py | 221 - Lib/idlelib/Separator.py | 92 - Lib/idlelib/StackViewer.py | 135 - Lib/idlelib/TODO.txt | 205 - Lib/idlelib/ToolTip.py | 87 - Lib/idlelib/TreeWidget.py | 471 - Lib/idlelib/UndoDelegator.py | 352 - Lib/idlelib/WidgetRedirector.py | 92 - Lib/idlelib/WindowList.py | 85 - Lib/idlelib/ZoomHeight.py | 46 - Lib/idlelib/__init__.py | 1 - Lib/idlelib/config-unix.txt | 3 - Lib/idlelib/config-win.txt | 3 - Lib/idlelib/config.txt | 66 - Lib/idlelib/eventparse.py | 93 - Lib/idlelib/extend.txt | 106 - Lib/idlelib/help.txt | 155 - Lib/idlelib/idle.bat | 3 - Lib/idlelib/idle.py | 12 - Lib/idlelib/idle.pyw | 12 - Lib/idlelib/idlever.py | 1 - Lib/idlelib/keydefs.py | 55 - Lib/idlelib/loader.py | 64 - Lib/idlelib/protocol.py | 369 - Lib/idlelib/pyclbr.py | 336 - Lib/idlelib/spawn.py | 59 - Lib/idlelib/tabnanny.py | 372 - Lib/idlelib/testcode.py | 31 - Lib/ihooks.py | 510 - Lib/imaplib.py | 1119 - Lib/imghdr.py | 153 - Lib/imputil.py | 698 - Lib/keyword.py | 94 - Lib/knee.py | 126 - Lib/lib-old/Para.py | 343 - Lib/lib-old/addpack.py | 67 - Lib/lib-old/cmp.py | 63 - Lib/lib-old/cmpcache.py | 64 - Lib/lib-old/codehack.py | 81 - Lib/lib-old/dircmp.py | 201 - Lib/lib-old/dump.py | 63 - Lib/lib-old/find.py | 26 - Lib/lib-old/fmt.py | 623 - Lib/lib-old/grep.py | 80 - Lib/lib-old/lockfile.py | 15 - Lib/lib-old/newdir.py | 73 - Lib/lib-old/ni.py | 434 - Lib/lib-old/packmail.py | 112 - Lib/lib-old/poly.py | 52 - Lib/lib-old/rand.py | 13 - Lib/lib-old/tb.py | 178 - Lib/lib-old/util.py | 25 - Lib/lib-old/whatsound.py | 1 - Lib/lib-old/zmod.py | 94 - Lib/lib-tk/Canvas.py | 185 - Lib/lib-tk/Dialog.py | 49 - Lib/lib-tk/FileDialog.py | 273 - Lib/lib-tk/FixTk.py | 5 - Lib/lib-tk/ScrolledText.py | 39 - Lib/lib-tk/SimpleDialog.py | 111 - Lib/lib-tk/Tkconstants.py | 103 - Lib/lib-tk/Tkdnd.py | 321 - Lib/lib-tk/Tkinter.py | 3088 - Lib/lib-tk/tkColorChooser.py | 74 - Lib/lib-tk/tkCommonDialog.py | 66 - Lib/lib-tk/tkFileDialog.py | 106 - Lib/lib-tk/tkFont.py | 192 - Lib/lib-tk/tkMessageBox.py | 120 - Lib/lib-tk/tkSimpleDialog.py | 300 - Lib/lib-tk/turtle.py | 343 - Lib/linecache.py | 92 - Lib/locale.py | 700 - Lib/macpath.py | 233 - Lib/macstat.py | 83 - Lib/macurl2path.py | 94 - Lib/mailbox.py | 282 - Lib/mailcap.py | 255 - Lib/mhlib.py | 1004 - Lib/mimetools.py | 229 - Lib/mimetypes.py | 237 - Lib/mimify.py | 463 - Lib/multifile.py | 163 - Lib/mutex.py | 51 - Lib/netrc.py | 92 - Lib/newimp.py | 1570 - Lib/nntplib.py | 535 - Lib/ntpath.py | 426 - Lib/nturl2path.py | 66 - Lib/os.py | 456 - Lib/pdb.doc | 192 - Lib/pdb.py | 943 - Lib/persist.py | 297 - Lib/pickle.py | 895 - Lib/pipes.py | 297 - Lib/plat-aix3/FCNTL.py | 145 - Lib/plat-aix3/IN.py | 126 - Lib/plat-aix3/SOCKET.py | 86 - Lib/plat-aix3/TERMIOS.py | 195 - Lib/plat-aix3/regen | 11 - Lib/plat-aix4/FCNTL.py | 387 - Lib/plat-aix4/IN.py | 165 - Lib/plat-aix4/SOCKET.py | 93 - Lib/plat-aix4/TERMIOS.py | 206 - Lib/plat-aix4/regen | 11 - Lib/plat-beos/socket.py | 133 - Lib/plat-freebsd2/FCNTL.py | 110 - Lib/plat-freebsd2/IN.py | 187 - Lib/plat-freebsd2/SOCKET.py | 128 - Lib/plat-freebsd2/TERMIOS.py | 198 - Lib/plat-freebsd2/regen | 6 - Lib/plat-freebsd3/FCNTL.py | 111 - Lib/plat-freebsd3/IN.py | 189 - Lib/plat-freebsd3/SOCKET.py | 132 - Lib/plat-freebsd3/TERMIOS.py | 198 - Lib/plat-freebsd3/regen | 6 - Lib/plat-generic/regen | 6 - Lib/plat-irix5/AL.py | 61 - Lib/plat-irix5/CD.py | 34 - Lib/plat-irix5/CL.py | 24 - Lib/plat-irix5/CL_old.py | 236 - Lib/plat-irix5/DEVICE.py | 400 - Lib/plat-irix5/ERRNO.py | 147 - Lib/plat-irix5/FCNTL.py | 97 - Lib/plat-irix5/FILE.py | 239 - Lib/plat-irix5/FL.py | 289 - Lib/plat-irix5/GET.py | 59 - Lib/plat-irix5/GL.py | 393 - Lib/plat-irix5/GLWS.py | 12 - Lib/plat-irix5/IN.py | 141 - Lib/plat-irix5/IOCTL.py | 233 - Lib/plat-irix5/SOCKET.py | 133 - Lib/plat-irix5/SV.py | 120 - Lib/plat-irix5/TERMIOS.py | 576 - Lib/plat-irix5/WAIT.py | 14 - Lib/plat-irix5/cddb.py | 207 - Lib/plat-irix5/cdplayer.py | 89 - Lib/plat-irix5/flp.doc | 117 - Lib/plat-irix5/flp.py | 450 - Lib/plat-irix5/jpeg.py | 110 - Lib/plat-irix5/panel.py | 281 - Lib/plat-irix5/panelparser.py | 128 - Lib/plat-irix5/readcd.doc | 104 - Lib/plat-irix5/readcd.py | 242 - Lib/plat-irix5/regen | 13 - Lib/plat-irix5/torgb.py | 97 - Lib/plat-irix6/AL.py | 61 - Lib/plat-irix6/CD.py | 34 - Lib/plat-irix6/CL.py | 24 - Lib/plat-irix6/DEVICE.py | 400 - Lib/plat-irix6/ERRNO.py | 163 - Lib/plat-irix6/FCNTL.py | 114 - Lib/plat-irix6/FILE.py | 236 - Lib/plat-irix6/FL.py | 289 - Lib/plat-irix6/GET.py | 59 - Lib/plat-irix6/GL.py | 393 - Lib/plat-irix6/GLWS.py | 12 - Lib/plat-irix6/IN.py | 133 - Lib/plat-irix6/IOCTL.py | 233 - Lib/plat-irix6/SOCKET.py | 152 - Lib/plat-irix6/SV.py | 120 - Lib/plat-irix6/TERMIOS.py | 676 - Lib/plat-irix6/WAIT.py | 335 - Lib/plat-irix6/cddb.py | 207 - Lib/plat-irix6/cdplayer.py | 89 - Lib/plat-irix6/flp.doc | 117 - Lib/plat-irix6/flp.py | 450 - Lib/plat-irix6/jpeg.py | 110 - Lib/plat-irix6/panel.py | 281 - Lib/plat-irix6/panelparser.py | 128 - Lib/plat-irix6/readcd.doc | 104 - Lib/plat-irix6/readcd.py | 242 - Lib/plat-irix6/regen | 13 - Lib/plat-irix6/torgb.py | 97 - Lib/plat-linux1/FCNTL.py | 101 - Lib/plat-linux1/IN.py | 239 - Lib/plat-linux1/SOCKET.py | 183 - Lib/plat-linux1/TERMIOS.py | 270 - Lib/plat-linux1/regen | 11 - Lib/plat-linux2/CDROM.py | 80 - Lib/plat-linux2/FCNTL.py | 108 - Lib/plat-linux2/IN.py | 430 - Lib/plat-linux2/SOCKET.py | 199 - Lib/plat-linux2/TERMIOS.py | 316 - Lib/plat-linux2/regen | 11 - Lib/plat-netbsd1/FCNTL.py | 121 - Lib/plat-netbsd1/IN.py | 57 - Lib/plat-netbsd1/SOCKET.py | 122 - Lib/plat-netbsd1/TERMIOS.py | 191 - Lib/plat-netbsd1/regen | 6 - Lib/plat-next3/regen | 11 - Lib/plat-sunos4/FCNTL.py | 67 - Lib/plat-sunos4/IN.py | 59 - Lib/plat-sunos4/SOCKET.py | 78 - Lib/plat-sunos4/SUNAUDIODEV.py | 38 - Lib/plat-sunos4/WAIT.py | 13 - Lib/plat-sunos4/regen | 12 - Lib/plat-sunos5/CDIO.py | 73 - Lib/plat-sunos5/FCNTL.py | 204 - Lib/plat-sunos5/IN.py | 1086 - Lib/plat-sunos5/SOCKET.py | 145 - Lib/plat-sunos5/STROPTS.py | 1450 - Lib/plat-sunos5/SUNAUDIODEV.py | 40 - Lib/plat-sunos5/TERMIOS.py | 433 - Lib/plat-sunos5/regen | 12 - Lib/plat-win/socket.py | 168 - Lib/plat-win/winreg.py | 386 - Lib/popen2.py | 164 - Lib/poplib.py | 321 - Lib/posixfile.py | 232 - Lib/posixpath.py | 374 - Lib/pprint.py | 249 - Lib/pre.py | 652 - Lib/profile.doc | 702 - Lib/profile.py | 571 - Lib/pstats.py | 526 - Lib/pty.py | 149 - Lib/py_compile.py | 75 - Lib/pyclbr.py | 336 - Lib/quopri.py | 149 - Lib/random.py | 364 - Lib/re.py | 32 - Lib/reconvert.py | 186 - Lib/regex_syntax.py | 53 - Lib/regsub.py | 191 - Lib/repr.py | 95 - Lib/rexec.py | 415 - Lib/rfc822.py | 953 - Lib/rlcompleter.py | 120 - Lib/robotparser.py | 97 - Lib/sched.py | 104 - Lib/sgmllib.py | 485 - Lib/shelve.py | 157 - Lib/shlex.py | 190 - Lib/shutil.py | 133 - Lib/site-packages/README | 2 - Lib/site.py | 164 - Lib/smtplib.py | 544 - Lib/sndhdr.py | 227 - Lib/sre.py | 207 - Lib/sre_compile.py | 381 - Lib/sre_constants.py | 226 - Lib/sre_parse.py | 658 - Lib/stat.py | 86 - Lib/statcache.py | 75 - Lib/statvfs.py | 15 - Lib/string.py | 371 - Lib/stringold.py | 431 - Lib/sunau.py | 473 - Lib/sunaudio.py | 43 - Lib/symbol.py | 90 - Lib/tabnanny.py | 372 - Lib/telnetlib.py | 503 - Lib/tempfile.py | 154 - Lib/test/README | 167 - Lib/test/__init__.py | 1 - Lib/test/audiotest.au | Bin 23493 -> 0 bytes Lib/test/autotest.py | 3 - Lib/test/greyrgb.uue | 1547 - Lib/test/output/test_MimeWriter | 110 - Lib/test/output/test_al | 1 - Lib/test/output/test_array | 1 - Lib/test/output/test_atexit | 4 - Lib/test/output/test_audioop | 1 - Lib/test/output/test_binascii | 29 - Lib/test/output/test_binhex | 1 - Lib/test/output/test_bsddb | 1 - Lib/test/output/test_builtin | 52 - Lib/test/output/test_cd | 1 - Lib/test/output/test_cgi | 24 - Lib/test/output/test_cl | 1 - Lib/test/output/test_cmath | 1 - Lib/test/output/test_compile | 1 - Lib/test/output/test_contains | 1 - Lib/test/output/test_cpickle | 11 - Lib/test/output/test_crypt | 1 - Lib/test/output/test_dbm | 1 - Lib/test/output/test_dl | 1 - Lib/test/output/test_errno | 1 - Lib/test/output/test_exceptions | 46 - Lib/test/output/test_extcall | 29 - Lib/test/output/test_fcntl | 1 - Lib/test/output/test_fork1 | 1 - Lib/test/output/test_format | 1 - Lib/test/output/test_gc | 1 - Lib/test/output/test_gdbm | 1 - Lib/test/output/test_gl | 1 - Lib/test/output/test_grammar | 54 - Lib/test/output/test_grp | 1 - Lib/test/output/test_gzip | 1 - Lib/test/output/test_hash | 1 - Lib/test/output/test_imageop | 1 - Lib/test/output/test_imgfile | 1 - Lib/test/output/test_largefile | 1 - Lib/test/output/test_linuxaudiodev | 1 - Lib/test/output/test_long | 5 - Lib/test/output/test_longexp | 2 - Lib/test/output/test_math | 26 - Lib/test/output/test_md5 | 9 - Lib/test/output/test_minidom | 65 - Lib/test/output/test_mmap | Bin 542 -> 0 bytes Lib/test/output/test_new | 7 - Lib/test/output/test_nis | 2 - Lib/test/output/test_ntpath | 2 - Lib/test/output/test_opcodes | 6 - Lib/test/output/test_openpty | 2 - Lib/test/output/test_operations | 3 - Lib/test/output/test_operator | 39 - Lib/test/output/test_pickle | 11 - Lib/test/output/test_pkg | 38 - Lib/test/output/test_popen2 | 4 - Lib/test/output/test_posixpath | 2 - Lib/test/output/test_pow | 29 - Lib/test/output/test_pty | 3 - Lib/test/output/test_pwd | 7 - Lib/test/output/test_pyexpat | 91 - Lib/test/output/test_re | 2 - Lib/test/output/test_regex | 29 - Lib/test/output/test_rfc822 | 1 - Lib/test/output/test_rgbimg | 2 - Lib/test/output/test_rotor | 5 - Lib/test/output/test_select | 1 - Lib/test/output/test_sha | 4 - Lib/test/output/test_signal | 2 - Lib/test/output/test_socket | 3 - Lib/test/output/test_sre | 2 - Lib/test/output/test_strftime | 1 - Lib/test/output/test_string | 3 - Lib/test/output/test_strop | 3 - Lib/test/output/test_struct | 1 - Lib/test/output/test_sunaudiodev | 1 - Lib/test/output/test_thread | 6 - Lib/test/output/test_time | 1 - Lib/test/output/test_timing | 1 - Lib/test/output/test_tokenize | 592 - Lib/test/output/test_types | 15 - Lib/test/output/test_ucn | 4 - Lib/test/output/test_unicode | 7 - Lib/test/output/test_unicodedata | 2 - Lib/test/output/test_unpack | 1 - Lib/test/output/test_urlparse | 1 - Lib/test/output/test_userdict | 1 - Lib/test/output/test_userlist | 1 - Lib/test/output/test_userstring | 1 - Lib/test/output/test_winreg | 3 - Lib/test/output/test_winreg2 | 77 - Lib/test/output/test_winsound | 2 - Lib/test/output/test_xmllib | 1 - Lib/test/output/test_zipfile | 1 - Lib/test/output/test_zlib | 10 - Lib/test/pystone.py | 252 - Lib/test/re_tests.py | 596 - Lib/test/regex_tests.py | 289 - Lib/test/regrtest.py | 292 - Lib/test/reperf.py | 23 - Lib/test/sortperf.py | 142 - Lib/test/string_tests.py | 202 - Lib/test/test.xml | 115 - Lib/test/test_MimeWriter.py | 170 - Lib/test/test_al.py | 24 - Lib/test/test_array.py | 178 - Lib/test/test_atexit.py | 24 - Lib/test/test_audioop.py | 264 - Lib/test/test_b1.py | 472 - Lib/test/test_b2.py | 297 - Lib/test/test_binascii.py | 112 - Lib/test/test_binhex.py | 46 - Lib/test/test_bsddb.py | 74 - Lib/test/test_builtin.py | 13 - Lib/test/test_cd.py | 26 - Lib/test/test_cgi.py | 172 - Lib/test/test_cl.py | 78 - Lib/test/test_cmath.py | 35 - Lib/test/test_compile.py | 16 - Lib/test/test_contains.py | 168 - Lib/test/test_cpickle.py | 107 - Lib/test/test_crypt.py | 11 - Lib/test/test_dbm.py | 34 - Lib/test/test_dl.py | 32 - Lib/test/test_errno.py | 49 - Lib/test/test_exceptions.py | 121 - Lib/test/test_extcall.py | 146 - Lib/test/test_fcntl.py | 36 - Lib/test/test_fork1.py | 69 - Lib/test/test_format.py | 52 - Lib/test/test_gc.py | 99 - Lib/test/test_gdbm.py | 40 - Lib/test/test_gl.py | 150 - Lib/test/test_grammar.py | 584 - Lib/test/test_grp.py | 25 - Lib/test/test_gzip.py | 54 - Lib/test/test_hash.py | 26 - Lib/test/test_imageop.py | 171 - Lib/test/test_imgfile.py | 117 - Lib/test/test_largefile.py | 129 - Lib/test/test_linuxaudiodev.py | 23 - Lib/test/test_long.py | 260 - Lib/test/test_longexp.py | 18 - Lib/test/test_math.py | 154 - Lib/test/test_md5.py | 30 - Lib/test/test_minidom.py | 331 - Lib/test/test_mmap.py | 122 - Lib/test/test_new.py | 63 - Lib/test/test_nis.py | 32 - Lib/test/test_ntpath.py | 45 - Lib/test/test_opcodes.py | 101 - Lib/test/test_openpty.py | 22 - Lib/test/test_operations.py | 5 - Lib/test/test_operator.py | 77 - Lib/test/test_pickle.py | 75 - Lib/test/test_pkg.py | 225 - Lib/test/test_popen2.py | 23 - Lib/test/test_posixpath.py | 42 - Lib/test/test_pow.py | 95 - Lib/test/test_pty.py | 93 - Lib/test/test_pwd.py | 72 - Lib/test/test_pyexpat.py | 148 - Lib/test/test_re.py | 378 - Lib/test/test_regex.py | 110 - Lib/test/test_rfc822.py | 122 - Lib/test/test_rgbimg.py | 62 - Lib/test/test_rotor.py | 28 - Lib/test/test_select.py | 63 - Lib/test/test_sha.py | 28 - Lib/test/test_signal.py | 66 - Lib/test/test_socket.py | 146 - Lib/test/test_sre.py | 395 - Lib/test/test_strftime.py | 134 - Lib/test/test_string.py | 38 - Lib/test/test_strop.py | 87 - Lib/test/test_struct.py | 121 - Lib/test/test_sunaudiodev.py | 20 - Lib/test/test_support.py | 73 - Lib/test/test_thread.py | 113 - Lib/test/test_time.py | 39 - Lib/test/test_timing.py | 21 - Lib/test/test_tokenize.py | 10 - Lib/test/test_types.py | 267 - Lib/test/test_ucn.py | 82 - Lib/test/test_unicode.py | 517 - Lib/test/test_unicodedata.py | 50 - Lib/test/test_unpack.py | 131 - Lib/test/test_urlparse.py | 0 Lib/test/test_userdict.py | 101 - Lib/test/test_userlist.py | 187 - Lib/test/test_userstring.py | 45 - Lib/test/test_winreg.py | 147 - Lib/test/test_winreg2.py | 350 - Lib/test/test_winsound.py | 7 - Lib/test/test_xmllib.py | 25 - Lib/test/test_zipfile.py | 26 - Lib/test/test_zlib.py | 161 - Lib/test/testall.py | 4 - Lib/test/testimg.uue | 1170 - Lib/test/testimgr.uue | 1170 - Lib/test/testrgb.uue | 971 - Lib/test/tokenize_tests.py | 161 - Lib/threading.py | 638 - Lib/toaiff.py | 103 - Lib/token.py | 128 - Lib/tokenize.py | 204 - Lib/traceback.py | 268 - Lib/tty.py | 36 - Lib/types.py | 68 - Lib/tzparse.py | 93 - Lib/urllib.py | 1214 - Lib/urllib2.py | 1063 - Lib/urlopen.py | 410 - Lib/urlparse.py | 255 - Lib/user.py | 43 - Lib/uu.py | 185 - Lib/wave.py | 474 - Lib/webbrowser.py | 229 - Lib/whichdb.py | 81 - Lib/whrandom.py | 140 - Lib/xdrlib.py | 279 - Lib/xml/__init__.py | 22 - Lib/xml/dom/__init__.py | 10 - Lib/xml/dom/minidom.py | 453 - Lib/xml/dom/pulldom.py | 194 - Lib/xml/parsers/__init__.py | 8 - Lib/xml/sax/__init__.py | 49 - Lib/xml/sax/_exceptions.py | 108 - Lib/xml/sax/expatreader.py | 203 - Lib/xml/sax/handler.py | 270 - Lib/xml/sax/saxutils.py | 153 - Lib/xml/sax/xmlreader.py | 225 - Lib/xmllib.py | 914 - Lib/zipfile.py | 470 - Mac/Build/App.prj | Bin 61883 -> 0 bytes Mac/Build/App.prj.exp | 1 - Mac/Build/Cm.prj | Bin 63955 -> 0 bytes Mac/Build/Cm.prj.exp | 5 - Mac/Build/ColorPicker.prj | Bin 64733 -> 0 bytes Mac/Build/ColorPicker.prj.exp | 1 - Mac/Build/Drag.prj | Bin 61585 -> 0 bytes Mac/Build/Drag.prj.exp | 1 - Mac/Build/Fm.prj | Bin 66030 -> 0 bytes Mac/Build/Fm.prj.exp | 2 - Mac/Build/Help.prj | Bin 64734 -> 0 bytes Mac/Build/Help.prj.exp | 1 - Mac/Build/HtmlRender.prj | Bin 42274 -> 0 bytes Mac/Build/HtmlRender.prj.exp | 1 - Mac/Build/Icn.prj | Bin 64734 -> 0 bytes Mac/Build/Icn.prj.exp | 1 - Mac/Build/List.prj | Bin 64734 -> 0 bytes Mac/Build/List.prj.exp | 3 - Mac/Build/PlugIns.prj | Bin 86310 -> 0 bytes Mac/Build/Printing.prj | Bin 62207 -> 0 bytes Mac/Build/Printing.prj.exp | 1 - Mac/Build/PythonCore.prj | Bin 55371 -> 0 bytes Mac/Build/PythonCoreCFM68K.prj | Bin 84459 -> 0 bytes Mac/Build/PythonCoreCFM68K.prj.exp | 2064 - Mac/Build/PythonCorePPC.prj | Bin 117060 -> 0 bytes Mac/Build/PythonCorePPC.prj.exp | 2326 - Mac/Build/PythonInterpreter.prj | Bin 113930 -> 0 bytes Mac/Build/PythonStandCarbon.prj | Bin 154391 -> 0 bytes Mac/Build/PythonStandSmall.prj | Bin 154025 -> 0 bytes Mac/Build/PythonStandalone.prj | Bin 149594 -> 0 bytes Mac/Build/Qdoffs.prj | Bin 63023 -> 0 bytes Mac/Build/Qdoffs.prj.exp | 1 - Mac/Build/Qt.prj | Bin 69831 -> 0 bytes Mac/Build/Qt.prj.exp | 1 - Mac/Build/Scrap.prj | Bin 64734 -> 0 bytes Mac/Build/Scrap.prj.exp | 1 - Mac/Build/Snd.prj | Bin 64734 -> 0 bytes Mac/Build/Snd.prj.exp | 1 - Mac/Build/Sndihooks.prj | Bin 66030 -> 0 bytes Mac/Build/Sndihooks.prj.exp | 1 - Mac/Build/TE.prj | Bin 64734 -> 0 bytes Mac/Build/TE.prj.exp | 4 - Mac/Build/_tkinter.prj | Bin 65843 -> 0 bytes Mac/Build/_tkinter.prj.exp | 1 - Mac/Build/buildlibs.prj | Bin 171988 -> 0 bytes Mac/Build/calldll.ppc.prj | Bin 34881 -> 0 bytes Mac/Build/calldll.ppc.prj.exp | 11 - Mac/Build/ctb.prj | Bin 60340 -> 0 bytes Mac/Build/ctb.prj.exp | 1 - Mac/Build/gdbm.prj | Bin 63737 -> 0 bytes Mac/Build/gdbm.prj.exp | 1 - Mac/Build/icglue.prj | Bin 62887 -> 0 bytes Mac/Build/icglue.prj.exp | 1 - Mac/Build/macspeech.prj | Bin 40576 -> 0 bytes Mac/Build/macspeech.prj.exp | 5 - Mac/Build/pyexpat.prj | Bin 59621 -> 0 bytes Mac/Build/pyexpat.prj.exp | 1 - Mac/Build/ucnhash.prj | Bin 60893 -> 0 bytes Mac/Build/ucnhash.prj.exp | 1 - Mac/Build/waste.prj | Bin 69844 -> 0 bytes Mac/Build/waste.prj.exp | 1 - Mac/Build/xx.prj | Bin 54881 -> 0 bytes Mac/Build/xx.prj.exp | 1 - Mac/Build/zlib.prj | Bin 65186 -> 0 bytes Mac/Build/zlib.prj.exp | 1 - Mac/Compat/chdir.c | 42 - Mac/Compat/dirent.h | 23 - Mac/Compat/getbootvol.c | 18 - Mac/Compat/getwd.c | 110 - Mac/Compat/macgetmtime.c | 44 - Mac/Compat/macstat.c | 63 - Mac/Compat/macstat.h | 34 - Mac/Compat/mkdir.c | 28 - Mac/Compat/nfullpath.c | 75 - Mac/Compat/nfullpath.h | 1 - Mac/Compat/opendir.c | 132 - Mac/Compat/rmdir.c | 20 - Mac/Compat/sync.c | 17 - Mac/Contrib/AECaptureParser/AECaptureParser.py | 362 - Mac/Contrib/AECaptureParser/readme.txt | 5 - Mac/Contrib/BBPy/PythonSlave.py | 129 - Mac/Contrib/BBPy/README | 41 - .../BBPy/source/BB stuff/ExternalInterface.h | 716 - .../BBPy/source/BB-stuff/ExternalInterface.h | 716 - Mac/Contrib/BBPy/source/BBPy.h | 17 - Mac/Contrib/BBPy/source/BBPy.rsrc | 1 - Mac/Contrib/BBPy/source/BBPy_lauch.c | 94 - Mac/Contrib/BBPy/source/BBPy_launch.c | 94 - Mac/Contrib/BBPy/source/BBPy_main.c | 104 - Mac/Contrib/PythonDetector/OpenPythonLib | Bin 13234 -> 0 bytes Mac/Contrib/PythonDetector/OpenPythonLib with NS | Bin 13853 -> 0 bytes Mac/Contrib/PythonDetector/PythonDetector | Bin 27559 -> 0 bytes Mac/Contrib/PythonDetector/readme.txt | 60 - Mac/Contrib/PythonScript/PyScriptTest.py | 25 - Mac/Contrib/PythonScript/PythonScript.py | 301 - Mac/Contrib/PythonScript/ReadMe.txt | 86 - Mac/Contrib/PythonScript/baepack.py | 385 - Mac/Contrib/PythonScript/baetools.py | 263 - Mac/Contrib/PythonScript/baetypes.py | 564 - Mac/Contrib/PythonScript/getaete.py | 406 - Mac/Contrib/PythonScript/printaete.py | 346 - Mac/Contrib/PythonScript/testeudora.py | 44 - Mac/Contrib/Sherlock/Python-FAQ.src | Bin 3342 -> 0 bytes Mac/Contrib/Sherlock/Python-docs.src | Bin 3344 -> 0 bytes Mac/Contrib/Sherlock/Python.src | Bin 3438 -> 0 bytes Mac/Contrib/Sherlock/readme.txt | 14 - Mac/Contrib/osam/OSAm.c | 262 - Mac/Contrib/osam/OSAm.exp | 1 - Mac/Contrib/osam/OSAm.h | 30 - Mac/Contrib/osam/OSAm.prj | Bin 49980 -> 0 bytes Mac/Contrib/osam/ScriptRunner.c | 289 - Mac/Contrib/osam/ScriptRunner.h | 30 - Mac/Demo/PICTbrowse/ICONbrowse.py | 169 - Mac/Demo/PICTbrowse/PICTbrowse.py | 147 - Mac/Demo/PICTbrowse/PICTbrowse.rsrc | Bin 785 -> 0 bytes Mac/Demo/PICTbrowse/PICTbrowse2.py | 169 - Mac/Demo/PICTbrowse/cicnbrowse.py | 169 - Mac/Demo/PICTbrowse/oldPICTbrowse.py | 165 - Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc | Bin 502 -> 0 bytes Mac/Demo/applescript.html | 209 - Mac/Demo/building.html | 532 - Mac/Demo/calldll/readme | 57 - Mac/Demo/calldll/samplecalldll.py | 24 - Mac/Demo/calldll/testcalldll.py | 132 - Mac/Demo/cgi.html | 90 - Mac/Demo/cgi/cgitest.cgi.py | 2 - Mac/Demo/cgi/cgitest.cgi.rsrc | Bin 8072 -> 0 bytes Mac/Demo/cgi/realcgitest.py | 59 - Mac/Demo/embed.html | 46 - Mac/Demo/embed/demo.c | 62 - Mac/Demo/embed/embeddemo.prj | Bin 25071 -> 0 bytes Mac/Demo/example0.html | 75 - Mac/Demo/example0/checktext.py | 39 - Mac/Demo/example1.html | 193 - Mac/Demo/example1/dnslookup-1.gif | Bin 2570 -> 0 bytes Mac/Demo/example1/dnslookup-1.py | 61 - Mac/Demo/example1/dnslookup-1.rsrc | Bin 604 -> 0 bytes Mac/Demo/example2.html | 162 - Mac/Demo/example2/dnslookup-2.gif | Bin 2984 -> 0 bytes Mac/Demo/example2/dnslookup-2.py | 92 - Mac/Demo/example2/dnslookup-2.rsrc | Bin 707 -> 0 bytes Mac/Demo/freezing.html | 152 - Mac/Demo/html.icons/createmake.png | Bin 14212 -> 0 bytes Mac/Demo/html.icons/mkapplet.gif | Bin 1010 -> 0 bytes Mac/Demo/html.icons/modulator.gif | Bin 6479 -> 0 bytes Mac/Demo/html.icons/options.gif | Bin 4231 -> 0 bytes Mac/Demo/html.icons/preferences.gif | Bin 5344 -> 0 bytes Mac/Demo/html.icons/python.gif | Bin 1004 -> 0 bytes Mac/Demo/imgbrowse/imgbrowse.py | 119 - Mac/Demo/imgbrowse/mac_image.py | 56 - Mac/Demo/index.html | 160 - Mac/Demo/interslip/InterslipLib.c | 97 - Mac/Demo/interslip/InterslipLib.h | 20 - Mac/Demo/interslip/interslipmodule.c | 225 - Mac/Demo/mpwextensions.html | 484 - Mac/Demo/plugins.html | 361 - Mac/Demo/printing/PrintingDemo.py | 93 - Mac/Demo/quicktime/MovieInWindow.py | 66 - Mac/Demo/quicktime/VerySimplePlayer.py | 92 - Mac/Demo/resources/copyres.py | 57 - Mac/Demo/resources/listres.py | 60 - Mac/Demo/scripting/Eudora_Suite.py | 547 - Mac/Demo/scripting/Standard_Suite.py | 272 - Mac/Demo/scripting/testeudora.py | 46 - Mac/Demo/sound/morse.py | 180 - Mac/Demo/sound/morselib.py | 188 - Mac/Demo/sound/playaiff.py | 45 - Mac/Demo/speech/SCRIPT | 1204 - Mac/Demo/speech/grail.py | 228 - Mac/Demo/speech/hum.py | 31 - Mac/Demo/textedit.html | 151 - Mac/Demo/textedit/ped.py | 345 - Mac/Demo/using.html | 423 - Mac/Demo/waste.html | 72 - Mac/Demo/waste/htmled.py | 827 - Mac/Demo/waste/swed.py | 629 - Mac/Demo/waste/wed.py | 421 - Mac/Distributions/(vise)/Python 1.6.vct | Bin 556182 -> 0 bytes Mac/Distributions/68k-shared.exclude | 18 - Mac/Distributions/68k-shared.include | 84 - Mac/Distributions/68k-stand.exclude | 15 - Mac/Distributions/68k-stand.include | 47 - Mac/Distributions/binary.exclude | 30 - Mac/Distributions/binary.include | 164 - Mac/Distributions/dev.exclude | 17 - Mac/Distributions/dev.include | 325 - Mac/Distributions/pyexpat-bin.exclude | 21 - Mac/Distributions/pyexpat-bin.include | 32 - Mac/Distributions/readme.txt | 22 - Mac/Distributions/src.exclude | 16 - Mac/Distributions/src.include | 118 - Mac/GUSI-mods/into-include/GUSI.h | 366 - Mac/GUSI-mods/into-include/GUSI_P.h | 471 - Mac/GUSI-mods/into-src/GUSI.r | 168 - Mac/GUSI-mods/into-src/GUSIDispatch.cp | 1434 - Mac/GUSI-mods/into-src/GUSINetDB.cp | 579 - Mac/GUSI-mods/into-src/GUSISIOUX.cp | 246 - Mac/HISTORY | 602 - Mac/IDE scripts/ separator --- | 1 - Mac/IDE scripts/Hack/Debugger off | 4 - Mac/IDE scripts/Hack/Debugger on | 5 - Mac/IDE scripts/Hack/Remove .pyc files... | 22 - Mac/IDE scripts/Hack/Toolbox Assistant... | 45 - Mac/IDE scripts/Hold option to open a script... | 4 - Mac/IDE scripts/Insert file name... | 6 - Mac/IDE scripts/Insert folder name... | 6 - Mac/IDE scripts/Search Python Documentation... | 4 - Mac/IDE scripts/Widget demos/ActivateWindowDemo.py | 21 - Mac/IDE scripts/Widget demos/KeyTester.py | 34 - Mac/IDE scripts/Widget demos/ListWindow.py | 17 - Mac/IDE scripts/Widget demos/ModalDialog.py | 10 - Mac/IDE scripts/Widget demos/PaneDemo.py | 14 - Mac/IDE scripts/Widget demos/PaneDemo2.py | 16 - Mac/IDE scripts/Widget demos/ScrollbarWindow.py | 17 - Mac/IDE scripts/Widget demos/TwoLists.py | 22 - Mac/IDE scripts/Widget demos/WidgetTest.py | 85 - Mac/IDE scripts/separator --- | 1 - Mac/Include/config.h | 631 - Mac/Include/getapplbycreator.h | 28 - Mac/Include/macbuildno.h | 1 - Mac/Include/macdefs.h | 35 - Mac/Include/macglue.h | 144 - Mac/Include/pymactoolbox.h | 92 - Mac/Include/pythonresources.h | 175 - Mac/Lib/Audio_mac.py | 122 - Mac/Lib/EasyDialogs.py | 325 - Mac/Lib/FrameWork.py | 1043 - Mac/Lib/MACFS.py | 92 - Mac/Lib/PixMapWrapper.py | 216 - Mac/Lib/SoundMgr.py | 64 - Mac/Lib/audiodev.py | 241 - Mac/Lib/buildtools.py | 290 - Mac/Lib/cfmfile.py | 186 - Mac/Lib/dbmac.py | 140 - Mac/Lib/findertools.py | 141 - Mac/Lib/findmodulefiles.py | 94 - Mac/Lib/ic.py | 264 - Mac/Lib/icopen.py | 66 - Mac/Lib/lib-scripting/AppleScript_Suite.py | 1600 - .../lib-scripting/CodeWarrior_Standard_Suite.py | 423 - Mac/Lib/lib-scripting/Finder_7_0_Suite.py | 326 - Mac/Lib/lib-scripting/Finder_Suite.py | 1632 - Mac/Lib/lib-scripting/Metrowerks_Shell_Suite.py | 1820 - Mac/Lib/lib-scripting/QuickDraw_Graphics_Suite.py | 411 - .../lib-scripting/QuickDraw_Graphics_Supplemental | 71 - Mac/Lib/lib-scripting/Required_Suite.py | 107 - Mac/Lib/lib-scripting/Standard_Suite.py | 713 - Mac/Lib/lib-scripting/Standard_URL_suite.py | 62 - Mac/Lib/lib-scripting/Table_Suite.py | 106 - Mac/Lib/lib-scripting/Text_Suite.py | 186 - Mac/Lib/lib-scripting/Type_Names_Suite.py | 454 - Mac/Lib/lib-scripting/WWW_Suite.py | 426 - Mac/Lib/lib-toolbox/AEDataModel.py | 69 - Mac/Lib/lib-toolbox/AEObjects.py | 62 - Mac/Lib/lib-toolbox/AERegistry.py | 766 - Mac/Lib/lib-toolbox/Appearance.py | 514 - Mac/Lib/lib-toolbox/AppleEvents.py | 57 - Mac/Lib/lib-toolbox/Balloons.py | 56 - Mac/Lib/lib-toolbox/Components.py | 55 - Mac/Lib/lib-toolbox/ControlAccessor.py | 57 - Mac/Lib/lib-toolbox/Controls.py | 401 - Mac/Lib/lib-toolbox/Dialogs.py | 74 - Mac/Lib/lib-toolbox/Dragconst.py | 67 - Mac/Lib/lib-toolbox/Events.py | 87 - Mac/Lib/lib-toolbox/Fonts.py | 49 - Mac/Lib/lib-toolbox/Icons.py | 349 - Mac/Lib/lib-toolbox/Lists.py | 29 - Mac/Lib/lib-toolbox/MediaDescr.py | 97 - Mac/Lib/lib-toolbox/Menus.py | 49 - Mac/Lib/lib-toolbox/MiniAEFrame.py | 193 - Mac/Lib/lib-toolbox/QDOffscreen.py | 43 - Mac/Lib/lib-toolbox/QuickDraw.py | 169 - Mac/Lib/lib-toolbox/QuickTime.py | 693 - Mac/Lib/lib-toolbox/Resources.py | 23 - Mac/Lib/lib-toolbox/Sound.py | 360 - Mac/Lib/lib-toolbox/TextEdit.py | 56 - Mac/Lib/lib-toolbox/WASTEconst.py | 95 - Mac/Lib/lib-toolbox/Windows.py | 210 - Mac/Lib/lib-toolbox/aepack.py | 349 - Mac/Lib/lib-toolbox/aetools.py | 271 - Mac/Lib/lib-toolbox/aetypes.py | 566 - Mac/Lib/maccache.py | 61 - Mac/Lib/macerrors.py | 1098 - Mac/Lib/macfsn.py | 155 - Mac/Lib/macostools.py | 115 - Mac/Lib/mactty.py | 74 - Mac/Lib/preferences.py | 219 - Mac/Lib/py_resource.py | 90 - Mac/Lib/pythonprefs.py | 126 - Mac/Lib/quietconsole.py | 110 - Mac/Lib/test/AEservertest.py | 211 - Mac/Lib/test/AEservertest.rsrc | Bin 25637 -> 0 bytes Mac/Lib/test/aete.py | 475 - Mac/Lib/test/cmtest.py | 45 - Mac/Lib/test/ctbtest.py | 50 - Mac/Lib/test/dragtest.py | 43 - Mac/Lib/test/echo.py | 159 - Mac/Lib/test/fgbgtimetest.py | 17 - Mac/Lib/test/icgluetest.py | 27 - Mac/Lib/test/progressbar.py | 25 - Mac/Lib/test/tae.py | 112 - Mac/Lib/test/tctl.py | 20 - Mac/Lib/test/tdlg.py | 30 - Mac/Lib/test/tdlg_modeless.py | 42 - Mac/Lib/test/tell.py | 63 - Mac/Lib/test/test_finder_ae | 5 - Mac/Lib/test/test_setcontroldata.py | 13 - Mac/Lib/test/test_suite.py | 25 - Mac/Lib/test/testfinderopen.py | 33 - Mac/Lib/test/tlist.py | 92 - Mac/Lib/test/tlist_dialog.py | 79 - Mac/Lib/test/tlist_dialog.rsrc | Bin 513 -> 0 bytes Mac/Lib/test/tmenu.py | 68 - Mac/Lib/test/tscrollwin.py | 86 - Mac/Lib/test/tsnd.py | 18 - Mac/Lib/test/tte.py | 17 - Mac/Lib/test/ttedit.py | 81 - Mac/Lib/test/twedit.py | 86 - Mac/Lib/test/twin.py | 9 - Mac/MPW/Build | 3 - Mac/MPW/Makefile | 513 - Mac/MPW/README | 122 - Mac/MPW/buildall | 29 - Mac/Modules/ColorPickermodule.c | 86 - Mac/Modules/Nav.c | 971 - Mac/Modules/Printingmodule.c | 468 - Mac/Modules/ae/AEmodule.c | 1160 - Mac/Modules/ae/README | 24 - Mac/Modules/ae/aescan.py | 126 - Mac/Modules/ae/aesupport.py | 201 - Mac/Modules/ae/nsremote.py | 71 - Mac/Modules/app/Appmodule.c | 1244 - Mac/Modules/app/appscan.py | 68 - Mac/Modules/app/appsupport.py | 111 - Mac/Modules/calldll.c | 1194 - Mac/Modules/cm/Cmmodule.c | 846 - Mac/Modules/cm/cmscan.py | 89 - Mac/Modules/cm/cmsupport.py | 110 - Mac/Modules/ctbmodule.c | 609 - Mac/Modules/ctl/Ctlmodule.c | 2331 - Mac/Modules/ctl/ctledit.py | 27 - Mac/Modules/ctl/ctlscan.py | 132 - Mac/Modules/ctl/ctlsupport.py | 617 - Mac/Modules/dlg/Dlgmodule.c | 1296 - Mac/Modules/dlg/dlgscan.py | 101 - Mac/Modules/dlg/dlgsupport.py | 196 - Mac/Modules/drag/Dragmodule.c | 1044 - Mac/Modules/drag/dragscan.py | 77 - Mac/Modules/drag/dragsupport.py | 283 - Mac/Modules/evt/Evtmodule.c | 424 - Mac/Modules/evt/evtedit.py | 6 - Mac/Modules/evt/evtscan.py | 84 - Mac/Modules/evt/evtsupport.py | 103 - Mac/Modules/fm/Fmmodule.c | 423 - Mac/Modules/fm/fmscan.py | 63 - Mac/Modules/fm/fmsupport.py | 77 - Mac/Modules/gestaltmodule.c | 65 - Mac/Modules/help/Helpmodule.c | 322 - Mac/Modules/help/helpscan.py | 57 - Mac/Modules/help/helpsupport.py | 80 - Mac/Modules/htmlrender/HtmlRendermodule.c | 818 - Mac/Modules/htmlrender/htmlscan.py | 62 - Mac/Modules/htmlrender/htmlsupport.py | 213 - Mac/Modules/icgluemodule.c | 596 - Mac/Modules/icn/Icnmodule.c | 1390 - Mac/Modules/icn/icnscan.py | 69 - Mac/Modules/icn/icnsupport.py | 89 - Mac/Modules/list/Listmodule.c | 700 - Mac/Modules/list/listscan.py | 80 - Mac/Modules/list/listsupport.py | 152 - Mac/Modules/macconfig.c | 301 - Mac/Modules/macfsmodule.c | 998 - Mac/Modules/macmodule.c | 650 - Mac/Modules/macosmodule.c | 734 - Mac/Modules/macspeech/README | 18 - Mac/Modules/macspeechmodule.c | 552 - Mac/Modules/menu/Menumodule.c | 1972 - Mac/Modules/menu/menuedit.py | 47 - Mac/Modules/menu/menuscan.py | 86 - Mac/Modules/menu/menusupport.py | 63 - Mac/Modules/qd/Qdmodule.c | 4970 -- Mac/Modules/qd/qdedit.py | 159 - Mac/Modules/qd/qdscan.py | 169 - Mac/Modules/qd/qdsupport.py | 449 - Mac/Modules/qdoffs/Qdoffsmodule.c | 639 - Mac/Modules/qdoffs/qdoffsscan.py | 66 - Mac/Modules/qdoffs/qdoffssupport.py | 124 - Mac/Modules/qt/Qtmodule.c | 7969 --- Mac/Modules/qt/qtscan.py | 131 - Mac/Modules/qt/qtsupport.py | 272 - Mac/Modules/res/Resmodule.c | 1510 - Mac/Modules/res/resedit.py | 98 - Mac/Modules/res/resscan.py | 82 - Mac/Modules/res/ressupport.py | 181 - Mac/Modules/scrap/Scrapmodule.c | 168 - Mac/Modules/scrap/scrapscan.py | 48 - Mac/Modules/scrap/scrapsupport.py | 60 - Mac/Modules/snd/Sndihooks.c | 513 - Mac/Modules/snd/Sndmodule.c | 1556 - Mac/Modules/snd/sndscan.py | 142 - Mac/Modules/snd/sndsupport.py | 365 - Mac/Modules/te/TEmodule.c | 1077 - Mac/Modules/te/tescan.py | 63 - Mac/Modules/te/tesupport.py | 161 - Mac/Modules/waste/wastemodule.c | 2298 - Mac/Modules/waste/wastescan.py | 92 - Mac/Modules/waste/wastesupport.py | 427 - Mac/Modules/win/Winmodule.c | 2529 - Mac/Modules/win/winedit.py | 132 - Mac/Modules/win/winscan.py | 107 - Mac/Modules/win/winsupport.py | 140 - Mac/PlugIns/readme.txt | 1 - Mac/Python/getapplbycreator.c | 159 - Mac/Python/gusiconfig.cpp | 135 - Mac/Python/macapplication.c | 87 - Mac/Python/macgetargv.c | 306 - Mac/Python/macgetcompiler.c | 79 - Mac/Python/macgetpath.c | 475 - Mac/Python/macgetplatform.c | 39 - Mac/Python/macglue.c | 1069 - Mac/Python/macimport.c | 476 - Mac/Python/macmain.c | 589 - Mac/Python/macsetfiletype.c | 75 - Mac/Python/macshlglue.c | 128 - Mac/Python/missingtoolboxcalls.c | 290 - Mac/ReadMe | 184 - Mac/ReadMe-dev | 23 - Mac/ReadMe-src | 13 - Mac/Relnotes | 13 - Mac/Resources/Carbon.r | 15 - Mac/Resources/balloons.bh | 32 - Mac/Resources/bundle.rsrc | Bin 27443 -> 0 bytes Mac/Resources/dialogs.rsrc | Bin 16202 -> 0 bytes Mac/Resources/errors.rsrc | Bin 50038 -> 0 bytes Mac/Resources/gusiprefs.rsrc | Bin 815 -> 0 bytes Mac/Resources/pythonpath.r | 95 - Mac/Resources/tkpython.rsrc | Bin 285731 -> 0 bytes Mac/Resources/version.r | 30 - Mac/Tools/CGI/BuildCGIApplet.py | 76 - Mac/Tools/CGI/BuildCGIApplet.rsrc | Bin 460 -> 0 bytes Mac/Tools/CGI/CGI_README.txt | 66 - Mac/Tools/CGI/PythonCGISlave.py | 243 - Mac/Tools/CGI/PythonCGISlave.rsrc | Bin 460 -> 0 bytes Mac/Tools/IDE/BuildIDE.py | 41 - Mac/Tools/IDE/FontSettings.py | 223 - Mac/Tools/IDE/MacPrefs.py | 108 - Mac/Tools/IDE/ModuleBrowser.py | 178 - Mac/Tools/IDE/ProfileBrowser.py | 91 - Mac/Tools/IDE/PyBrowser.py | 438 - Mac/Tools/IDE/PyConsole.py | 380 - Mac/Tools/IDE/PyDebugger.py | 887 - Mac/Tools/IDE/PyDocSearch.py | 290 - Mac/Tools/IDE/PyEdit.py | 1259 - Mac/Tools/IDE/PyFontify.py | 154 - Mac/Tools/IDE/PyInteractive.py | 115 - Mac/Tools/IDE/PythonIDE.py | 41 - Mac/Tools/IDE/PythonIDE.rsrc | Bin 13790 -> 0 bytes Mac/Tools/IDE/PythonIDEMain.py | 251 - Mac/Tools/IDE/Splash.py | 162 - Mac/Tools/IDE/W.py | 40 - Mac/Tools/IDE/Wapplication.py | 441 - Mac/Tools/IDE/Wbase.py | 720 - Mac/Tools/IDE/Wcontrols.py | 401 - Mac/Tools/IDE/Widgets.rsrc | Bin 5077 -> 0 bytes Mac/Tools/IDE/Wkeys.py | 45 - Mac/Tools/IDE/Wlists.py | 469 - Mac/Tools/IDE/Wmenus.py | 252 - Mac/Tools/IDE/Wminiapp.py | 20 - Mac/Tools/IDE/Wquicktime.py | 119 - Mac/Tools/IDE/Wsocket.py | 395 - Mac/Tools/IDE/Wtext.py | 983 - Mac/Tools/IDE/Wtraceback.py | 188 - Mac/Tools/IDE/Wwindows.py | 628 - Mac/Tools/macfreeze/directives.py | 43 - Mac/Tools/macfreeze/hello/hello.py | 5 - Mac/Tools/macfreeze/macfreeze.py | 75 - Mac/Tools/macfreeze/macfreeze.rsrc | Bin 1006 -> 0 bytes Mac/Tools/macfreeze/macfreezegui.py | 158 - Mac/Tools/macfreeze/macgen_bin.py | 208 - Mac/Tools/macfreeze/macgen_info.py | 8 - Mac/Tools/macfreeze/macgen_rsrc.py | 37 - Mac/Tools/macfreeze/macgen_src.py | 109 - Mac/Tools/macfreeze/macgenerate.py | 8 - Mac/Tools/macfreeze/macmodulefinder.py | 110 - Mac/Tools/twit/TwitCore.py | 549 - Mac/Tools/twit/mac_widgets.py | 317 - Mac/Tools/twit/mactwit_app.py | 267 - Mac/Tools/twit/mactwit_browser.py | 429 - Mac/Tools/twit/mactwit_edit.py | 24 - Mac/Tools/twit/mactwit_mod.py | 114 - Mac/Tools/twit/mactwit_stack.py | 159 - Mac/Tools/twit/twit.py | 59 - Mac/Tools/twit/twit.rsrc | Bin 46350 -> 0 bytes Mac/Tools/twit/twittest.py | 13 - Mac/Unsupported/mactcp/MACTCPconst.py | 62 - Mac/Unsupported/mactcp/MacTCPerrors.py | 35 - Mac/Unsupported/mactcp/dnrglue.c | 301 - Mac/Unsupported/mactcp/macdnrmodule.c | 459 - Mac/Unsupported/mactcp/mactcpmodule.c | 990 - Mac/Unsupported/mactcp/mactcpmodules.mu.exp | 2 - Mac/Unsupported/mactcp/mactcpmodules.mu.hqx | 212 - Mac/Unsupported/mactcp/socket.py | 304 - Mac/Unsupported/mactcp/tcpglue.c | 477 - Mac/Unsupported/mactcp/tcpglue.h | 68 - Mac/Unsupported/stdwinmodule.mu.exp | 241 - Mac/Unsupported/stdwinmodule.mu.hqx | 182 - Mac/_checkversion.py | 16 - Mac/errno_unix.h | 18 - Mac/fopenRF.c | 336 - Mac/mkapplet.py | 257 - Mac/mwerks/errno_unix.h | 61 - Mac/mwerks/macuseshlstart.c | 29 - Mac/mwerks/malloc/README | 84 - Mac/mwerks/malloc/calloc.c | 53 - Mac/mwerks/malloc/malloc.c | 447 - Mac/mwerks/mwerks_applet_config.h | 33 - Mac/mwerks/mwerks_carbon_config.h | 42 - Mac/mwerks/mwerks_config.h | 2 - Mac/mwerks/mwerks_nonshared_config.h | 37 - Mac/mwerks/mwerks_plugin_config.h | 15 - Mac/mwerks/mwerks_shared_config.h | 42 - Mac/mwerks/mwerks_shlib_config.h | 3 - Mac/mwerks/mwerks_small_config.h | 40 - Mac/mwerks/mwerks_threadsmall_config.h | 35 - Mac/mwerks/mwerks_tkplugin_config.h | 12 - Mac/mwerks/mwfopenrf.c | 79 - Mac/mwerks/old/mwerks_cfm68k_config.h | 3 - Mac/mwerks/old/mwerks_nsgusi_config.h | 14 - Mac/mwerks/old/mwerks_nsgusitk_config.h | 9 - Mac/mwerks/old/mwerks_shgusi_config.h | 7 - Mac/mwerks/old/mwerks_tk_config.h | 5 - Mac/mwerks/projects/README-Projectfiles | 52 - Mac/mwerks/projects/build.macfreeze/frozen.prj | Bin 139610 -> 0 bytes .../projects/build.macfreeze/frozenbundle.rsrc | Bin 5556 -> 0 bytes .../build.macfreeze/templatefrozenconfig.c | 65 - Mac/mwerksglue.c | 43 - Mac/scripts/BuildApplet.py | 67 - Mac/scripts/BuildApplet.rsrc | Bin 3027 -> 0 bytes Mac/scripts/BuildApplication.py | 147 - Mac/scripts/BuildApplication.rsrc | Bin 3711 -> 0 bytes Mac/scripts/ConfigurePython.py | 212 - Mac/scripts/ConfigurePython.rsrc | Bin 6441 -> 0 bytes Mac/scripts/EditPythonPrefs.py | 185 - Mac/scripts/EditPythonPrefs.rsrc | Bin 8994 -> 0 bytes Mac/scripts/EditPythonPrefsBH.bh | 43 - Mac/scripts/EditPythonPrefsBH.prj | Bin 24091 -> 0 bytes Mac/scripts/EditPythonPrefsBH.rsrc | Bin 3942 -> 0 bytes Mac/scripts/FixCreator.py | 36 - Mac/scripts/MkDistr.py | 312 - Mac/scripts/MkDistr.rsrc | Bin 1531 -> 0 bytes Mac/scripts/MkDistr_ui.py | 358 - Mac/scripts/PackLibDir.py | 49 - Mac/scripts/PackLibDir.rsrc | Bin 2925 -> 0 bytes Mac/scripts/RunLibScript.py | 111 - Mac/scripts/RunLibScript.rsrc | Bin 3399 -> 0 bytes Mac/scripts/binhextree.py | 240 - Mac/scripts/cfmfile.py | 236 - Mac/scripts/crlf.py | 29 - Mac/scripts/errors.txt | 1098 - Mac/scripts/findgremlins.py | 53 - Mac/scripts/fixfiletypes.py | 56 - Mac/scripts/fixgusidir.py | 89 - Mac/scripts/fullbuild.py | 305 - Mac/scripts/fullbuild.rsrc | Bin 872 -> 0 bytes Mac/scripts/gensuitemodule.py | 622 - Mac/scripts/makeclean.py | 59 - Mac/scripts/mkestrres-errno.h | 7 - Mac/scripts/mkestrres.py | 150 - Mac/scripts/mkfrozenresources.py | 39 - Mac/scripts/run.py | 41 - Mac/scripts/unshar.py | 97 - Mac/tclmods/license-terms.txt | 39 - Mac/tclmods/tclMacNotify.c | 429 - Mac/tclmods/tclSelectNotify.c | 507 - Makefile.in | 572 - Misc/ACKS | 391 - Misc/AIX-NOTES | 140 - Misc/BLURB | 29 - Misc/BLURB.LUTZ | 122 - Misc/BLURB.WINDOWS | 81 - Misc/COPYRIGHT | 32 - Misc/Fixcprt.py | 75 - Misc/HISTORY | 5538 -- Misc/HPUX-NOTES | 24 - Misc/HYPE | 70 - Misc/Makefile | 10 - Misc/Makefile.pre.in | 305 - Misc/NEWS | 2353 - Misc/NEXT-NOTES | 81 - Misc/PURIFY.README | 81 - Misc/Porting | 42 - Misc/README | 36 - Misc/RENAME | 399 - Misc/RFD | 114 - Misc/bugrelease.txt | 26 - Misc/ccpy-style.el | 48 - Misc/cheatsheet | 541 - Misc/comparisons | 129 - Misc/editline-fix | 80 - Misc/faq2html.py | 167 - Misc/fixfuncptrs.sh | 47 - Misc/indent.pro | 15 - Misc/legalfaq.txt | 77 - Misc/python-mode.el | 3126 - Misc/python.man | 299 - Misc/renumber.py | 110 - Misc/setuid-prog.c | 176 - Misc/unicode.txt | 1108 - Misc/vgrindefs | 10 - Misc/wetsign.txt | 70 - Modules/.cvsignore | 9 - Modules/Makefile.pre.in | 254 - Modules/Setup.config.in | 14 - Modules/Setup.in | 431 - Modules/_codecsmodule.c | 630 - Modules/_cursesmodule.c | 2357 - Modules/_localemodule.c | 458 - Modules/_sre.c | 2300 - Modules/_tkinter.c | 2220 - Modules/almodule.c | 3250 - Modules/arraymodule.c | 1519 - Modules/audioop.c | 1349 - Modules/binascii.c | 1029 - Modules/bsddbmodule.c | 798 - Modules/cPickle.c | 4547 -- Modules/cStringIO.c | 668 - Modules/ccpython.cc | 11 - Modules/cdmodule.c | 808 - Modules/cgen.py | 520 - Modules/cgensupport.c | 319 - Modules/cgensupport.h | 73 - Modules/clmodule.c | 2577 - Modules/cmathmodule.c | 422 - Modules/config.c.in | 44 - Modules/cryptmodule.c | 42 - Modules/cstubs | 1373 - Modules/dbmmodule.c | 283 - Modules/dlmodule.c | 218 - Modules/errnomodule.c | 803 - Modules/fcntlmodule.c | 335 - Modules/flmodule.c | 2144 - Modules/fmmodule.c | 285 - Modules/fpectlmodule.c | 242 - Modules/fpetestmodule.c | 184 - Modules/gcmodule.c | 726 - Modules/gdbmmodule.c | 488 - Modules/getbuildinfo.c | 38 - Modules/getpath.c | 604 - Modules/glmodule.c | 7639 --- Modules/grpmodule.c | 138 - Modules/imageop.c | 717 - Modules/imgfile.c | 523 - Modules/ld_so_aix | 183 - Modules/license.terms | 39 - Modules/linuxaudiodev.c | 438 - Modules/main.c | 295 - Modules/makesetup | 272 - Modules/makexp_aix | 75 - Modules/mathmodule.c | 275 - Modules/md5.h | 71 - Modules/md5c.c | 314 - Modules/md5module.c | 283 - Modules/mmapmodule.c | 992 - Modules/mpzmodule.c | 1751 - Modules/newmodule.c | 208 - Modules/nismodule.c | 382 - Modules/operator.c | 255 - Modules/parsermodule.c | 2690 - Modules/pcre-int.h | 303 - Modules/pcre.h | 84 - Modules/pcremodule.c | 658 - Modules/posixmodule.c | 5488 -- Modules/puremodule.c | 1155 - Modules/pwdmodule.c | 144 - Modules/pyexpat.c | 1036 - Modules/pypcre.c | 4752 -- Modules/python.c | 11 - Modules/readline.c | 501 - Modules/regexmodule.c | 695 - Modules/regexpr.c | 2095 - Modules/regexpr.h | 155 - Modules/resource.c | 253 - Modules/rgbimgmodule.c | 766 - Modules/rotormodule.c | 623 - Modules/selectmodule.c | 345 - Modules/sgimodule.c | 65 - Modules/shamodule.c | 566 - Modules/signalmodule.c | 673 - Modules/socketmodule.c | 2798 - Modules/soundex.c | 179 - Modules/sre.h | 85 - Modules/sre_constants.h | 76 - Modules/stropmodule.c | 1250 - Modules/structmodule.c | 1238 - Modules/sunaudiodev.c | 494 - Modules/svmodule.c | 974 - Modules/syslogmodule.c | 239 - Modules/tclNotify.c | 964 - Modules/termios.c | 307 - Modules/threadmodule.c | 405 - Modules/timemodule.c | 824 - Modules/timing.h | 67 - Modules/timingmodule.c | 77 - Modules/tkappinit.c | 88 - Modules/ucnhash.c | 12244 ---- Modules/unicodedata.c | 279 - Modules/unicodedatabase.c | 65728 ------------------- Modules/unicodedatabase.h | 33 - Modules/xxmodule.c | 220 - Modules/yuv.h | 108 - Modules/yuvconvert.c | 127 - Modules/zlibmodule.c | 875 - Objects/.cvsignore | 2 - Objects/Makefile.in | 104 - Objects/abstract.c | 1469 - Objects/bufferobject.c | 566 - Objects/classobject.c | 1688 - Objects/cobject.c | 155 - Objects/complexobject.c | 533 - Objects/dictobject.c | 1107 - Objects/fileobject.c | 1266 - Objects/floatobject.c | 711 - Objects/frameobject.c | 342 - Objects/funcobject.c | 266 - Objects/intobject.c | 891 - Objects/listobject.c | 1509 - Objects/longobject.c | 1709 - Objects/methodobject.c | 259 - Objects/moduleobject.c | 218 - Objects/object.c | 1212 - Objects/rangeobject.c | 245 - Objects/sliceobject.c | 171 - Objects/stringobject.c | 2930 - Objects/tupleobject.c | 575 - Objects/typeobject.c | 66 - Objects/unicodectype.c | 10361 --- Objects/unicodeobject.c | 5180 -- Objects/xxobject.c | 117 - PC/WinMain.c | 18 - PC/_winreg.c | 1495 - PC/config.c | 124 - PC/config.h | 613 - PC/dl_nt.c | 39 - PC/dllbase_nt.txt | 53 - PC/example_nt/.cvsignore | 5 - PC/example_nt/example.c | 20 - PC/example_nt/example.def | 2 - PC/example_nt/example.dsp | 113 - PC/example_nt/example.dsw | 29 - PC/example_nt/readme.txt | 165 - PC/frozen_dllmain.c | 134 - PC/getpathp.c | 586 - PC/import_nt.c | 77 - PC/make8x3.py | 68 - PC/makesrc.exe | Bin 25600 -> 0 bytes PC/msvcrtmodule.c | 197 - PC/os2vacpp/_tkinter.def | 8 - PC/os2vacpp/config.c | 114 - PC/os2vacpp/config.h | 202 - PC/os2vacpp/getpathp.c | 480 - PC/os2vacpp/makefile | 1925 - PC/os2vacpp/makefile.omk | 1310 - PC/os2vacpp/python.def | 475 - PC/os2vacpp/readme.txt | 114 - PC/py.ico | Bin 766 -> 0 bytes PC/pyc.ico | Bin 766 -> 0 bytes PC/pycon.ico | Bin 766 -> 0 bytes PC/pyth_w31.def | 5 - PC/python.mk | 5 - PC/python.wpj | 63 - PC/python_exe.rc | 1 - PC/python_nt.rc | 63 - PC/readme.txt | 131 - PC/src/readme.txt | 3 - PC/testpy.py | 32 - PC/utils/makesrc.c | 69 - PC/utils/makesrc.lk1 | 3 - PC/utils/makesrc.mk1 | 24 - PC/utils/makesrc.tgt | 185 - PC/utils/utils.mk | 3 - PC/utils/utils.wpj | 43 - PC/vc15_lib/_.c | 1 - PC/vc15_lib/python.mak | 2987 - PC/vc15_lib/python.vcw | 6 - PC/vc15_lib/python.wsp | Bin 254 -> 0 bytes PC/vc15_w31/_.c | 1 - PC/vc15_w31/pyth_w31.mak | 224 - PC/vc15_w31/pyth_w31.pdb | Bin 4774 -> 0 bytes PC/vc15_w31/pyth_w31.vcw | 6 - PC/vc15_w31/pyth_w31.wsp | Bin 254 -> 0 bytes PC/w9xpopen.c | 63 - PC/wat_dos/pyth_dos.lk1 | 3 - PC/wat_dos/pyth_dos.mk1 | 642 - PC/wat_dos/pyth_dos.tgt | 1701 - PC/wat_os2/pyth_os2.lk1 | 3 - PC/wat_os2/pyth_os2.mk1 | 649 - PC/wat_os2/pyth_os2.tgt | 1617 - PC/winsound.c | 158 - PCbuild/.cvsignore | 14 - PCbuild/_socket.dsp | 99 - PCbuild/_sre.dsp | 182 - PCbuild/_tkinter.dsp | 197 - PCbuild/bsddb.dsp | 188 - PCbuild/mmap.dsp | 97 - PCbuild/parser.dsp | 182 - PCbuild/pcbuild.dsw | 266 - PCbuild/pyexpat.dsp | 190 - PCbuild/python.dsp | 170 - PCbuild/python20.dsp | 1690 - PCbuild/python20.wse | 1226 - PCbuild/pythonw.dsp | 184 - PCbuild/readme.txt | 98 - PCbuild/select.dsp | 99 - PCbuild/ucnhash.dsp | 99 - PCbuild/unicodedata.dsp | 103 - PCbuild/w9xpopen.dsp | 97 - PCbuild/winreg.dsp | 108 - PCbuild/winsound.dsp | 99 - PCbuild/zlib.dsp | 99 - Parser/.cvsignore | 3 - Parser/Makefile.in | 103 - Parser/acceler.c | 153 - Parser/assert.h | 28 - Parser/bitset.c | 75 - Parser/firstsets.c | 118 - Parser/grammar.c | 221 - Parser/grammar1.c | 66 - Parser/intrcheck.c | 209 - Parser/listnode.c | 75 - Parser/metagrammar.c | 162 - Parser/myreadline.c | 133 - Parser/node.c | 84 - Parser/parser.c | 379 - Parser/parser.h | 48 - Parser/parsetok.c | 165 - Parser/pgen.c | 708 - Parser/pgen.h | 27 - Parser/pgenmain.c | 197 - Parser/printgrammar.c | 122 - Parser/tokenizer.c | 811 - Parser/tokenizer.h | 60 - Python/.cvsignore | 2 - Python/Makefile.in | 141 - Python/atof.c | 59 - Python/bltinmodule.c | 2401 - Python/ceval.c | 2894 - Python/codecs.c | 439 - Python/compile.c | 3411 - Python/dup2.c | 30 - Python/dynload_aix.c | 210 - Python/dynload_beos.c | 261 - Python/dynload_dl.c | 35 - Python/dynload_hpux.c | 63 - Python/dynload_mac.c | 123 - Python/dynload_next.c | 178 - Python/dynload_os2.c | 55 - Python/dynload_shlib.c | 100 - Python/dynload_stub.c | 20 - Python/dynload_win.c | 131 - Python/errors.c | 435 - Python/exceptions.c | 1027 - Python/fmod.c | 36 - Python/frozen.c | 40 - Python/frozenmain.c | 86 - Python/getargs.c | 1283 - Python/getcompiler.c | 37 - Python/getcopyright.c | 29 - Python/getcwd.c | 88 - Python/getmtime.c | 36 - Python/getopt.c | 96 - Python/getplatform.c | 21 - Python/getversion.c | 24 - Python/graminit.c | 1568 - Python/hypot.c | 23 - Python/import.c | 2341 - Python/importdl.c | 88 - Python/importdl.h | 60 - Python/marshal.c | 773 - Python/memmove.c | 34 - Python/modsupport.c | 469 - Python/mystrtoul.c | 162 - Python/pyfpe.c | 23 - Python/pystate.c | 226 - Python/pythonmain.c | 211 - Python/pythonrun.c | 1150 - Python/sigcheck.c | 28 - Python/strdup.c | 14 - Python/strerror.c | 32 - Python/strtod.c | 156 - Python/structmember.c | 254 - Python/sysmodule.c | 699 - Python/thread.c | 153 - Python/thread_beos.h | 367 - Python/thread_cthread.h | 199 - Python/thread_foobar.h | 158 - Python/thread_lwp.h | 189 - Python/thread_nt.h | 341 - Python/thread_os2.h | 223 - Python/thread_pth.h | 307 - Python/thread_pthread.h | 442 - Python/thread_sgi.h | 512 - Python/thread_solaris.h | 245 - Python/thread_wince.h | 180 - Python/traceback.c | 249 - README | 843 - Tools/README | 27 - Tools/audiopy/README | 112 - Tools/audiopy/audiopy | 508 - Tools/bgen/README | 7 - Tools/bgen/bgen/bgen.py | 12 - Tools/bgen/bgen/bgenBuffer.py | 255 - Tools/bgen/bgen/bgenGenerator.py | 270 - Tools/bgen/bgen/bgenGeneratorGroup.py | 35 - Tools/bgen/bgen/bgenHeapBuffer.py | 110 - Tools/bgen/bgen/bgenModule.py | 89 - Tools/bgen/bgen/bgenObjectDefinition.py | 261 - Tools/bgen/bgen/bgenOutput.py | 221 - Tools/bgen/bgen/bgenStackBuffer.py | 59 - Tools/bgen/bgen/bgenStringBuffer.py | 64 - Tools/bgen/bgen/bgenType.py | 249 - Tools/bgen/bgen/bgenVariable.py | 88 - Tools/bgen/bgen/bgenlocations.py | 13 - Tools/bgen/bgen/macsupport.py | 144 - Tools/bgen/bgen/scantools.py | 582 - Tools/compiler/compile.py | 28 - Tools/compiler/compiler/__init__.py | 24 - Tools/compiler/compiler/ast.py | 709 - Tools/compiler/compiler/consts.py | 9 - Tools/compiler/compiler/misc.py | 35 - Tools/compiler/compiler/pyassem.py | 541 - Tools/compiler/compiler/pycodegen.py | 822 - Tools/compiler/compiler/transformer.py | 1234 - Tools/compiler/compiler/visitor.py | 117 - Tools/compiler/demo.py | 38 - Tools/faqwiz/README | 113 - Tools/faqwiz/faqconf.py | 577 - Tools/faqwiz/faqcust.py | 1 - Tools/faqwiz/faqw.py | 36 - Tools/faqwiz/faqwiz.py | 841 - Tools/freeze/.cvsignore | 6 - Tools/freeze/README | 173 - Tools/freeze/bkfile.py | 47 - Tools/freeze/checkextensions.py | 91 - Tools/freeze/checkextensions_win32.py | 190 - Tools/freeze/extensions_win32.ini | 170 - Tools/freeze/freeze.py | 457 - Tools/freeze/hello.py | 1 - Tools/freeze/makeconfig.py | 61 - Tools/freeze/makefreeze.py | 86 - Tools/freeze/makemakefile.py | 30 - Tools/freeze/modulefinder.py | 437 - Tools/freeze/parsesetup.py | 98 - Tools/freeze/win32.html | 120 - Tools/freeze/winmakemakefile.py | 146 - Tools/i18n/pygettext.py | 453 - Tools/idle/AutoExpand.py | 92 - Tools/idle/AutoIndent.py | 553 - Tools/idle/Bindings.py | 57 - Tools/idle/BrowserControl.py | 157 - Tools/idle/CallTipWindow.py | 71 - Tools/idle/CallTips.py | 190 - Tools/idle/ChangeLog | 1017 - Tools/idle/ClassBrowser.py | 224 - Tools/idle/ColorDelegator.py | 234 - Tools/idle/Debugger.py | 308 - Tools/idle/Delegator.py | 34 - Tools/idle/EditorWindow.py | 734 - Tools/idle/FileList.py | 142 - Tools/idle/FormatParagraph.py | 155 - Tools/idle/FrameViewer.py | 38 - Tools/idle/GrepDialog.py | 135 - Tools/idle/IOBinding.py | 232 - Tools/idle/Icons/folder.gif | Bin 120 -> 0 bytes Tools/idle/Icons/minusnode.gif | Bin 75 -> 0 bytes Tools/idle/Icons/openfolder.gif | Bin 125 -> 0 bytes Tools/idle/Icons/plusnode.gif | Bin 79 -> 0 bytes Tools/idle/Icons/python.gif | Bin 895 -> 0 bytes Tools/idle/Icons/tk.gif | Bin 85 -> 0 bytes Tools/idle/IdleConf.py | 113 - Tools/idle/IdleHistory.py | 89 - Tools/idle/MultiScrolledLists.py | 138 - Tools/idle/MultiStatusBar.py | 32 - Tools/idle/NEWS.txt | 130 - Tools/idle/ObjectBrowser.py | 151 - Tools/idle/OldStackViewer.py | 276 - Tools/idle/OutputWindow.py | 148 - Tools/idle/ParenMatch.py | 192 - Tools/idle/PathBrowser.py | 95 - Tools/idle/Percolator.py | 85 - Tools/idle/PyParse.py | 570 - Tools/idle/PyShell.py | 767 - Tools/idle/README.txt | 52 - Tools/idle/RemoteInterp.py | 343 - Tools/idle/ReplaceDialog.py | 172 - Tools/idle/ScriptBinding.py | 169 - Tools/idle/ScrolledList.py | 139 - Tools/idle/SearchBinding.py | 97 - Tools/idle/SearchDialog.py | 67 - Tools/idle/SearchDialogBase.py | 129 - Tools/idle/SearchEngine.py | 221 - Tools/idle/Separator.py | 92 - Tools/idle/StackViewer.py | 135 - Tools/idle/TODO.txt | 210 - Tools/idle/ToolTip.py | 87 - Tools/idle/TreeWidget.py | 471 - Tools/idle/UndoDelegator.py | 352 - Tools/idle/WidgetRedirector.py | 92 - Tools/idle/WindowList.py | 85 - Tools/idle/ZoomHeight.py | 46 - Tools/idle/__init__.py | 1 - Tools/idle/config-unix.txt | 3 - Tools/idle/config-win.txt | 3 - Tools/idle/config.txt | 64 - Tools/idle/eventparse.py | 93 - Tools/idle/extend.txt | 106 - Tools/idle/help.txt | 155 - Tools/idle/idle.bat | 3 - Tools/idle/idle.py | 12 - Tools/idle/idle.pyw | 8 - Tools/idle/idlever.py | 1 - Tools/idle/keydefs.py | 55 - Tools/idle/testcode.py | 31 - Tools/modulator/EXAMPLE.py | 53 - Tools/modulator/README | 25 - Tools/modulator/ScrolledListbox.py | 37 - Tools/modulator/Templates/copyright | 9 - Tools/modulator/Templates/module_head | 6 - Tools/modulator/Templates/module_method | 16 - Tools/modulator/Templates/module_tail | 37 - Tools/modulator/Templates/object_head | 13 - Tools/modulator/Templates/object_method | 16 - Tools/modulator/Templates/object_mlist | 8 - Tools/modulator/Templates/object_new | 13 - Tools/modulator/Templates/object_structure | 42 - Tools/modulator/Templates/object_tail | 33 - Tools/modulator/Templates/object_tp_as_mapping | 34 - Tools/modulator/Templates/object_tp_as_number | 206 - Tools/modulator/Templates/object_tp_as_sequence | 73 - Tools/modulator/Templates/object_tp_call | 10 - Tools/modulator/Templates/object_tp_compare | 7 - Tools/modulator/Templates/object_tp_dealloc | 8 - Tools/modulator/Templates/object_tp_getattr | 9 - Tools/modulator/Templates/object_tp_hash | 7 - Tools/modulator/Templates/object_tp_print | 10 - Tools/modulator/Templates/object_tp_repr | 10 - Tools/modulator/Templates/object_tp_setattr | 12 - Tools/modulator/Templates/object_tp_str | 11 - Tools/modulator/Tkextra.py | 235 - Tools/modulator/genmodule.py | 161 - Tools/modulator/modulator.py | 380 - Tools/modulator/varsubst.py | 61 - Tools/pynche/ChipViewer.py | 109 - Tools/pynche/ColorDB.py | 289 - Tools/pynche/DetailsViewer.py | 273 - Tools/pynche/ListViewer.py | 176 - Tools/pynche/Main.py | 222 - Tools/pynche/PyncheWidget.py | 310 - Tools/pynche/README | 377 - Tools/pynche/StripViewer.py | 432 - Tools/pynche/Switchboard.py | 138 - Tools/pynche/TextViewer.py | 187 - Tools/pynche/TypeinViewer.py | 139 - Tools/pynche/X/rgb.txt | 753 - Tools/pynche/X/xlicense.txt | 29 - Tools/pynche/__init__.py | 1 - Tools/pynche/html40colors.txt | 17 - Tools/pynche/namedcolors.txt | 100 - Tools/pynche/pyColorChooser.py | 122 - Tools/pynche/pynche | 7 - Tools/pynche/pynche.pyw | 7 - Tools/pynche/webcolors.txt | 141 - Tools/pynche/websafe.txt | 217 - Tools/scripts/README | 47 - Tools/scripts/byteyears.py | 57 - Tools/scripts/checkappend.py | 168 - Tools/scripts/checkpyc.py | 65 - Tools/scripts/classfix.py | 192 - Tools/scripts/copytime.py | 25 - Tools/scripts/crlf.py | 19 - Tools/scripts/cvsfiles.py | 72 - Tools/scripts/dutree.doc | 54 - Tools/scripts/dutree.py | 59 - Tools/scripts/eptags.py | 50 - Tools/scripts/findlinksto.py | 42 - Tools/scripts/fixcid.py | 318 - Tools/scripts/fixheader.py | 49 - Tools/scripts/fixnotice.py | 63 - Tools/scripts/fixps.py | 33 - Tools/scripts/ftpmirror.py | 395 - Tools/scripts/gencodec.py | 289 - Tools/scripts/h2py.py | 150 - Tools/scripts/ifdef.py | 113 - Tools/scripts/lfcr.py | 19 - Tools/scripts/linktree.py | 79 - Tools/scripts/lll.py | 25 - Tools/scripts/logmerge.py | 135 - Tools/scripts/mailerdaemon.py | 238 - Tools/scripts/methfix.py | 173 - Tools/scripts/mkreal.py | 65 - Tools/scripts/ndiff.py | 629 - Tools/scripts/nm2def.py | 103 - Tools/scripts/objgraph.py | 215 - Tools/scripts/parseentities.py | 65 - Tools/scripts/pathfix.py | 149 - Tools/scripts/pdeps.py | 167 - Tools/scripts/pindent.py | 543 - Tools/scripts/ptags.py | 50 - Tools/scripts/rgrep.py | 65 - Tools/scripts/suff.py | 29 - Tools/scripts/sum5.py | 97 - Tools/scripts/texi2html.py | 1613 - Tools/scripts/trace.py | 661 - Tools/scripts/treesync.py | 204 - Tools/scripts/untabify.py | 53 - Tools/scripts/which.py | 56 - Tools/scripts/xxci.py | 117 - Tools/versioncheck/README | 41 - Tools/versioncheck/_checkversion.py | 16 - Tools/versioncheck/checkversions.py | 55 - Tools/versioncheck/pyversioncheck.py | 101 - Tools/webchecker/README | 20 - Tools/webchecker/tktools.py | 367 - Tools/webchecker/wcgui.py | 464 - Tools/webchecker/wcmac.py | 7 - Tools/webchecker/webchecker.py | 824 - Tools/webchecker/websucker.py | 126 - Tools/webchecker/wsgui.py | 243 - Tools/world/README | 85 - Tools/world/world | 546 - acconfig.h | 175 - config.h.in | 606 - configure | 6103 -- configure.in | 1172 - install-sh | 120 - 2638 files changed, 686896 deletions(-) delete mode 100644 .cvsignore delete mode 100644 BeOS/README delete mode 100644 BeOS/README.readline-2.2 delete mode 100755 BeOS/ar-fake delete mode 100644 BeOS/dl_export.h delete mode 100755 BeOS/linkcc delete mode 100755 BeOS/linkmodule delete mode 100644 Demo/Makefile delete mode 100644 Demo/README delete mode 100755 Demo/classes/Complex.py delete mode 100755 Demo/classes/Dates.py delete mode 100755 Demo/classes/Dbm.py delete mode 100644 Demo/classes/README delete mode 100755 Demo/classes/Range.py delete mode 100755 Demo/classes/Rat.py delete mode 100755 Demo/classes/Rev.py delete mode 100755 Demo/classes/Vec.py delete mode 100755 Demo/classes/bitvec.py delete mode 100755 Demo/classes/class.doc delete mode 100644 Demo/comparisons/README delete mode 100755 Demo/comparisons/patterns delete mode 100755 Demo/comparisons/regextest.py delete mode 100755 Demo/comparisons/sortingtest.py delete mode 100755 Demo/comparisons/systemtest.py delete mode 100644 Demo/dns/README delete mode 100755 Demo/dns/asgethost.py delete mode 100755 Demo/dns/dnsclass.py delete mode 100755 Demo/dns/dnslib.py delete mode 100755 Demo/dns/dnsopcode.py delete mode 100755 Demo/dns/dnstype.py delete mode 100644 Demo/embed/Makefile delete mode 100644 Demo/embed/README delete mode 100644 Demo/embed/demo.c delete mode 100644 Demo/extend/README delete mode 100755 Demo/extend/make_clean delete mode 100755 Demo/extend/make_shared delete mode 100755 Demo/extend/make_static delete mode 100644 Demo/imputil/importers.py delete mode 100644 Demo/md5test/README delete mode 100755 Demo/md5test/foo delete mode 100755 Demo/md5test/md5driver.py delete mode 100644 Demo/metaclasses/Eiffel.py delete mode 100644 Demo/metaclasses/Enum.py delete mode 100644 Demo/metaclasses/Meta.py delete mode 100644 Demo/metaclasses/Simple.py delete mode 100644 Demo/metaclasses/Synch.py delete mode 100644 Demo/metaclasses/Trace.py delete mode 100644 Demo/metaclasses/index.html delete mode 100644 Demo/metaclasses/meta-vladimir.txt delete mode 100644 Demo/parser/FILES delete mode 100644 Demo/parser/Makefile delete mode 100644 Demo/parser/README delete mode 100644 Demo/parser/docstring.py delete mode 100644 Demo/parser/example.py delete mode 100644 Demo/parser/parser.tex delete mode 100644 Demo/parser/simple.py delete mode 100644 Demo/parser/source.py delete mode 100755 Demo/parser/test_parser.py delete mode 100644 Demo/parser/texipre.dat delete mode 100755 Demo/pdist/FSProxy.py delete mode 100755 Demo/pdist/RCSProxy.py delete mode 100644 Demo/pdist/README delete mode 100755 Demo/pdist/client.py delete mode 100755 Demo/pdist/cmdfw.py delete mode 100755 Demo/pdist/cmptree.py delete mode 100755 Demo/pdist/cvslib.py delete mode 100755 Demo/pdist/cvslock.py delete mode 100755 Demo/pdist/mac.py delete mode 100755 Demo/pdist/makechangelog.py delete mode 100755 Demo/pdist/new delete mode 100755 Demo/pdist/rcsbump delete mode 100755 Demo/pdist/rcsclient.py delete mode 100755 Demo/pdist/rcslib.py delete mode 100755 Demo/pdist/rcvs delete mode 100755 Demo/pdist/rcvs.py delete mode 100755 Demo/pdist/rrcs delete mode 100755 Demo/pdist/rrcs.py delete mode 100755 Demo/pdist/security.py delete mode 100755 Demo/pdist/server.py delete mode 100755 Demo/pdist/sumtree.py delete mode 100644 Demo/pysvr/Makefile delete mode 100644 Demo/pysvr/README delete mode 100644 Demo/pysvr/pysvr.c delete mode 100755 Demo/pysvr/pysvr.py delete mode 100644 Demo/rpc/MANIFEST delete mode 100644 Demo/rpc/README delete mode 100644 Demo/rpc/T.py delete mode 100644 Demo/rpc/mountclient.py delete mode 100644 Demo/rpc/nfsclient.py delete mode 100644 Demo/rpc/rnusersclient.py delete mode 100644 Demo/rpc/rpc.py delete mode 100755 Demo/rpc/test delete mode 100644 Demo/rpc/xdr.py delete mode 100644 Demo/scripts/README delete mode 100644 Demo/scripts/beer.py delete mode 100755 Demo/scripts/eqfix.py delete mode 100755 Demo/scripts/fact.py delete mode 100755 Demo/scripts/freeze.py delete mode 100755 Demo/scripts/from.py delete mode 100755 Demo/scripts/ftpstats.py delete mode 100755 Demo/scripts/lpwatch.py delete mode 100755 Demo/scripts/makedir.py delete mode 100755 Demo/scripts/markov.py delete mode 100755 Demo/scripts/mboxconvert.py delete mode 100755 Demo/scripts/mkrcs.py delete mode 100755 Demo/scripts/morse.py delete mode 100755 Demo/scripts/mpzpi.py delete mode 100755 Demo/scripts/newslist.doc delete mode 100755 Demo/scripts/newslist.py delete mode 100755 Demo/scripts/pi.py delete mode 100755 Demo/scripts/pp.py delete mode 100755 Demo/scripts/primes.py delete mode 100755 Demo/scripts/script.py delete mode 100755 Demo/scripts/unbirthday.py delete mode 100755 Demo/scripts/update.py delete mode 100755 Demo/scripts/wh.py delete mode 100644 Demo/sgi/README delete mode 100644 Demo/sgi/al/.cvsignore delete mode 100644 Demo/sgi/al/README delete mode 100755 Demo/sgi/al/alwatch.py delete mode 100755 Demo/sgi/al/broadcast.py delete mode 100755 Demo/sgi/al/cmpaf.py delete mode 100755 Demo/sgi/al/cmpaf_form.fd delete mode 100755 Demo/sgi/al/intercom.py delete mode 100755 Demo/sgi/al/listen.py delete mode 100755 Demo/sgi/al/names.py delete mode 100755 Demo/sgi/al/playaiff.py delete mode 100755 Demo/sgi/al/playback.py delete mode 100755 Demo/sgi/al/playold.py delete mode 100755 Demo/sgi/al/radio.py delete mode 100755 Demo/sgi/al/rec_play.py delete mode 100755 Demo/sgi/al/record.py delete mode 100755 Demo/sgi/al/unicast.py delete mode 100755 Demo/sgi/al/x.py delete mode 100644 Demo/sgi/audio/README delete mode 100755 Demo/sgi/audio/play.py delete mode 100755 Demo/sgi/cd/CD.doc delete mode 100644 Demo/sgi/cd/README delete mode 100755 Demo/sgi/cd/cdaiff.py delete mode 100755 Demo/sgi/cd/listcd.py delete mode 100755 Demo/sgi/cd/playcd.py delete mode 100755 Demo/sgi/cd/recvcd.py delete mode 100755 Demo/sgi/cd/sendcd.py delete mode 100644 Demo/sgi/flp/.cvsignore delete mode 100755 Demo/sgi/flp/tcache.fd delete mode 100755 Demo/sgi/flp/tcache.py delete mode 100755 Demo/sgi/flp/test_cb.fd delete mode 100755 Demo/sgi/flp/test_cb.py delete mode 100755 Demo/sgi/flp/test_nocb.fd delete mode 100755 Demo/sgi/flp/test_nocb.py delete mode 100644 Demo/sgi/gl/README delete mode 100755 Demo/sgi/gl/backface.py delete mode 100755 Demo/sgi/gl/glinfo.py delete mode 100755 Demo/sgi/gl/kites.py delete mode 100755 Demo/sgi/gl/kunst.py delete mode 100755 Demo/sgi/gl/mclock.doc delete mode 100755 Demo/sgi/gl/mclock.py delete mode 100755 Demo/sgi/gl/mixing.py delete mode 100755 Demo/sgi/gl/nurbs.py delete mode 100755 Demo/sgi/gl/zrgb.py delete mode 100644 Demo/sgi/sv/README delete mode 100755 Demo/sgi/sv/burstcapt.py delete mode 100755 Demo/sgi/sv/contcapt.py delete mode 100755 Demo/sgi/sv/rgbgrab.py delete mode 100755 Demo/sgi/sv/simpleinput.py delete mode 100755 Demo/sgi/video/.cvsignore delete mode 100755 Demo/sgi/video/DisplayVideoIn.py delete mode 100755 Demo/sgi/video/Dsend.py delete mode 100755 Demo/sgi/video/IN.py delete mode 100755 Demo/sgi/video/LiveVideoIn.py delete mode 100755 Demo/sgi/video/LiveVideoOut.py delete mode 100755 Demo/sgi/video/Makefile delete mode 100755 Demo/sgi/video/OldVcopy.py delete mode 100644 Demo/sgi/video/README delete mode 100755 Demo/sgi/video/VCR.py delete mode 100755 Demo/sgi/video/VFile.py delete mode 100755 Demo/sgi/video/VGrabber.py delete mode 100755 Demo/sgi/video/Vaddcache.py delete mode 100755 Demo/sgi/video/Vb.py delete mode 100644 Demo/sgi/video/VbForm.fd delete mode 100755 Demo/sgi/video/Vcopy.py delete mode 100755 Demo/sgi/video/VcrIndex.py delete mode 100755 Demo/sgi/video/Vedit.py delete mode 100644 Demo/sgi/video/VeditForm.fd delete mode 100755 Demo/sgi/video/Vfix.py delete mode 100755 Demo/sgi/video/Vgeneric.py delete mode 100755 Demo/sgi/video/Viewer.py delete mode 100755 Demo/sgi/video/Vinfo.py delete mode 100755 Demo/sgi/video/Vmkjpeg.py delete mode 100755 Demo/sgi/video/Vplay.py delete mode 100755 Demo/sgi/video/Vrec.py delete mode 100755 Demo/sgi/video/Vrecb.py delete mode 100755 Demo/sgi/video/Vrecc.py delete mode 100755 Demo/sgi/video/Vreceive.py delete mode 100755 Demo/sgi/video/Vsend.py delete mode 100755 Demo/sgi/video/Vstat.py delete mode 100755 Demo/sgi/video/Vtime.py delete mode 100755 Demo/sgi/video/Vunjpeg.py delete mode 100755 Demo/sgi/video/aplay.py delete mode 100755 Demo/sgi/video/cam.py delete mode 100755 Demo/sgi/video/camcorder.py delete mode 100755 Demo/sgi/video/cmif-film.ms delete mode 100755 Demo/sgi/video/colorsys.py delete mode 100755 Demo/sgi/video/i2v.c delete mode 100755 Demo/sgi/video/imgconv.py delete mode 100755 Demo/sgi/video/makemovie.py delete mode 100755 Demo/sgi/video/rgb2video.py delete mode 100755 Demo/sgi/video/senddefs.py delete mode 100755 Demo/sgi/video/squash.c delete mode 100755 Demo/sgi/video/squash2.c delete mode 100755 Demo/sgi/video/statit.py delete mode 100755 Demo/sgi/video/svgrab24.c delete mode 100755 Demo/sgi/video/syncaudio.py delete mode 100755 Demo/sgi/video/tomono.c delete mode 100755 Demo/sgi/video/tv.py delete mode 100755 Demo/sgi/video/v2i.c delete mode 100755 Demo/sgi/video/vcopy.py delete mode 100755 Demo/sgi/video/video.doc delete mode 100755 Demo/sgi/video/video.py delete mode 100755 Demo/sgi/video/video2rgb.py delete mode 100755 Demo/sgi/video/vinfo.py delete mode 100755 Demo/sgi/video/vpregs.py delete mode 100755 Demo/sgi/video/vtime.py delete mode 100755 Demo/sgi/video/watchcursor.py delete mode 100755 Demo/sockets/ChangeLog delete mode 100644 Demo/sockets/README delete mode 100755 Demo/sockets/broadcast.py delete mode 100755 Demo/sockets/echosvr.py delete mode 100755 Demo/sockets/finger.py delete mode 100755 Demo/sockets/ftp.py delete mode 100755 Demo/sockets/gopher.py delete mode 100755 Demo/sockets/mcast.py delete mode 100755 Demo/sockets/radio.py delete mode 100755 Demo/sockets/rpython.py delete mode 100755 Demo/sockets/rpythond.py delete mode 100755 Demo/sockets/telnet.py delete mode 100755 Demo/sockets/throughput.py delete mode 100755 Demo/sockets/udpecho.py delete mode 100644 Demo/sockets/unicast.py delete mode 100644 Demo/sockets/unixclient.py delete mode 100644 Demo/sockets/unixserver.py delete mode 100644 Demo/threads/Generator.py delete mode 100644 Demo/threads/README delete mode 100644 Demo/threads/bug.py delete mode 100644 Demo/threads/find.py delete mode 100644 Demo/threads/sync.py delete mode 100644 Demo/threads/telnet.py delete mode 100644 Demo/tkinter/README delete mode 100644 Demo/tkinter/Tree.py delete mode 100755 Demo/tkinter/guido/AttrDialog.py delete mode 100755 Demo/tkinter/guido/ManPage.py delete mode 100755 Demo/tkinter/guido/MimeViewer.py delete mode 100755 Demo/tkinter/guido/ShellWindow.py delete mode 100644 Demo/tkinter/guido/brownian.py delete mode 100644 Demo/tkinter/guido/canvasevents.py delete mode 100755 Demo/tkinter/guido/dialog.py delete mode 100755 Demo/tkinter/guido/electrons.py delete mode 100755 Demo/tkinter/guido/hanoi.py delete mode 100755 Demo/tkinter/guido/hello.py delete mode 100755 Demo/tkinter/guido/imagedraw.py delete mode 100755 Demo/tkinter/guido/imageview.py delete mode 100755 Demo/tkinter/guido/kill.py delete mode 100755 Demo/tkinter/guido/listtree.py delete mode 100755 Demo/tkinter/guido/mbox.py delete mode 100644 Demo/tkinter/guido/newmenubardemo.py delete mode 100644 Demo/tkinter/guido/optionmenu.py delete mode 100644 Demo/tkinter/guido/paint.py delete mode 100644 Demo/tkinter/guido/redemo.py delete mode 100644 Demo/tkinter/guido/regexdemo.py delete mode 100755 Demo/tkinter/guido/rmt.py delete mode 100755 Demo/tkinter/guido/solitaire.py delete mode 100644 Demo/tkinter/guido/sortvisu.py delete mode 100755 Demo/tkinter/guido/svkill.py delete mode 100644 Demo/tkinter/guido/switch.py delete mode 100755 Demo/tkinter/guido/tkman.py delete mode 100755 Demo/tkinter/guido/wish.py delete mode 100644 Demo/tkinter/matt/00-HELLO-WORLD.py delete mode 100644 Demo/tkinter/matt/README delete mode 100644 Demo/tkinter/matt/animation-simple.py delete mode 100644 Demo/tkinter/matt/animation-w-velocity-ctrl.py delete mode 100644 Demo/tkinter/matt/bind-w-mult-calls-p-type.py delete mode 100644 Demo/tkinter/matt/canvas-demo-simple.py delete mode 100644 Demo/tkinter/matt/canvas-gridding.py delete mode 100644 Demo/tkinter/matt/canvas-moving-or-creating.py delete mode 100644 Demo/tkinter/matt/canvas-moving-w-mouse.py delete mode 100644 Demo/tkinter/matt/canvas-mult-item-sel.py delete mode 100644 Demo/tkinter/matt/canvas-reading-tag-info.py delete mode 100644 Demo/tkinter/matt/canvas-w-widget-draw-el.py delete mode 100644 Demo/tkinter/matt/canvas-with-scrollbars.py delete mode 100644 Demo/tkinter/matt/dialog-box.py delete mode 100644 Demo/tkinter/matt/entry-simple.py delete mode 100644 Demo/tkinter/matt/entry-with-shared-variable.py delete mode 100644 Demo/tkinter/matt/killing-window-w-wm.py delete mode 100644 Demo/tkinter/matt/menu-all-types-of-entries.py delete mode 100644 Demo/tkinter/matt/menu-simple.py delete mode 100644 Demo/tkinter/matt/not-what-you-might-think-1.py delete mode 100644 Demo/tkinter/matt/not-what-you-might-think-2.py delete mode 100644 Demo/tkinter/matt/packer-and-placer-together.py delete mode 100644 Demo/tkinter/matt/packer-simple.py delete mode 100644 Demo/tkinter/matt/placer-simple.py delete mode 100644 Demo/tkinter/matt/pong-demo-1.py delete mode 100644 Demo/tkinter/matt/printing-coords-of-items.py delete mode 100644 Demo/tkinter/matt/radiobutton-simple.py delete mode 100644 Demo/tkinter/matt/rubber-band-box-demo-1.py delete mode 100644 Demo/tkinter/matt/rubber-line-demo-1.py delete mode 100644 Demo/tkinter/matt/slider-demo-1.py delete mode 100644 Demo/tkinter/matt/subclass-existing-widgets.py delete mode 100644 Demo/tkinter/matt/two-radio-groups.py delete mode 100644 Demo/tkinter/matt/window-creation-more.py delete mode 100644 Demo/tkinter/matt/window-creation-simple.py delete mode 100644 Demo/tkinter/matt/window-creation-w-location.py delete mode 100755 Demo/zlib/minigzip.py delete mode 100755 Demo/zlib/zlibdemo.py delete mode 100755 Doc/.cvsignore delete mode 100644 Doc/Makefile delete mode 100644 Doc/Makefile.deps delete mode 100644 Doc/README delete mode 100644 Doc/TODO delete mode 100644 Doc/api/.cvsignore delete mode 100644 Doc/api/api.tex delete mode 100644 Doc/api/refcounts.dat delete mode 100644 Doc/doc/doc.tex delete mode 100644 Doc/ext/.cvsignore delete mode 100644 Doc/ext/ext.tex delete mode 100644 Doc/html/.cvsignore delete mode 100644 Doc/html/Makefile delete mode 100644 Doc/html/about.dat delete mode 100644 Doc/html/icons/blank.gif delete mode 100644 Doc/html/icons/blank.png delete mode 100644 Doc/html/icons/contents.gif delete mode 100644 Doc/html/icons/contents.png delete mode 100644 Doc/html/icons/index.gif delete mode 100644 Doc/html/icons/index.png delete mode 100644 Doc/html/icons/modules.gif delete mode 100644 Doc/html/icons/modules.png delete mode 100644 Doc/html/icons/next.gif delete mode 100644 Doc/html/icons/next.png delete mode 100644 Doc/html/icons/previous.gif delete mode 100644 Doc/html/icons/previous.png delete mode 100644 Doc/html/icons/up.gif delete mode 100644 Doc/html/icons/up.png delete mode 100644 Doc/html/index.html.in delete mode 100644 Doc/html/stdabout.dat delete mode 100644 Doc/html/style.css delete mode 100644 Doc/info/.cvsignore delete mode 100644 Doc/info/Makefile delete mode 100644 Doc/info/README delete mode 100644 Doc/info/python.dir delete mode 100644 Doc/lib/.cvsignore delete mode 100644 Doc/lib/internet.tex delete mode 100644 Doc/lib/language.tex delete mode 100644 Doc/lib/lib.tex delete mode 100644 Doc/lib/libaifc.tex delete mode 100644 Doc/lib/libal.tex delete mode 100644 Doc/lib/liballos.tex delete mode 100644 Doc/lib/libamoeba.tex delete mode 100644 Doc/lib/libanydbm.tex delete mode 100644 Doc/lib/libarray.tex delete mode 100644 Doc/lib/libascii.tex delete mode 100644 Doc/lib/libasyncore.tex delete mode 100644 Doc/lib/libatexit.tex delete mode 100644 Doc/lib/libaudioop.tex delete mode 100644 Doc/lib/libbase64.tex delete mode 100644 Doc/lib/libbasehttp.tex delete mode 100644 Doc/lib/libbastion.tex delete mode 100644 Doc/lib/libbinascii.tex delete mode 100644 Doc/lib/libbinhex.tex delete mode 100644 Doc/lib/libbisect.tex delete mode 100644 Doc/lib/libbltin.tex delete mode 100644 Doc/lib/libbsddb.tex delete mode 100644 Doc/lib/libcalendar.tex delete mode 100644 Doc/lib/libcd.tex delete mode 100644 Doc/lib/libcfgparser.tex delete mode 100644 Doc/lib/libcgi.tex delete mode 100644 Doc/lib/libcgihttp.tex delete mode 100644 Doc/lib/libchunk.tex delete mode 100644 Doc/lib/libcmath.tex delete mode 100644 Doc/lib/libcmd.tex delete mode 100644 Doc/lib/libcmp.tex delete mode 100644 Doc/lib/libcmpcache.tex delete mode 100644 Doc/lib/libcode.tex delete mode 100644 Doc/lib/libcodecs.tex delete mode 100644 Doc/lib/libcodeop.tex delete mode 100644 Doc/lib/libcolorsys.tex delete mode 100644 Doc/lib/libcommands.tex delete mode 100644 Doc/lib/libcompileall.tex delete mode 100644 Doc/lib/libcopy.tex delete mode 100644 Doc/lib/libcopyreg.tex delete mode 100644 Doc/lib/libcrypt.tex delete mode 100644 Doc/lib/libcrypto.tex delete mode 100644 Doc/lib/libcurses.tex delete mode 100644 Doc/lib/libdbhash.tex delete mode 100644 Doc/lib/libdbm.tex delete mode 100644 Doc/lib/libdircache.tex delete mode 100644 Doc/lib/libdis.tex delete mode 100644 Doc/lib/libdl.tex delete mode 100644 Doc/lib/liberrno.tex delete mode 100644 Doc/lib/libexcs.tex delete mode 100644 Doc/lib/libfcntl.tex delete mode 100644 Doc/lib/libfilecmp.tex delete mode 100644 Doc/lib/libfileinput.tex delete mode 100644 Doc/lib/libfl.tex delete mode 100644 Doc/lib/libfm.tex delete mode 100644 Doc/lib/libfnmatch.tex delete mode 100644 Doc/lib/libformatter.tex delete mode 100644 Doc/lib/libfpformat.tex delete mode 100644 Doc/lib/libftplib.tex delete mode 100644 Doc/lib/libfuncs.tex delete mode 100644 Doc/lib/libgc.tex delete mode 100644 Doc/lib/libgdbm.tex delete mode 100644 Doc/lib/libgetopt.tex delete mode 100644 Doc/lib/libgetpass.tex delete mode 100644 Doc/lib/libgl.tex delete mode 100644 Doc/lib/libglob.tex delete mode 100644 Doc/lib/libgopherlib.tex delete mode 100644 Doc/lib/libgrp.tex delete mode 100644 Doc/lib/libgzip.tex delete mode 100644 Doc/lib/libhtmllib.tex delete mode 100644 Doc/lib/libhttplib.tex delete mode 100644 Doc/lib/libimageop.tex delete mode 100644 Doc/lib/libimaplib.tex delete mode 100644 Doc/lib/libimgfile.tex delete mode 100644 Doc/lib/libimghdr.tex delete mode 100644 Doc/lib/libimp.tex delete mode 100644 Doc/lib/libintro.tex delete mode 100644 Doc/lib/libjpeg.tex delete mode 100644 Doc/lib/libkeyword.tex delete mode 100644 Doc/lib/liblinecache.tex delete mode 100644 Doc/lib/liblocale.tex delete mode 100644 Doc/lib/libmailbox.tex delete mode 100644 Doc/lib/libmailcap.tex delete mode 100644 Doc/lib/libmain.tex delete mode 100644 Doc/lib/libmarshal.tex delete mode 100644 Doc/lib/libmath.tex delete mode 100644 Doc/lib/libmd5.tex delete mode 100644 Doc/lib/libmhlib.tex delete mode 100644 Doc/lib/libmimetools.tex delete mode 100644 Doc/lib/libmimetypes.tex delete mode 100644 Doc/lib/libmimewriter.tex delete mode 100644 Doc/lib/libmimify.tex delete mode 100644 Doc/lib/libmisc.tex delete mode 100644 Doc/lib/libmm.tex delete mode 100644 Doc/lib/libmmap.tex delete mode 100644 Doc/lib/libmpz.tex delete mode 100644 Doc/lib/libmsvcrt.tex delete mode 100644 Doc/lib/libmultifile.tex delete mode 100644 Doc/lib/libmutex.tex delete mode 100644 Doc/lib/libnetrc.tex delete mode 100644 Doc/lib/libnew.tex delete mode 100644 Doc/lib/libni.tex delete mode 100644 Doc/lib/libnis.tex delete mode 100644 Doc/lib/libnntplib.tex delete mode 100644 Doc/lib/libobjs.tex delete mode 100644 Doc/lib/liboperator.tex delete mode 100644 Doc/lib/libos.tex delete mode 100644 Doc/lib/libpanel.tex delete mode 100644 Doc/lib/libparser.tex delete mode 100644 Doc/lib/libpdb.tex delete mode 100644 Doc/lib/libpickle.tex delete mode 100644 Doc/lib/libpipes.tex delete mode 100644 Doc/lib/libpopen2.tex delete mode 100644 Doc/lib/libpoplib.tex delete mode 100644 Doc/lib/libposix.tex delete mode 100644 Doc/lib/libposixfile.tex delete mode 100644 Doc/lib/libposixpath.tex delete mode 100644 Doc/lib/libpprint.tex delete mode 100644 Doc/lib/libprofile.tex delete mode 100644 Doc/lib/libpty.tex delete mode 100644 Doc/lib/libpwd.tex delete mode 100644 Doc/lib/libpyclbr.tex delete mode 100644 Doc/lib/libpycompile.tex delete mode 100644 Doc/lib/libpyexpat.tex delete mode 100644 Doc/lib/libpython.tex delete mode 100644 Doc/lib/libqueue.tex delete mode 100644 Doc/lib/libquopri.tex delete mode 100644 Doc/lib/librand.tex delete mode 100644 Doc/lib/librandom.tex delete mode 100644 Doc/lib/libre.tex delete mode 100644 Doc/lib/libreadline.tex delete mode 100644 Doc/lib/libregex.tex delete mode 100644 Doc/lib/libregsub.tex delete mode 100644 Doc/lib/librepr.tex delete mode 100644 Doc/lib/libresource.tex delete mode 100644 Doc/lib/librestricted.tex delete mode 100644 Doc/lib/librexec.tex delete mode 100644 Doc/lib/librfc822.tex delete mode 100644 Doc/lib/librgbimg.tex delete mode 100644 Doc/lib/librlcompleter.tex delete mode 100644 Doc/lib/librobotparser.tex delete mode 100644 Doc/lib/librotor.tex delete mode 100644 Doc/lib/libsched.tex delete mode 100644 Doc/lib/libselect.tex delete mode 100644 Doc/lib/libsgi.tex delete mode 100644 Doc/lib/libsgmllib.tex delete mode 100644 Doc/lib/libsha.tex delete mode 100644 Doc/lib/libshelve.tex delete mode 100644 Doc/lib/libshlex.tex delete mode 100644 Doc/lib/libshutil.tex delete mode 100644 Doc/lib/libsignal.tex delete mode 100644 Doc/lib/libsimplehttp.tex delete mode 100644 Doc/lib/libsite.tex delete mode 100644 Doc/lib/libsmtplib.tex delete mode 100644 Doc/lib/libsndhdr.tex delete mode 100644 Doc/lib/libsocket.tex delete mode 100644 Doc/lib/libsocksvr.tex delete mode 100644 Doc/lib/libsomeos.tex delete mode 100644 Doc/lib/libsoundex.tex delete mode 100644 Doc/lib/libstat.tex delete mode 100644 Doc/lib/libstatcache.tex delete mode 100644 Doc/lib/libstatvfs.tex delete mode 100644 Doc/lib/libstdtypes.tex delete mode 100644 Doc/lib/libstdwin.tex delete mode 100644 Doc/lib/libstring.tex delete mode 100644 Doc/lib/libstringio.tex delete mode 100644 Doc/lib/libstrings.tex delete mode 100644 Doc/lib/libstruct.tex delete mode 100644 Doc/lib/libsun.tex delete mode 100644 Doc/lib/libsunau.tex delete mode 100644 Doc/lib/libsunaudio.tex delete mode 100644 Doc/lib/libsymbol.tex delete mode 100644 Doc/lib/libsys.tex delete mode 100644 Doc/lib/libsyslog.tex delete mode 100644 Doc/lib/libtabnanny.tex delete mode 100644 Doc/lib/libtelnetlib.tex delete mode 100644 Doc/lib/libtempfile.tex delete mode 100644 Doc/lib/libtermios.tex delete mode 100644 Doc/lib/libthread.tex delete mode 100644 Doc/lib/libthreading.tex delete mode 100644 Doc/lib/libtime.tex delete mode 100644 Doc/lib/libtoken.tex delete mode 100644 Doc/lib/libtokenize.tex delete mode 100644 Doc/lib/libtraceback.tex delete mode 100644 Doc/lib/libtty.tex delete mode 100644 Doc/lib/libturtle.tex delete mode 100644 Doc/lib/libtypes.tex delete mode 100644 Doc/lib/libundoc.tex delete mode 100644 Doc/lib/libunicodedata.tex delete mode 100644 Doc/lib/libunix.tex delete mode 100644 Doc/lib/liburllib.tex delete mode 100644 Doc/lib/liburlparse.tex delete mode 100644 Doc/lib/libuser.tex delete mode 100644 Doc/lib/libuserdict.tex delete mode 100644 Doc/lib/libuu.tex delete mode 100644 Doc/lib/libwave.tex delete mode 100644 Doc/lib/libwebbrowser.tex delete mode 100644 Doc/lib/libwhichdb.tex delete mode 100644 Doc/lib/libwhrandom.tex delete mode 100644 Doc/lib/libwinreg.tex delete mode 100644 Doc/lib/libwinsound.tex delete mode 100644 Doc/lib/libxdrlib.tex delete mode 100644 Doc/lib/libxmllib.tex delete mode 100644 Doc/lib/libzipfile.tex delete mode 100644 Doc/lib/libzlib.tex delete mode 100644 Doc/lib/markup.tex delete mode 100644 Doc/lib/netdata.tex delete mode 100644 Doc/lib/windows.tex delete mode 100755 Doc/libmods.tex delete mode 100755 Doc/libstd.tex delete mode 100644 Doc/longhtml/.cvsignore delete mode 100644 Doc/longhtml/Makefile delete mode 100644 Doc/longhtml/README delete mode 100644 Doc/mac/.cvsignore delete mode 100644 Doc/mac/libctb.tex delete mode 100644 Doc/mac/libframework.tex delete mode 100644 Doc/mac/libmac.tex delete mode 100644 Doc/mac/libmacconsole.tex delete mode 100644 Doc/mac/libmacdnr.tex delete mode 100644 Doc/mac/libmacfs.tex delete mode 100644 Doc/mac/libmacic.tex delete mode 100644 Doc/mac/libmacos.tex delete mode 100644 Doc/mac/libmacostools.tex delete mode 100644 Doc/mac/libmacspeech.tex delete mode 100644 Doc/mac/libmactcp.tex delete mode 100644 Doc/mac/libmacui.tex delete mode 100644 Doc/mac/libminiae.tex delete mode 100644 Doc/mac/mac.tex delete mode 100644 Doc/paper-a4/.cvsignore delete mode 100644 Doc/paper-a4/Makefile delete mode 100644 Doc/paper-a4/pypaper.sty delete mode 100644 Doc/paper-letter/.cvsignore delete mode 100644 Doc/paper-letter/Makefile delete mode 100644 Doc/perl/SynopsisTable.pm delete mode 100644 Doc/perl/distutils.perl delete mode 100644 Doc/perl/howto.perl delete mode 100644 Doc/perl/l2hinit.perl delete mode 100644 Doc/perl/ltxmarkup.perl delete mode 100644 Doc/perl/manual.perl delete mode 100644 Doc/perl/python.perl delete mode 100644 Doc/ref/.cvsignore delete mode 100644 Doc/ref/ref.tex delete mode 100644 Doc/ref/ref1.tex delete mode 100644 Doc/ref/ref2.tex delete mode 100644 Doc/ref/ref3.tex delete mode 100644 Doc/ref/ref4.tex delete mode 100644 Doc/ref/ref5.tex delete mode 100644 Doc/ref/ref6.tex delete mode 100644 Doc/ref/ref7.tex delete mode 100644 Doc/ref/ref8.tex delete mode 100644 Doc/ref/reswords.py delete mode 100644 Doc/sgml/catalog delete mode 100644 Doc/sgml/iso/ISOamsa delete mode 100644 Doc/sgml/iso/ISOamsb delete mode 100644 Doc/sgml/iso/ISOamsc delete mode 100644 Doc/sgml/iso/ISOamsn delete mode 100644 Doc/sgml/iso/ISOamso delete mode 100644 Doc/sgml/iso/ISOamsr delete mode 100644 Doc/sgml/iso/ISObox delete mode 100644 Doc/sgml/iso/ISOcyr1 delete mode 100644 Doc/sgml/iso/ISOcyr2 delete mode 100644 Doc/sgml/iso/ISOdia delete mode 100644 Doc/sgml/iso/ISOgrk1 delete mode 100644 Doc/sgml/iso/ISOgrk2 delete mode 100644 Doc/sgml/iso/ISOgrk3 delete mode 100644 Doc/sgml/iso/ISOgrk4 delete mode 100644 Doc/sgml/iso/ISOlat1 delete mode 100644 Doc/sgml/iso/ISOlat2 delete mode 100644 Doc/sgml/iso/ISOnum delete mode 100644 Doc/sgml/iso/ISOpub delete mode 100644 Doc/sgml/iso/ISOtech delete mode 100644 Doc/sgml/iso/catalog delete mode 100644 Doc/sgml/oasis/catalog delete mode 100644 Doc/sgml/oasis/exchange.txt delete mode 100644 Doc/sgml/python.dtd delete mode 100644 Doc/sgml/version.ent delete mode 100644 Doc/templates/howto.tex delete mode 100644 Doc/templates/manual.tex delete mode 100644 Doc/templates/module.tex delete mode 100644 Doc/texinputs/boilerplate.tex delete mode 100644 Doc/texinputs/copyright.tex delete mode 100644 Doc/texinputs/distutils.sty delete mode 100644 Doc/texinputs/fncychap.sty delete mode 100644 Doc/texinputs/howto.cls delete mode 100644 Doc/texinputs/ltxmarkup.sty delete mode 100644 Doc/texinputs/manual.cls delete mode 100644 Doc/texinputs/pypaper.sty delete mode 100644 Doc/texinputs/python.ist delete mode 100644 Doc/texinputs/python.sty delete mode 100755 Doc/tools/anno-api.py delete mode 100755 Doc/tools/buildindex.py delete mode 100644 Doc/tools/checkargs.pm delete mode 100755 Doc/tools/cklatex delete mode 100644 Doc/tools/custlib.py delete mode 100755 Doc/tools/findmodrefs delete mode 100755 Doc/tools/fix_hack delete mode 100755 Doc/tools/fix_libaux.sed delete mode 100644 Doc/tools/fixinfo.el delete mode 100755 Doc/tools/getpagecounts delete mode 100755 Doc/tools/html2texi.pl delete mode 100755 Doc/tools/indfix.py delete mode 100644 Doc/tools/keywords.py delete mode 100755 Doc/tools/listmodules delete mode 100755 Doc/tools/mkdvi.sh delete mode 100755 Doc/tools/mkhowto delete mode 100755 Doc/tools/mkhtml.sh delete mode 100755 Doc/tools/mkinfo delete mode 100755 Doc/tools/mkmodindex delete mode 100755 Doc/tools/mksourcepkg delete mode 100755 Doc/tools/newind.py delete mode 100755 Doc/tools/node2label.pl delete mode 100644 Doc/tools/refcounts.py delete mode 100644 Doc/tools/sgmlconv/Makefile delete mode 100644 Doc/tools/sgmlconv/README delete mode 100644 Doc/tools/sgmlconv/conversion.xml delete mode 100755 Doc/tools/sgmlconv/docfixer.py delete mode 100755 Doc/tools/sgmlconv/esis2sgml.py delete mode 100644 Doc/tools/sgmlconv/esistools.py delete mode 100755 Doc/tools/sgmlconv/latex2esis.py delete mode 100644 Doc/tools/sgmlconv/make.rules delete mode 100755 Doc/tools/toc2bkm.py delete mode 100755 Doc/tools/whichlibs delete mode 100644 Doc/tut/.cvsignore delete mode 100644 Doc/tut/tut.tex delete mode 100644 Doc/whatsnew/whatsnew20.tex delete mode 100644 Grammar/.cvsignore delete mode 100644 Grammar/Grammar delete mode 100644 Grammar/Makefile delete mode 100644 Include/Makefile delete mode 100644 Include/Python.h delete mode 100644 Include/abstract.h delete mode 100644 Include/bitset.h delete mode 100644 Include/bufferobject.h delete mode 100644 Include/cStringIO.h delete mode 100644 Include/ceval.h delete mode 100644 Include/classobject.h delete mode 100644 Include/cobject.h delete mode 100644 Include/codecs.h delete mode 100644 Include/compile.h delete mode 100644 Include/complexobject.h delete mode 100755 Include/config.h delete mode 100644 Include/dictobject.h delete mode 100644 Include/errcode.h delete mode 100644 Include/eval.h delete mode 100644 Include/fileobject.h delete mode 100644 Include/floatobject.h delete mode 100644 Include/frameobject.h delete mode 100644 Include/funcobject.h delete mode 100644 Include/graminit.h delete mode 100644 Include/grammar.h delete mode 100644 Include/import.h delete mode 100644 Include/intobject.h delete mode 100644 Include/intrcheck.h delete mode 100644 Include/listobject.h delete mode 100644 Include/longintrepr.h delete mode 100644 Include/longobject.h delete mode 100644 Include/marshal.h delete mode 100644 Include/metagrammar.h delete mode 100644 Include/methodobject.h delete mode 100644 Include/modsupport.h delete mode 100644 Include/moduleobject.h delete mode 100644 Include/mymalloc.h delete mode 100644 Include/mymath.h delete mode 100644 Include/myproto.h delete mode 100644 Include/myselect.h delete mode 100644 Include/mytime.h delete mode 100644 Include/node.h delete mode 100644 Include/object.h delete mode 100644 Include/objimpl.h delete mode 100644 Include/opcode.h delete mode 100644 Include/osdefs.h delete mode 100644 Include/parsetok.h delete mode 100644 Include/patchlevel.h delete mode 100644 Include/pgenheaders.h delete mode 100644 Include/pydebug.h delete mode 100644 Include/pyerrors.h delete mode 100644 Include/pyfpe.h delete mode 100644 Include/pymem.h delete mode 100644 Include/pyport.h delete mode 100644 Include/pystate.h delete mode 100644 Include/pythonrun.h delete mode 100644 Include/pythread.h delete mode 100644 Include/rangeobject.h delete mode 100755 Include/rename1.h delete mode 100644 Include/sliceobject.h delete mode 100644 Include/stringobject.h delete mode 100644 Include/structmember.h delete mode 100644 Include/sysmodule.h delete mode 100644 Include/token.h delete mode 100644 Include/traceback.h delete mode 100644 Include/tupleobject.h delete mode 100644 Include/ucnhash.h delete mode 100644 Include/unicodeobject.h delete mode 100644 LICENSE delete mode 100644 Lib/BaseHTTPServer.py delete mode 100644 Lib/Bastion.py delete mode 100644 Lib/CGIHTTPServer.py delete mode 100644 Lib/ConfigParser.py delete mode 100644 Lib/Makefile delete mode 100644 Lib/MimeWriter.py delete mode 100644 Lib/Queue.py delete mode 100644 Lib/SimpleHTTPServer.py delete mode 100644 Lib/SocketServer.py delete mode 100644 Lib/StringIO.py delete mode 100644 Lib/UserDict.py delete mode 100644 Lib/UserList.py delete mode 100755 Lib/UserString.py delete mode 100644 Lib/aifc.py delete mode 100644 Lib/anydbm.py delete mode 100644 Lib/asynchat.py delete mode 100644 Lib/asyncore.py delete mode 100644 Lib/atexit.py delete mode 100644 Lib/audiodev.py delete mode 100755 Lib/base64.py delete mode 100644 Lib/bdb.py delete mode 100644 Lib/binhex.py delete mode 100644 Lib/bisect.py delete mode 100755 Lib/builtin.py delete mode 100644 Lib/calendar.py delete mode 100755 Lib/cgi.py delete mode 100644 Lib/chunk.py delete mode 100644 Lib/cmd.py delete mode 100644 Lib/code.py delete mode 100644 Lib/codecs.py delete mode 100644 Lib/codeop.py delete mode 100644 Lib/colorsys.py delete mode 100644 Lib/commands.py delete mode 100644 Lib/compileall.py delete mode 100644 Lib/compiler/__init__.py delete mode 100644 Lib/compiler/ast.py delete mode 100644 Lib/compiler/consts.py delete mode 100644 Lib/compiler/misc.py delete mode 100644 Lib/compiler/pyassem.py delete mode 100644 Lib/compiler/pycodegen.py delete mode 100644 Lib/compiler/transformer.py delete mode 100644 Lib/compiler/visitor.py delete mode 100644 Lib/copy.py delete mode 100644 Lib/copy_reg.py delete mode 100644 Lib/curses/__init__.py delete mode 100644 Lib/curses/ascii.py delete mode 100644 Lib/curses/has_key.py delete mode 100644 Lib/curses/textpad.py delete mode 100644 Lib/curses/wrapper.py delete mode 100644 Lib/dbhash.py delete mode 100644 Lib/dircache.py delete mode 100644 Lib/dis.py delete mode 100755 Lib/dos-8x3/basehttp.py delete mode 100755 Lib/dos-8x3/bastion.py delete mode 100755 Lib/dos-8x3/cgihttps.py delete mode 100755 Lib/dos-8x3/compilea.py delete mode 100644 Lib/dos-8x3/configpa.py delete mode 100644 Lib/dos-8x3/exceptio.py delete mode 100644 Lib/dos-8x3/fileinpu.py delete mode 100755 Lib/dos-8x3/formatte.py delete mode 100755 Lib/dos-8x3/gopherli.py delete mode 100755 Lib/dos-8x3/htmlenti.py delete mode 100755 Lib/dos-8x3/linecach.py delete mode 100755 Lib/dos-8x3/macurl2p.py delete mode 100755 Lib/dos-8x3/mimetool.py delete mode 100644 Lib/dos-8x3/mimetype.py delete mode 100644 Lib/dos-8x3/mimewrit.py delete mode 100755 Lib/dos-8x3/multifil.py delete mode 100755 Lib/dos-8x3/nturl2pa.py delete mode 100755 Lib/dos-8x3/posixfil.py delete mode 100755 Lib/dos-8x3/posixpat.py delete mode 100755 Lib/dos-8x3/py_compi.py delete mode 100755 Lib/dos-8x3/queue.py delete mode 100644 Lib/dos-8x3/reconver.py delete mode 100755 Lib/dos-8x3/regex_sy.py delete mode 100644 Lib/dos-8x3/regex_te.py delete mode 100644 Lib/dos-8x3/rlcomple.py delete mode 100644 Lib/dos-8x3/robotpar.py delete mode 100755 Lib/dos-8x3/simpleht.py delete mode 100755 Lib/dos-8x3/socketse.py delete mode 100644 Lib/dos-8x3/sre_comp.py delete mode 100644 Lib/dos-8x3/sre_cons.py delete mode 100644 Lib/dos-8x3/sre_pars.py delete mode 100755 Lib/dos-8x3/statcach.py delete mode 100755 Lib/dos-8x3/stringio.py delete mode 100644 Lib/dos-8x3/stringol.py delete mode 100644 Lib/dos-8x3/telnetli.py delete mode 100644 Lib/dos-8x3/test_arr.py delete mode 100644 Lib/dos-8x3/test_ate.py delete mode 100755 Lib/dos-8x3/test_aud.py delete mode 100644 Lib/dos-8x3/test_bin.py delete mode 100644 Lib/dos-8x3/test_bsd.py delete mode 100755 Lib/dos-8x3/test_bui.py delete mode 100644 Lib/dos-8x3/test_cma.py delete mode 100644 Lib/dos-8x3/test_con.py delete mode 100644 Lib/dos-8x3/test_cpi.py delete mode 100644 Lib/dos-8x3/test_cry.py delete mode 100644 Lib/dos-8x3/test_err.py delete mode 100755 Lib/dos-8x3/test_exc.py delete mode 100644 Lib/dos-8x3/test_ext.py delete mode 100644 Lib/dos-8x3/test_fcn.py delete mode 100644 Lib/dos-8x3/test_for.py delete mode 100644 Lib/dos-8x3/test_gdb.py delete mode 100755 Lib/dos-8x3/test_gra.py delete mode 100644 Lib/dos-8x3/test_gzi.py delete mode 100644 Lib/dos-8x3/test_has.py delete mode 100644 Lib/dos-8x3/test_ima.py delete mode 100644 Lib/dos-8x3/test_img.py delete mode 100644 Lib/dos-8x3/test_lin.py delete mode 100644 Lib/dos-8x3/test_lon.py delete mode 100644 Lib/dos-8x3/test_mat.py delete mode 100644 Lib/dos-8x3/test_mim.py delete mode 100644 Lib/dos-8x3/test_mma.py delete mode 100644 Lib/dos-8x3/test_ntp.py delete mode 100755 Lib/dos-8x3/test_opc.py delete mode 100755 Lib/dos-8x3/test_ope.py delete mode 100644 Lib/dos-8x3/test_pic.py delete mode 100644 Lib/dos-8x3/test_pop.py delete mode 100644 Lib/dos-8x3/test_pye.py delete mode 100644 Lib/dos-8x3/test_reg.py delete mode 100644 Lib/dos-8x3/test_rfc.py delete mode 100755 Lib/dos-8x3/test_rgb.py delete mode 100644 Lib/dos-8x3/test_rot.py delete mode 100755 Lib/dos-8x3/test_sel.py delete mode 100755 Lib/dos-8x3/test_sig.py delete mode 100644 Lib/dos-8x3/test_soc.py delete mode 100644 Lib/dos-8x3/test_str.py delete mode 100644 Lib/dos-8x3/test_sun.py delete mode 100755 Lib/dos-8x3/test_sup.py delete mode 100755 Lib/dos-8x3/test_thr.py delete mode 100644 Lib/dos-8x3/test_tim.py delete mode 100644 Lib/dos-8x3/test_tok.py delete mode 100755 Lib/dos-8x3/test_typ.py delete mode 100644 Lib/dos-8x3/test_uni.py delete mode 100644 Lib/dos-8x3/test_unp.py delete mode 100644 Lib/dos-8x3/test_use.py delete mode 100644 Lib/dos-8x3/test_win.py delete mode 100644 Lib/dos-8x3/test_xml.py delete mode 100644 Lib/dos-8x3/test_zip.py delete mode 100644 Lib/dos-8x3/test_zli.py delete mode 100644 Lib/dos-8x3/threadin.py delete mode 100644 Lib/dos-8x3/threadst.py delete mode 100644 Lib/dos-8x3/tokenize.py delete mode 100755 Lib/dos-8x3/tracebac.py delete mode 100755 Lib/dos-8x3/userdict.py delete mode 100755 Lib/dos-8x3/userlist.py delete mode 100644 Lib/dos-8x3/userstri.py delete mode 100644 Lib/dospath.py delete mode 100644 Lib/dumbdbm.py delete mode 100644 Lib/encodings/__init__.py delete mode 100644 Lib/encodings/aliases.py delete mode 100644 Lib/encodings/ascii.py delete mode 100644 Lib/encodings/charmap.py delete mode 100644 Lib/encodings/cp037.py delete mode 100644 Lib/encodings/cp1006.py delete mode 100644 Lib/encodings/cp1026.py delete mode 100644 Lib/encodings/cp1250.py delete mode 100644 Lib/encodings/cp1251.py delete mode 100644 Lib/encodings/cp1252.py delete mode 100644 Lib/encodings/cp1253.py delete mode 100644 Lib/encodings/cp1254.py delete mode 100644 Lib/encodings/cp1255.py delete mode 100644 Lib/encodings/cp1256.py delete mode 100644 Lib/encodings/cp1257.py delete mode 100644 Lib/encodings/cp1258.py delete mode 100644 Lib/encodings/cp424.py delete mode 100644 Lib/encodings/cp437.py delete mode 100644 Lib/encodings/cp500.py delete mode 100644 Lib/encodings/cp737.py delete mode 100644 Lib/encodings/cp775.py delete mode 100644 Lib/encodings/cp850.py delete mode 100644 Lib/encodings/cp852.py delete mode 100644 Lib/encodings/cp855.py delete mode 100644 Lib/encodings/cp856.py delete mode 100644 Lib/encodings/cp857.py delete mode 100644 Lib/encodings/cp860.py delete mode 100644 Lib/encodings/cp861.py delete mode 100644 Lib/encodings/cp862.py delete mode 100644 Lib/encodings/cp863.py delete mode 100644 Lib/encodings/cp864.py delete mode 100644 Lib/encodings/cp865.py delete mode 100644 Lib/encodings/cp866.py delete mode 100644 Lib/encodings/cp869.py delete mode 100644 Lib/encodings/cp874.py delete mode 100644 Lib/encodings/cp875.py delete mode 100644 Lib/encodings/iso8859_1.py delete mode 100644 Lib/encodings/iso8859_10.py delete mode 100644 Lib/encodings/iso8859_13.py delete mode 100644 Lib/encodings/iso8859_14.py delete mode 100644 Lib/encodings/iso8859_15.py delete mode 100644 Lib/encodings/iso8859_2.py delete mode 100644 Lib/encodings/iso8859_3.py delete mode 100644 Lib/encodings/iso8859_4.py delete mode 100644 Lib/encodings/iso8859_5.py delete mode 100644 Lib/encodings/iso8859_6.py delete mode 100644 Lib/encodings/iso8859_7.py delete mode 100644 Lib/encodings/iso8859_8.py delete mode 100644 Lib/encodings/iso8859_9.py delete mode 100644 Lib/encodings/koi8_r.py delete mode 100644 Lib/encodings/latin_1.py delete mode 100644 Lib/encodings/mac_cyrillic.py delete mode 100644 Lib/encodings/mac_greek.py delete mode 100644 Lib/encodings/mac_iceland.py delete mode 100644 Lib/encodings/mac_latin2.py delete mode 100644 Lib/encodings/mac_roman.py delete mode 100644 Lib/encodings/mac_turkish.py delete mode 100644 Lib/encodings/mbcs.py delete mode 100644 Lib/encodings/raw_unicode_escape.py delete mode 100644 Lib/encodings/undefined.py delete mode 100644 Lib/encodings/unicode_escape.py delete mode 100644 Lib/encodings/unicode_internal.py delete mode 100644 Lib/encodings/utf_16.py delete mode 100644 Lib/encodings/utf_16_be.py delete mode 100644 Lib/encodings/utf_16_le.py delete mode 100644 Lib/encodings/utf_8.py delete mode 100644 Lib/filecmp.py delete mode 100644 Lib/fileinput.py delete mode 100644 Lib/fnmatch.py delete mode 100644 Lib/formatter.py delete mode 100644 Lib/fpformat.py delete mode 100644 Lib/ftplib.py delete mode 100644 Lib/getopt.py delete mode 100644 Lib/getpass.py delete mode 100644 Lib/glob.py delete mode 100644 Lib/gopherlib.py delete mode 100644 Lib/gzip.py delete mode 100644 Lib/htmlentitydefs.py delete mode 100644 Lib/htmllib.py delete mode 100644 Lib/httplib.py delete mode 100644 Lib/idlelib/AutoExpand.py delete mode 100644 Lib/idlelib/AutoIndent.py delete mode 100644 Lib/idlelib/Bindings.py delete mode 100644 Lib/idlelib/CallTipWindow.py delete mode 100644 Lib/idlelib/CallTips.py delete mode 100644 Lib/idlelib/ChangeLog delete mode 100644 Lib/idlelib/ClassBrowser.py delete mode 100644 Lib/idlelib/ColorDelegator.py delete mode 100644 Lib/idlelib/ConfigParser.py delete mode 100644 Lib/idlelib/Debugger.py delete mode 100644 Lib/idlelib/Delegator.py delete mode 100644 Lib/idlelib/EditorWindow.py delete mode 100644 Lib/idlelib/ExecBinding.py delete mode 100644 Lib/idlelib/FileList.py delete mode 100644 Lib/idlelib/FormatParagraph.py delete mode 100644 Lib/idlelib/FrameViewer.py delete mode 100644 Lib/idlelib/GrepDialog.py delete mode 100644 Lib/idlelib/IOBinding.py delete mode 100644 Lib/idlelib/Icons/folder.gif delete mode 100644 Lib/idlelib/Icons/minusnode.gif delete mode 100644 Lib/idlelib/Icons/openfolder.gif delete mode 100644 Lib/idlelib/Icons/plusnode.gif delete mode 100644 Lib/idlelib/Icons/python.gif delete mode 100644 Lib/idlelib/Icons/tk.gif delete mode 100644 Lib/idlelib/IdleConf.py delete mode 100644 Lib/idlelib/IdleHistory.py delete mode 100644 Lib/idlelib/MultiScrolledLists.py delete mode 100644 Lib/idlelib/MultiStatusBar.py delete mode 100644 Lib/idlelib/NEWS.txt delete mode 100644 Lib/idlelib/ObjectBrowser.py delete mode 100644 Lib/idlelib/OldStackViewer.py delete mode 100644 Lib/idlelib/OutputWindow.py delete mode 100644 Lib/idlelib/ParenMatch.py delete mode 100644 Lib/idlelib/PathBrowser.py delete mode 100644 Lib/idlelib/Percolator.py delete mode 100644 Lib/idlelib/PyParse.py delete mode 100644 Lib/idlelib/PyShell.py delete mode 100644 Lib/idlelib/README.txt delete mode 100644 Lib/idlelib/Remote.py delete mode 100644 Lib/idlelib/ReplaceDialog.py delete mode 100644 Lib/idlelib/ScriptBinding.py delete mode 100644 Lib/idlelib/ScrolledList.py delete mode 100644 Lib/idlelib/SearchBinding.py delete mode 100644 Lib/idlelib/SearchDialog.py delete mode 100644 Lib/idlelib/SearchDialogBase.py delete mode 100644 Lib/idlelib/SearchEngine.py delete mode 100644 Lib/idlelib/Separator.py delete mode 100644 Lib/idlelib/StackViewer.py delete mode 100644 Lib/idlelib/TODO.txt delete mode 100644 Lib/idlelib/ToolTip.py delete mode 100644 Lib/idlelib/TreeWidget.py delete mode 100644 Lib/idlelib/UndoDelegator.py delete mode 100644 Lib/idlelib/WidgetRedirector.py delete mode 100644 Lib/idlelib/WindowList.py delete mode 100644 Lib/idlelib/ZoomHeight.py delete mode 100644 Lib/idlelib/__init__.py delete mode 100644 Lib/idlelib/config-unix.txt delete mode 100644 Lib/idlelib/config-win.txt delete mode 100644 Lib/idlelib/config.txt delete mode 100644 Lib/idlelib/eventparse.py delete mode 100644 Lib/idlelib/extend.txt delete mode 100644 Lib/idlelib/help.txt delete mode 100755 Lib/idlelib/idle.bat delete mode 100644 Lib/idlelib/idle.py delete mode 100644 Lib/idlelib/idle.pyw delete mode 100644 Lib/idlelib/idlever.py delete mode 100644 Lib/idlelib/keydefs.py delete mode 100644 Lib/idlelib/loader.py delete mode 100644 Lib/idlelib/protocol.py delete mode 100644 Lib/idlelib/pyclbr.py delete mode 100644 Lib/idlelib/spawn.py delete mode 100644 Lib/idlelib/tabnanny.py delete mode 100644 Lib/idlelib/testcode.py delete mode 100644 Lib/ihooks.py delete mode 100644 Lib/imaplib.py delete mode 100644 Lib/imghdr.py delete mode 100644 Lib/imputil.py delete mode 100755 Lib/keyword.py delete mode 100644 Lib/knee.py delete mode 100644 Lib/lib-old/Para.py delete mode 100644 Lib/lib-old/addpack.py delete mode 100644 Lib/lib-old/cmp.py delete mode 100644 Lib/lib-old/cmpcache.py delete mode 100644 Lib/lib-old/codehack.py delete mode 100644 Lib/lib-old/dircmp.py delete mode 100644 Lib/lib-old/dump.py delete mode 100644 Lib/lib-old/find.py delete mode 100644 Lib/lib-old/fmt.py delete mode 100644 Lib/lib-old/grep.py delete mode 100644 Lib/lib-old/lockfile.py delete mode 100644 Lib/lib-old/newdir.py delete mode 100644 Lib/lib-old/ni.py delete mode 100644 Lib/lib-old/packmail.py delete mode 100644 Lib/lib-old/poly.py delete mode 100644 Lib/lib-old/rand.py delete mode 100644 Lib/lib-old/tb.py delete mode 100644 Lib/lib-old/util.py delete mode 100644 Lib/lib-old/whatsound.py delete mode 100644 Lib/lib-old/zmod.py delete mode 100644 Lib/lib-tk/Canvas.py delete mode 100644 Lib/lib-tk/Dialog.py delete mode 100644 Lib/lib-tk/FileDialog.py delete mode 100644 Lib/lib-tk/FixTk.py delete mode 100644 Lib/lib-tk/ScrolledText.py delete mode 100644 Lib/lib-tk/SimpleDialog.py delete mode 100644 Lib/lib-tk/Tkconstants.py delete mode 100644 Lib/lib-tk/Tkdnd.py delete mode 100644 Lib/lib-tk/Tkinter.py delete mode 100644 Lib/lib-tk/tkColorChooser.py delete mode 100644 Lib/lib-tk/tkCommonDialog.py delete mode 100644 Lib/lib-tk/tkFileDialog.py delete mode 100644 Lib/lib-tk/tkFont.py delete mode 100644 Lib/lib-tk/tkMessageBox.py delete mode 100644 Lib/lib-tk/tkSimpleDialog.py delete mode 100644 Lib/lib-tk/turtle.py delete mode 100644 Lib/linecache.py delete mode 100644 Lib/locale.py delete mode 100644 Lib/macpath.py delete mode 100755 Lib/macstat.py delete mode 100644 Lib/macurl2path.py delete mode 100755 Lib/mailbox.py delete mode 100644 Lib/mailcap.py delete mode 100644 Lib/mhlib.py delete mode 100644 Lib/mimetools.py delete mode 100644 Lib/mimetypes.py delete mode 100755 Lib/mimify.py delete mode 100644 Lib/multifile.py delete mode 100644 Lib/mutex.py delete mode 100644 Lib/netrc.py delete mode 100755 Lib/newimp.py delete mode 100644 Lib/nntplib.py delete mode 100644 Lib/ntpath.py delete mode 100644 Lib/nturl2path.py delete mode 100644 Lib/os.py delete mode 100644 Lib/pdb.doc delete mode 100755 Lib/pdb.py delete mode 100755 Lib/persist.py delete mode 100644 Lib/pickle.py delete mode 100644 Lib/pipes.py delete mode 100644 Lib/plat-aix3/FCNTL.py delete mode 100644 Lib/plat-aix3/IN.py delete mode 100644 Lib/plat-aix3/SOCKET.py delete mode 100644 Lib/plat-aix3/TERMIOS.py delete mode 100755 Lib/plat-aix3/regen delete mode 100644 Lib/plat-aix4/FCNTL.py delete mode 100644 Lib/plat-aix4/IN.py delete mode 100644 Lib/plat-aix4/SOCKET.py delete mode 100644 Lib/plat-aix4/TERMIOS.py delete mode 100755 Lib/plat-aix4/regen delete mode 100644 Lib/plat-beos/socket.py delete mode 100755 Lib/plat-freebsd2/FCNTL.py delete mode 100644 Lib/plat-freebsd2/IN.py delete mode 100644 Lib/plat-freebsd2/SOCKET.py delete mode 100644 Lib/plat-freebsd2/TERMIOS.py delete mode 100755 Lib/plat-freebsd2/regen delete mode 100644 Lib/plat-freebsd3/FCNTL.py delete mode 100644 Lib/plat-freebsd3/IN.py delete mode 100644 Lib/plat-freebsd3/SOCKET.py delete mode 100644 Lib/plat-freebsd3/TERMIOS.py delete mode 100755 Lib/plat-freebsd3/regen delete mode 100755 Lib/plat-generic/regen delete mode 100755 Lib/plat-irix5/AL.py delete mode 100755 Lib/plat-irix5/CD.py delete mode 100755 Lib/plat-irix5/CL.py delete mode 100755 Lib/plat-irix5/CL_old.py delete mode 100755 Lib/plat-irix5/DEVICE.py delete mode 100755 Lib/plat-irix5/ERRNO.py delete mode 100755 Lib/plat-irix5/FCNTL.py delete mode 100755 Lib/plat-irix5/FILE.py delete mode 100755 Lib/plat-irix5/FL.py delete mode 100755 Lib/plat-irix5/GET.py delete mode 100755 Lib/plat-irix5/GL.py delete mode 100755 Lib/plat-irix5/GLWS.py delete mode 100755 Lib/plat-irix5/IN.py delete mode 100755 Lib/plat-irix5/IOCTL.py delete mode 100755 Lib/plat-irix5/SOCKET.py delete mode 100755 Lib/plat-irix5/SV.py delete mode 100755 Lib/plat-irix5/TERMIOS.py delete mode 100755 Lib/plat-irix5/WAIT.py delete mode 100755 Lib/plat-irix5/cddb.py delete mode 100755 Lib/plat-irix5/cdplayer.py delete mode 100755 Lib/plat-irix5/flp.doc delete mode 100755 Lib/plat-irix5/flp.py delete mode 100755 Lib/plat-irix5/jpeg.py delete mode 100755 Lib/plat-irix5/panel.py delete mode 100755 Lib/plat-irix5/panelparser.py delete mode 100755 Lib/plat-irix5/readcd.doc delete mode 100755 Lib/plat-irix5/readcd.py delete mode 100755 Lib/plat-irix5/regen delete mode 100755 Lib/plat-irix5/torgb.py delete mode 100644 Lib/plat-irix6/AL.py delete mode 100644 Lib/plat-irix6/CD.py delete mode 100644 Lib/plat-irix6/CL.py delete mode 100644 Lib/plat-irix6/DEVICE.py delete mode 100644 Lib/plat-irix6/ERRNO.py delete mode 100644 Lib/plat-irix6/FCNTL.py delete mode 100644 Lib/plat-irix6/FILE.py delete mode 100644 Lib/plat-irix6/FL.py delete mode 100644 Lib/plat-irix6/GET.py delete mode 100644 Lib/plat-irix6/GL.py delete mode 100644 Lib/plat-irix6/GLWS.py delete mode 100644 Lib/plat-irix6/IN.py delete mode 100644 Lib/plat-irix6/IOCTL.py delete mode 100644 Lib/plat-irix6/SOCKET.py delete mode 100644 Lib/plat-irix6/SV.py delete mode 100644 Lib/plat-irix6/TERMIOS.py delete mode 100644 Lib/plat-irix6/WAIT.py delete mode 100644 Lib/plat-irix6/cddb.py delete mode 100644 Lib/plat-irix6/cdplayer.py delete mode 100644 Lib/plat-irix6/flp.doc delete mode 100644 Lib/plat-irix6/flp.py delete mode 100644 Lib/plat-irix6/jpeg.py delete mode 100644 Lib/plat-irix6/panel.py delete mode 100644 Lib/plat-irix6/panelparser.py delete mode 100644 Lib/plat-irix6/readcd.doc delete mode 100644 Lib/plat-irix6/readcd.py delete mode 100755 Lib/plat-irix6/regen delete mode 100644 Lib/plat-irix6/torgb.py delete mode 100755 Lib/plat-linux1/FCNTL.py delete mode 100755 Lib/plat-linux1/IN.py delete mode 100755 Lib/plat-linux1/SOCKET.py delete mode 100755 Lib/plat-linux1/TERMIOS.py delete mode 100755 Lib/plat-linux1/regen delete mode 100644 Lib/plat-linux2/CDROM.py delete mode 100644 Lib/plat-linux2/FCNTL.py delete mode 100644 Lib/plat-linux2/IN.py delete mode 100644 Lib/plat-linux2/SOCKET.py delete mode 100644 Lib/plat-linux2/TERMIOS.py delete mode 100755 Lib/plat-linux2/regen delete mode 100644 Lib/plat-netbsd1/FCNTL.py delete mode 100644 Lib/plat-netbsd1/IN.py delete mode 100644 Lib/plat-netbsd1/SOCKET.py delete mode 100644 Lib/plat-netbsd1/TERMIOS.py delete mode 100755 Lib/plat-netbsd1/regen delete mode 100755 Lib/plat-next3/regen delete mode 100755 Lib/plat-sunos4/FCNTL.py delete mode 100755 Lib/plat-sunos4/IN.py delete mode 100755 Lib/plat-sunos4/SOCKET.py delete mode 100755 Lib/plat-sunos4/SUNAUDIODEV.py delete mode 100755 Lib/plat-sunos4/WAIT.py delete mode 100755 Lib/plat-sunos4/regen delete mode 100644 Lib/plat-sunos5/CDIO.py delete mode 100755 Lib/plat-sunos5/FCNTL.py delete mode 100755 Lib/plat-sunos5/IN.py delete mode 100755 Lib/plat-sunos5/SOCKET.py delete mode 100644 Lib/plat-sunos5/STROPTS.py delete mode 100755 Lib/plat-sunos5/SUNAUDIODEV.py delete mode 100755 Lib/plat-sunos5/TERMIOS.py delete mode 100755 Lib/plat-sunos5/regen delete mode 100755 Lib/plat-win/socket.py delete mode 100644 Lib/plat-win/winreg.py delete mode 100644 Lib/popen2.py delete mode 100644 Lib/poplib.py delete mode 100644 Lib/posixfile.py delete mode 100644 Lib/posixpath.py delete mode 100644 Lib/pprint.py delete mode 100644 Lib/pre.py delete mode 100644 Lib/profile.doc delete mode 100755 Lib/profile.py delete mode 100644 Lib/pstats.py delete mode 100644 Lib/pty.py delete mode 100644 Lib/py_compile.py delete mode 100644 Lib/pyclbr.py delete mode 100755 Lib/quopri.py delete mode 100644 Lib/random.py delete mode 100644 Lib/re.py delete mode 100755 Lib/reconvert.py delete mode 100644 Lib/regex_syntax.py delete mode 100644 Lib/regsub.py delete mode 100644 Lib/repr.py delete mode 100644 Lib/rexec.py delete mode 100644 Lib/rfc822.py delete mode 100644 Lib/rlcompleter.py delete mode 100644 Lib/robotparser.py delete mode 100644 Lib/sched.py delete mode 100644 Lib/sgmllib.py delete mode 100644 Lib/shelve.py delete mode 100644 Lib/shlex.py delete mode 100644 Lib/shutil.py delete mode 100644 Lib/site-packages/README delete mode 100644 Lib/site.py delete mode 100755 Lib/smtplib.py delete mode 100644 Lib/sndhdr.py delete mode 100644 Lib/sre.py delete mode 100644 Lib/sre_compile.py delete mode 100644 Lib/sre_constants.py delete mode 100644 Lib/sre_parse.py delete mode 100644 Lib/stat.py delete mode 100644 Lib/statcache.py delete mode 100644 Lib/statvfs.py delete mode 100644 Lib/string.py delete mode 100644 Lib/stringold.py delete mode 100644 Lib/sunau.py delete mode 100644 Lib/sunaudio.py delete mode 100755 Lib/symbol.py delete mode 100755 Lib/tabnanny.py delete mode 100644 Lib/telnetlib.py delete mode 100644 Lib/tempfile.py delete mode 100644 Lib/test/README delete mode 100644 Lib/test/__init__.py delete mode 100644 Lib/test/audiotest.au delete mode 100644 Lib/test/autotest.py delete mode 100644 Lib/test/greyrgb.uue delete mode 100644 Lib/test/output/test_MimeWriter delete mode 100644 Lib/test/output/test_al delete mode 100644 Lib/test/output/test_array delete mode 100644 Lib/test/output/test_atexit delete mode 100644 Lib/test/output/test_audioop delete mode 100644 Lib/test/output/test_binascii delete mode 100644 Lib/test/output/test_binhex delete mode 100644 Lib/test/output/test_bsddb delete mode 100644 Lib/test/output/test_builtin delete mode 100644 Lib/test/output/test_cd delete mode 100644 Lib/test/output/test_cgi delete mode 100644 Lib/test/output/test_cl delete mode 100644 Lib/test/output/test_cmath delete mode 100644 Lib/test/output/test_compile delete mode 100644 Lib/test/output/test_contains delete mode 100644 Lib/test/output/test_cpickle delete mode 100644 Lib/test/output/test_crypt delete mode 100644 Lib/test/output/test_dbm delete mode 100644 Lib/test/output/test_dl delete mode 100644 Lib/test/output/test_errno delete mode 100644 Lib/test/output/test_exceptions delete mode 100644 Lib/test/output/test_extcall delete mode 100644 Lib/test/output/test_fcntl delete mode 100644 Lib/test/output/test_fork1 delete mode 100644 Lib/test/output/test_format delete mode 100644 Lib/test/output/test_gc delete mode 100644 Lib/test/output/test_gdbm delete mode 100644 Lib/test/output/test_gl delete mode 100644 Lib/test/output/test_grammar delete mode 100644 Lib/test/output/test_grp delete mode 100644 Lib/test/output/test_gzip delete mode 100644 Lib/test/output/test_hash delete mode 100644 Lib/test/output/test_imageop delete mode 100644 Lib/test/output/test_imgfile delete mode 100644 Lib/test/output/test_largefile delete mode 100644 Lib/test/output/test_linuxaudiodev delete mode 100644 Lib/test/output/test_long delete mode 100644 Lib/test/output/test_longexp delete mode 100644 Lib/test/output/test_math delete mode 100644 Lib/test/output/test_md5 delete mode 100644 Lib/test/output/test_minidom delete mode 100644 Lib/test/output/test_mmap delete mode 100644 Lib/test/output/test_new delete mode 100644 Lib/test/output/test_nis delete mode 100644 Lib/test/output/test_ntpath delete mode 100644 Lib/test/output/test_opcodes delete mode 100644 Lib/test/output/test_openpty delete mode 100644 Lib/test/output/test_operations delete mode 100644 Lib/test/output/test_operator delete mode 100644 Lib/test/output/test_pickle delete mode 100644 Lib/test/output/test_pkg delete mode 100644 Lib/test/output/test_popen2 delete mode 100644 Lib/test/output/test_posixpath delete mode 100644 Lib/test/output/test_pow delete mode 100644 Lib/test/output/test_pty delete mode 100644 Lib/test/output/test_pwd delete mode 100644 Lib/test/output/test_pyexpat delete mode 100644 Lib/test/output/test_re delete mode 100644 Lib/test/output/test_regex delete mode 100644 Lib/test/output/test_rfc822 delete mode 100644 Lib/test/output/test_rgbimg delete mode 100644 Lib/test/output/test_rotor delete mode 100644 Lib/test/output/test_select delete mode 100644 Lib/test/output/test_sha delete mode 100644 Lib/test/output/test_signal delete mode 100644 Lib/test/output/test_socket delete mode 100644 Lib/test/output/test_sre delete mode 100644 Lib/test/output/test_strftime delete mode 100644 Lib/test/output/test_string delete mode 100644 Lib/test/output/test_strop delete mode 100644 Lib/test/output/test_struct delete mode 100644 Lib/test/output/test_sunaudiodev delete mode 100644 Lib/test/output/test_thread delete mode 100644 Lib/test/output/test_time delete mode 100644 Lib/test/output/test_timing delete mode 100644 Lib/test/output/test_tokenize delete mode 100644 Lib/test/output/test_types delete mode 100644 Lib/test/output/test_ucn delete mode 100644 Lib/test/output/test_unicode delete mode 100644 Lib/test/output/test_unicodedata delete mode 100644 Lib/test/output/test_unpack delete mode 100644 Lib/test/output/test_urlparse delete mode 100644 Lib/test/output/test_userdict delete mode 100644 Lib/test/output/test_userlist delete mode 100644 Lib/test/output/test_userstring delete mode 100644 Lib/test/output/test_winreg delete mode 100644 Lib/test/output/test_winreg2 delete mode 100644 Lib/test/output/test_winsound delete mode 100644 Lib/test/output/test_xmllib delete mode 100644 Lib/test/output/test_zipfile delete mode 100644 Lib/test/output/test_zlib delete mode 100755 Lib/test/pystone.py delete mode 100755 Lib/test/re_tests.py delete mode 100644 Lib/test/regex_tests.py delete mode 100755 Lib/test/regrtest.py delete mode 100644 Lib/test/reperf.py delete mode 100644 Lib/test/sortperf.py delete mode 100644 Lib/test/string_tests.py delete mode 100644 Lib/test/test.xml delete mode 100644 Lib/test/test_MimeWriter.py delete mode 100755 Lib/test/test_al.py delete mode 100755 Lib/test/test_array.py delete mode 100644 Lib/test/test_atexit.py delete mode 100644 Lib/test/test_audioop.py delete mode 100644 Lib/test/test_b1.py delete mode 100644 Lib/test/test_b2.py delete mode 100755 Lib/test/test_binascii.py delete mode 100755 Lib/test/test_binhex.py delete mode 100755 Lib/test/test_bsddb.py delete mode 100644 Lib/test/test_builtin.py delete mode 100755 Lib/test/test_cd.py delete mode 100644 Lib/test/test_cgi.py delete mode 100755 Lib/test/test_cl.py delete mode 100755 Lib/test/test_cmath.py delete mode 100644 Lib/test/test_compile.py delete mode 100644 Lib/test/test_contains.py delete mode 100644 Lib/test/test_cpickle.py delete mode 100755 Lib/test/test_crypt.py delete mode 100755 Lib/test/test_dbm.py delete mode 100755 Lib/test/test_dl.py delete mode 100755 Lib/test/test_errno.py delete mode 100644 Lib/test/test_exceptions.py delete mode 100644 Lib/test/test_extcall.py delete mode 100755 Lib/test/test_fcntl.py delete mode 100644 Lib/test/test_fork1.py delete mode 100644 Lib/test/test_format.py delete mode 100644 Lib/test/test_gc.py delete mode 100755 Lib/test/test_gdbm.py delete mode 100755 Lib/test/test_gl.py delete mode 100644 Lib/test/test_grammar.py delete mode 100755 Lib/test/test_grp.py delete mode 100644 Lib/test/test_gzip.py delete mode 100644 Lib/test/test_hash.py delete mode 100755 Lib/test/test_imageop.py delete mode 100755 Lib/test/test_imgfile.py delete mode 100644 Lib/test/test_largefile.py delete mode 100644 Lib/test/test_linuxaudiodev.py delete mode 100644 Lib/test/test_long.py delete mode 100644 Lib/test/test_longexp.py delete mode 100644 Lib/test/test_math.py delete mode 100644 Lib/test/test_md5.py delete mode 100644 Lib/test/test_minidom.py delete mode 100644 Lib/test/test_mmap.py delete mode 100644 Lib/test/test_new.py delete mode 100644 Lib/test/test_nis.py delete mode 100644 Lib/test/test_ntpath.py delete mode 100644 Lib/test/test_opcodes.py delete mode 100644 Lib/test/test_openpty.py delete mode 100644 Lib/test/test_operations.py delete mode 100644 Lib/test/test_operator.py delete mode 100644 Lib/test/test_pickle.py delete mode 100644 Lib/test/test_pkg.py delete mode 100644 Lib/test/test_popen2.py delete mode 100644 Lib/test/test_posixpath.py delete mode 100644 Lib/test/test_pow.py delete mode 100644 Lib/test/test_pty.py delete mode 100644 Lib/test/test_pwd.py delete mode 100644 Lib/test/test_pyexpat.py delete mode 100644 Lib/test/test_re.py delete mode 100644 Lib/test/test_regex.py delete mode 100644 Lib/test/test_rfc822.py delete mode 100644 Lib/test/test_rgbimg.py delete mode 100644 Lib/test/test_rotor.py delete mode 100644 Lib/test/test_select.py delete mode 100644 Lib/test/test_sha.py delete mode 100644 Lib/test/test_signal.py delete mode 100644 Lib/test/test_socket.py delete mode 100644 Lib/test/test_sre.py delete mode 100755 Lib/test/test_strftime.py delete mode 100644 Lib/test/test_string.py delete mode 100644 Lib/test/test_strop.py delete mode 100644 Lib/test/test_struct.py delete mode 100644 Lib/test/test_sunaudiodev.py delete mode 100644 Lib/test/test_support.py delete mode 100644 Lib/test/test_thread.py delete mode 100644 Lib/test/test_time.py delete mode 100644 Lib/test/test_timing.py delete mode 100644 Lib/test/test_tokenize.py delete mode 100644 Lib/test/test_types.py delete mode 100644 Lib/test/test_ucn.py delete mode 100644 Lib/test/test_unicode.py delete mode 100644 Lib/test/test_unicodedata.py delete mode 100644 Lib/test/test_unpack.py delete mode 100644 Lib/test/test_urlparse.py delete mode 100644 Lib/test/test_userdict.py delete mode 100644 Lib/test/test_userlist.py delete mode 100755 Lib/test/test_userstring.py delete mode 100644 Lib/test/test_winreg.py delete mode 100644 Lib/test/test_winreg2.py delete mode 100644 Lib/test/test_winsound.py delete mode 100644 Lib/test/test_xmllib.py delete mode 100644 Lib/test/test_zipfile.py delete mode 100644 Lib/test/test_zlib.py delete mode 100644 Lib/test/testall.py delete mode 100644 Lib/test/testimg.uue delete mode 100644 Lib/test/testimgr.uue delete mode 100644 Lib/test/testrgb.uue delete mode 100644 Lib/test/tokenize_tests.py delete mode 100644 Lib/threading.py delete mode 100644 Lib/toaiff.py delete mode 100755 Lib/token.py delete mode 100644 Lib/tokenize.py delete mode 100644 Lib/traceback.py delete mode 100644 Lib/tty.py delete mode 100644 Lib/types.py delete mode 100644 Lib/tzparse.py delete mode 100644 Lib/urllib.py delete mode 100644 Lib/urllib2.py delete mode 100755 Lib/urlopen.py delete mode 100644 Lib/urlparse.py delete mode 100644 Lib/user.py delete mode 100755 Lib/uu.py delete mode 100644 Lib/wave.py delete mode 100644 Lib/webbrowser.py delete mode 100644 Lib/whichdb.py delete mode 100644 Lib/whrandom.py delete mode 100644 Lib/xdrlib.py delete mode 100644 Lib/xml/__init__.py delete mode 100644 Lib/xml/dom/__init__.py delete mode 100644 Lib/xml/dom/minidom.py delete mode 100644 Lib/xml/dom/pulldom.py delete mode 100644 Lib/xml/parsers/__init__.py delete mode 100644 Lib/xml/sax/__init__.py delete mode 100644 Lib/xml/sax/_exceptions.py delete mode 100644 Lib/xml/sax/expatreader.py delete mode 100644 Lib/xml/sax/handler.py delete mode 100644 Lib/xml/sax/saxutils.py delete mode 100644 Lib/xml/sax/xmlreader.py delete mode 100644 Lib/xmllib.py delete mode 100644 Lib/zipfile.py delete mode 100644 Mac/Build/App.prj delete mode 100644 Mac/Build/App.prj.exp delete mode 100644 Mac/Build/Cm.prj delete mode 100644 Mac/Build/Cm.prj.exp delete mode 100644 Mac/Build/ColorPicker.prj delete mode 100644 Mac/Build/ColorPicker.prj.exp delete mode 100644 Mac/Build/Drag.prj delete mode 100644 Mac/Build/Drag.prj.exp delete mode 100644 Mac/Build/Fm.prj delete mode 100644 Mac/Build/Fm.prj.exp delete mode 100644 Mac/Build/Help.prj delete mode 100644 Mac/Build/Help.prj.exp delete mode 100644 Mac/Build/HtmlRender.prj delete mode 100644 Mac/Build/HtmlRender.prj.exp delete mode 100644 Mac/Build/Icn.prj delete mode 100644 Mac/Build/Icn.prj.exp delete mode 100644 Mac/Build/List.prj delete mode 100644 Mac/Build/List.prj.exp delete mode 100644 Mac/Build/PlugIns.prj delete mode 100644 Mac/Build/Printing.prj delete mode 100644 Mac/Build/Printing.prj.exp delete mode 100644 Mac/Build/PythonCore.prj delete mode 100644 Mac/Build/PythonCoreCFM68K.prj delete mode 100644 Mac/Build/PythonCoreCFM68K.prj.exp delete mode 100644 Mac/Build/PythonCorePPC.prj delete mode 100644 Mac/Build/PythonCorePPC.prj.exp delete mode 100644 Mac/Build/PythonInterpreter.prj delete mode 100644 Mac/Build/PythonStandCarbon.prj delete mode 100644 Mac/Build/PythonStandSmall.prj delete mode 100644 Mac/Build/PythonStandalone.prj delete mode 100644 Mac/Build/Qdoffs.prj delete mode 100644 Mac/Build/Qdoffs.prj.exp delete mode 100644 Mac/Build/Qt.prj delete mode 100644 Mac/Build/Qt.prj.exp delete mode 100644 Mac/Build/Scrap.prj delete mode 100644 Mac/Build/Scrap.prj.exp delete mode 100644 Mac/Build/Snd.prj delete mode 100644 Mac/Build/Snd.prj.exp delete mode 100644 Mac/Build/Sndihooks.prj delete mode 100644 Mac/Build/Sndihooks.prj.exp delete mode 100644 Mac/Build/TE.prj delete mode 100644 Mac/Build/TE.prj.exp delete mode 100644 Mac/Build/_tkinter.prj delete mode 100644 Mac/Build/_tkinter.prj.exp delete mode 100644 Mac/Build/buildlibs.prj delete mode 100644 Mac/Build/calldll.ppc.prj delete mode 100644 Mac/Build/calldll.ppc.prj.exp delete mode 100644 Mac/Build/ctb.prj delete mode 100644 Mac/Build/ctb.prj.exp delete mode 100644 Mac/Build/gdbm.prj delete mode 100644 Mac/Build/gdbm.prj.exp delete mode 100644 Mac/Build/icglue.prj delete mode 100644 Mac/Build/icglue.prj.exp delete mode 100644 Mac/Build/macspeech.prj delete mode 100644 Mac/Build/macspeech.prj.exp delete mode 100644 Mac/Build/pyexpat.prj delete mode 100644 Mac/Build/pyexpat.prj.exp delete mode 100644 Mac/Build/ucnhash.prj delete mode 100644 Mac/Build/ucnhash.prj.exp delete mode 100644 Mac/Build/waste.prj delete mode 100644 Mac/Build/waste.prj.exp delete mode 100644 Mac/Build/xx.prj delete mode 100644 Mac/Build/xx.prj.exp delete mode 100644 Mac/Build/zlib.prj delete mode 100644 Mac/Build/zlib.prj.exp delete mode 100644 Mac/Compat/chdir.c delete mode 100644 Mac/Compat/dirent.h delete mode 100644 Mac/Compat/getbootvol.c delete mode 100644 Mac/Compat/getwd.c delete mode 100644 Mac/Compat/macgetmtime.c delete mode 100644 Mac/Compat/macstat.c delete mode 100644 Mac/Compat/macstat.h delete mode 100644 Mac/Compat/mkdir.c delete mode 100644 Mac/Compat/nfullpath.c delete mode 100644 Mac/Compat/nfullpath.h delete mode 100644 Mac/Compat/opendir.c delete mode 100644 Mac/Compat/rmdir.c delete mode 100644 Mac/Compat/sync.c delete mode 100644 Mac/Contrib/AECaptureParser/AECaptureParser.py delete mode 100644 Mac/Contrib/AECaptureParser/readme.txt delete mode 100644 Mac/Contrib/BBPy/PythonSlave.py delete mode 100644 Mac/Contrib/BBPy/README delete mode 100644 Mac/Contrib/BBPy/source/BB stuff/ExternalInterface.h delete mode 100644 Mac/Contrib/BBPy/source/BB-stuff/ExternalInterface.h delete mode 100644 Mac/Contrib/BBPy/source/BBPy.h delete mode 100644 Mac/Contrib/BBPy/source/BBPy.rsrc delete mode 100644 Mac/Contrib/BBPy/source/BBPy_lauch.c delete mode 100644 Mac/Contrib/BBPy/source/BBPy_launch.c delete mode 100644 Mac/Contrib/BBPy/source/BBPy_main.c delete mode 100644 Mac/Contrib/PythonDetector/OpenPythonLib delete mode 100644 Mac/Contrib/PythonDetector/OpenPythonLib with NS delete mode 100644 Mac/Contrib/PythonDetector/PythonDetector delete mode 100644 Mac/Contrib/PythonDetector/readme.txt delete mode 100644 Mac/Contrib/PythonScript/PyScriptTest.py delete mode 100644 Mac/Contrib/PythonScript/PythonScript.py delete mode 100644 Mac/Contrib/PythonScript/ReadMe.txt delete mode 100644 Mac/Contrib/PythonScript/baepack.py delete mode 100644 Mac/Contrib/PythonScript/baetools.py delete mode 100644 Mac/Contrib/PythonScript/baetypes.py delete mode 100644 Mac/Contrib/PythonScript/getaete.py delete mode 100644 Mac/Contrib/PythonScript/printaete.py delete mode 100644 Mac/Contrib/PythonScript/testeudora.py delete mode 100644 Mac/Contrib/Sherlock/Python-FAQ.src delete mode 100644 Mac/Contrib/Sherlock/Python-docs.src delete mode 100644 Mac/Contrib/Sherlock/Python.src delete mode 100644 Mac/Contrib/Sherlock/readme.txt delete mode 100644 Mac/Contrib/osam/OSAm.c delete mode 100644 Mac/Contrib/osam/OSAm.exp delete mode 100644 Mac/Contrib/osam/OSAm.h delete mode 100644 Mac/Contrib/osam/OSAm.prj delete mode 100644 Mac/Contrib/osam/ScriptRunner.c delete mode 100644 Mac/Contrib/osam/ScriptRunner.h delete mode 100644 Mac/Demo/PICTbrowse/ICONbrowse.py delete mode 100644 Mac/Demo/PICTbrowse/PICTbrowse.py delete mode 100644 Mac/Demo/PICTbrowse/PICTbrowse.rsrc delete mode 100644 Mac/Demo/PICTbrowse/PICTbrowse2.py delete mode 100644 Mac/Demo/PICTbrowse/cicnbrowse.py delete mode 100644 Mac/Demo/PICTbrowse/oldPICTbrowse.py delete mode 100644 Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc delete mode 100644 Mac/Demo/applescript.html delete mode 100644 Mac/Demo/building.html delete mode 100644 Mac/Demo/calldll/readme delete mode 100644 Mac/Demo/calldll/samplecalldll.py delete mode 100644 Mac/Demo/calldll/testcalldll.py delete mode 100644 Mac/Demo/cgi.html delete mode 100644 Mac/Demo/cgi/cgitest.cgi.py delete mode 100644 Mac/Demo/cgi/cgitest.cgi.rsrc delete mode 100644 Mac/Demo/cgi/realcgitest.py delete mode 100644 Mac/Demo/embed.html delete mode 100644 Mac/Demo/embed/demo.c delete mode 100644 Mac/Demo/embed/embeddemo.prj delete mode 100644 Mac/Demo/example0.html delete mode 100644 Mac/Demo/example0/checktext.py delete mode 100644 Mac/Demo/example1.html delete mode 100644 Mac/Demo/example1/dnslookup-1.gif delete mode 100644 Mac/Demo/example1/dnslookup-1.py delete mode 100644 Mac/Demo/example1/dnslookup-1.rsrc delete mode 100644 Mac/Demo/example2.html delete mode 100644 Mac/Demo/example2/dnslookup-2.gif delete mode 100644 Mac/Demo/example2/dnslookup-2.py delete mode 100644 Mac/Demo/example2/dnslookup-2.rsrc delete mode 100644 Mac/Demo/freezing.html delete mode 100644 Mac/Demo/html.icons/createmake.png delete mode 100644 Mac/Demo/html.icons/mkapplet.gif delete mode 100644 Mac/Demo/html.icons/modulator.gif delete mode 100644 Mac/Demo/html.icons/options.gif delete mode 100644 Mac/Demo/html.icons/preferences.gif delete mode 100644 Mac/Demo/html.icons/python.gif delete mode 100644 Mac/Demo/imgbrowse/imgbrowse.py delete mode 100644 Mac/Demo/imgbrowse/mac_image.py delete mode 100644 Mac/Demo/index.html delete mode 100644 Mac/Demo/interslip/InterslipLib.c delete mode 100644 Mac/Demo/interslip/InterslipLib.h delete mode 100644 Mac/Demo/interslip/interslipmodule.c delete mode 100644 Mac/Demo/mpwextensions.html delete mode 100644 Mac/Demo/plugins.html delete mode 100644 Mac/Demo/printing/PrintingDemo.py delete mode 100644 Mac/Demo/quicktime/MovieInWindow.py delete mode 100644 Mac/Demo/quicktime/VerySimplePlayer.py delete mode 100644 Mac/Demo/resources/copyres.py delete mode 100644 Mac/Demo/resources/listres.py delete mode 100644 Mac/Demo/scripting/Eudora_Suite.py delete mode 100644 Mac/Demo/scripting/Standard_Suite.py delete mode 100644 Mac/Demo/scripting/testeudora.py delete mode 100644 Mac/Demo/sound/morse.py delete mode 100644 Mac/Demo/sound/morselib.py delete mode 100644 Mac/Demo/sound/playaiff.py delete mode 100644 Mac/Demo/speech/SCRIPT delete mode 100644 Mac/Demo/speech/grail.py delete mode 100644 Mac/Demo/speech/hum.py delete mode 100644 Mac/Demo/textedit.html delete mode 100644 Mac/Demo/textedit/ped.py delete mode 100644 Mac/Demo/using.html delete mode 100644 Mac/Demo/waste.html delete mode 100644 Mac/Demo/waste/htmled.py delete mode 100644 Mac/Demo/waste/swed.py delete mode 100644 Mac/Demo/waste/wed.py delete mode 100644 Mac/Distributions/(vise)/Python 1.6.vct delete mode 100644 Mac/Distributions/68k-shared.exclude delete mode 100644 Mac/Distributions/68k-shared.include delete mode 100644 Mac/Distributions/68k-stand.exclude delete mode 100644 Mac/Distributions/68k-stand.include delete mode 100644 Mac/Distributions/binary.exclude delete mode 100644 Mac/Distributions/binary.include delete mode 100644 Mac/Distributions/dev.exclude delete mode 100644 Mac/Distributions/dev.include delete mode 100644 Mac/Distributions/pyexpat-bin.exclude delete mode 100644 Mac/Distributions/pyexpat-bin.include delete mode 100644 Mac/Distributions/readme.txt delete mode 100644 Mac/Distributions/src.exclude delete mode 100644 Mac/Distributions/src.include delete mode 100644 Mac/GUSI-mods/into-include/GUSI.h delete mode 100644 Mac/GUSI-mods/into-include/GUSI_P.h delete mode 100644 Mac/GUSI-mods/into-src/GUSI.r delete mode 100644 Mac/GUSI-mods/into-src/GUSIDispatch.cp delete mode 100644 Mac/GUSI-mods/into-src/GUSINetDB.cp delete mode 100644 Mac/GUSI-mods/into-src/GUSISIOUX.cp delete mode 100644 Mac/HISTORY delete mode 100644 Mac/IDE scripts/ separator --- delete mode 100644 Mac/IDE scripts/Hack/Debugger off delete mode 100644 Mac/IDE scripts/Hack/Debugger on delete mode 100644 Mac/IDE scripts/Hack/Remove .pyc files... delete mode 100644 Mac/IDE scripts/Hack/Toolbox Assistant... delete mode 100644 Mac/IDE scripts/Hold option to open a script... delete mode 100644 Mac/IDE scripts/Insert file name... delete mode 100644 Mac/IDE scripts/Insert folder name... delete mode 100644 Mac/IDE scripts/Search Python Documentation... delete mode 100644 Mac/IDE scripts/Widget demos/ActivateWindowDemo.py delete mode 100644 Mac/IDE scripts/Widget demos/KeyTester.py delete mode 100644 Mac/IDE scripts/Widget demos/ListWindow.py delete mode 100644 Mac/IDE scripts/Widget demos/ModalDialog.py delete mode 100644 Mac/IDE scripts/Widget demos/PaneDemo.py delete mode 100644 Mac/IDE scripts/Widget demos/PaneDemo2.py delete mode 100644 Mac/IDE scripts/Widget demos/ScrollbarWindow.py delete mode 100644 Mac/IDE scripts/Widget demos/TwoLists.py delete mode 100644 Mac/IDE scripts/Widget demos/WidgetTest.py delete mode 100644 Mac/IDE scripts/separator --- delete mode 100644 Mac/Include/config.h delete mode 100644 Mac/Include/getapplbycreator.h delete mode 100644 Mac/Include/macbuildno.h delete mode 100644 Mac/Include/macdefs.h delete mode 100644 Mac/Include/macglue.h delete mode 100644 Mac/Include/pymactoolbox.h delete mode 100644 Mac/Include/pythonresources.h delete mode 100644 Mac/Lib/Audio_mac.py delete mode 100644 Mac/Lib/EasyDialogs.py delete mode 100644 Mac/Lib/FrameWork.py delete mode 100644 Mac/Lib/MACFS.py delete mode 100644 Mac/Lib/PixMapWrapper.py delete mode 100644 Mac/Lib/SoundMgr.py delete mode 100644 Mac/Lib/audiodev.py delete mode 100644 Mac/Lib/buildtools.py delete mode 100644 Mac/Lib/cfmfile.py delete mode 100644 Mac/Lib/dbmac.py delete mode 100644 Mac/Lib/findertools.py delete mode 100644 Mac/Lib/findmodulefiles.py delete mode 100644 Mac/Lib/ic.py delete mode 100644 Mac/Lib/icopen.py delete mode 100644 Mac/Lib/lib-scripting/AppleScript_Suite.py delete mode 100644 Mac/Lib/lib-scripting/CodeWarrior_Standard_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Finder_7_0_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Finder_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Metrowerks_Shell_Suite.py delete mode 100644 Mac/Lib/lib-scripting/QuickDraw_Graphics_Suite.py delete mode 100644 Mac/Lib/lib-scripting/QuickDraw_Graphics_Supplemental delete mode 100644 Mac/Lib/lib-scripting/Required_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Standard_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Standard_URL_suite.py delete mode 100644 Mac/Lib/lib-scripting/Table_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Text_Suite.py delete mode 100644 Mac/Lib/lib-scripting/Type_Names_Suite.py delete mode 100644 Mac/Lib/lib-scripting/WWW_Suite.py delete mode 100644 Mac/Lib/lib-toolbox/AEDataModel.py delete mode 100644 Mac/Lib/lib-toolbox/AEObjects.py delete mode 100644 Mac/Lib/lib-toolbox/AERegistry.py delete mode 100644 Mac/Lib/lib-toolbox/Appearance.py delete mode 100644 Mac/Lib/lib-toolbox/AppleEvents.py delete mode 100644 Mac/Lib/lib-toolbox/Balloons.py delete mode 100644 Mac/Lib/lib-toolbox/Components.py delete mode 100644 Mac/Lib/lib-toolbox/ControlAccessor.py delete mode 100644 Mac/Lib/lib-toolbox/Controls.py delete mode 100644 Mac/Lib/lib-toolbox/Dialogs.py delete mode 100644 Mac/Lib/lib-toolbox/Dragconst.py delete mode 100644 Mac/Lib/lib-toolbox/Events.py delete mode 100644 Mac/Lib/lib-toolbox/Fonts.py delete mode 100644 Mac/Lib/lib-toolbox/Icons.py delete mode 100644 Mac/Lib/lib-toolbox/Lists.py delete mode 100644 Mac/Lib/lib-toolbox/MediaDescr.py delete mode 100644 Mac/Lib/lib-toolbox/Menus.py delete mode 100644 Mac/Lib/lib-toolbox/MiniAEFrame.py delete mode 100644 Mac/Lib/lib-toolbox/QDOffscreen.py delete mode 100644 Mac/Lib/lib-toolbox/QuickDraw.py delete mode 100644 Mac/Lib/lib-toolbox/QuickTime.py delete mode 100644 Mac/Lib/lib-toolbox/Resources.py delete mode 100644 Mac/Lib/lib-toolbox/Sound.py delete mode 100644 Mac/Lib/lib-toolbox/TextEdit.py delete mode 100644 Mac/Lib/lib-toolbox/WASTEconst.py delete mode 100644 Mac/Lib/lib-toolbox/Windows.py delete mode 100644 Mac/Lib/lib-toolbox/aepack.py delete mode 100644 Mac/Lib/lib-toolbox/aetools.py delete mode 100644 Mac/Lib/lib-toolbox/aetypes.py delete mode 100644 Mac/Lib/maccache.py delete mode 100644 Mac/Lib/macerrors.py delete mode 100644 Mac/Lib/macfsn.py delete mode 100644 Mac/Lib/macostools.py delete mode 100644 Mac/Lib/mactty.py delete mode 100644 Mac/Lib/preferences.py delete mode 100644 Mac/Lib/py_resource.py delete mode 100644 Mac/Lib/pythonprefs.py delete mode 100644 Mac/Lib/quietconsole.py delete mode 100644 Mac/Lib/test/AEservertest.py delete mode 100644 Mac/Lib/test/AEservertest.rsrc delete mode 100644 Mac/Lib/test/aete.py delete mode 100644 Mac/Lib/test/cmtest.py delete mode 100644 Mac/Lib/test/ctbtest.py delete mode 100644 Mac/Lib/test/dragtest.py delete mode 100644 Mac/Lib/test/echo.py delete mode 100644 Mac/Lib/test/fgbgtimetest.py delete mode 100644 Mac/Lib/test/icgluetest.py delete mode 100644 Mac/Lib/test/progressbar.py delete mode 100644 Mac/Lib/test/tae.py delete mode 100644 Mac/Lib/test/tctl.py delete mode 100644 Mac/Lib/test/tdlg.py delete mode 100644 Mac/Lib/test/tdlg_modeless.py delete mode 100644 Mac/Lib/test/tell.py delete mode 100644 Mac/Lib/test/test_finder_ae delete mode 100644 Mac/Lib/test/test_setcontroldata.py delete mode 100644 Mac/Lib/test/test_suite.py delete mode 100644 Mac/Lib/test/testfinderopen.py delete mode 100644 Mac/Lib/test/tlist.py delete mode 100644 Mac/Lib/test/tlist_dialog.py delete mode 100644 Mac/Lib/test/tlist_dialog.rsrc delete mode 100644 Mac/Lib/test/tmenu.py delete mode 100644 Mac/Lib/test/tscrollwin.py delete mode 100644 Mac/Lib/test/tsnd.py delete mode 100644 Mac/Lib/test/tte.py delete mode 100644 Mac/Lib/test/ttedit.py delete mode 100644 Mac/Lib/test/twedit.py delete mode 100644 Mac/Lib/test/twin.py delete mode 100644 Mac/MPW/Build delete mode 100644 Mac/MPW/Makefile delete mode 100644 Mac/MPW/README delete mode 100644 Mac/MPW/buildall delete mode 100644 Mac/Modules/ColorPickermodule.c delete mode 100644 Mac/Modules/Nav.c delete mode 100644 Mac/Modules/Printingmodule.c delete mode 100644 Mac/Modules/ae/AEmodule.c delete mode 100644 Mac/Modules/ae/README delete mode 100644 Mac/Modules/ae/aescan.py delete mode 100644 Mac/Modules/ae/aesupport.py delete mode 100644 Mac/Modules/ae/nsremote.py delete mode 100644 Mac/Modules/app/Appmodule.c delete mode 100644 Mac/Modules/app/appscan.py delete mode 100644 Mac/Modules/app/appsupport.py delete mode 100644 Mac/Modules/calldll.c delete mode 100644 Mac/Modules/cm/Cmmodule.c delete mode 100644 Mac/Modules/cm/cmscan.py delete mode 100644 Mac/Modules/cm/cmsupport.py delete mode 100644 Mac/Modules/ctbmodule.c delete mode 100644 Mac/Modules/ctl/Ctlmodule.c delete mode 100644 Mac/Modules/ctl/ctledit.py delete mode 100644 Mac/Modules/ctl/ctlscan.py delete mode 100644 Mac/Modules/ctl/ctlsupport.py delete mode 100644 Mac/Modules/dlg/Dlgmodule.c delete mode 100644 Mac/Modules/dlg/dlgscan.py delete mode 100644 Mac/Modules/dlg/dlgsupport.py delete mode 100644 Mac/Modules/drag/Dragmodule.c delete mode 100644 Mac/Modules/drag/dragscan.py delete mode 100644 Mac/Modules/drag/dragsupport.py delete mode 100644 Mac/Modules/evt/Evtmodule.c delete mode 100644 Mac/Modules/evt/evtedit.py delete mode 100644 Mac/Modules/evt/evtscan.py delete mode 100644 Mac/Modules/evt/evtsupport.py delete mode 100644 Mac/Modules/fm/Fmmodule.c delete mode 100644 Mac/Modules/fm/fmscan.py delete mode 100644 Mac/Modules/fm/fmsupport.py delete mode 100644 Mac/Modules/gestaltmodule.c delete mode 100644 Mac/Modules/help/Helpmodule.c delete mode 100644 Mac/Modules/help/helpscan.py delete mode 100644 Mac/Modules/help/helpsupport.py delete mode 100644 Mac/Modules/htmlrender/HtmlRendermodule.c delete mode 100644 Mac/Modules/htmlrender/htmlscan.py delete mode 100644 Mac/Modules/htmlrender/htmlsupport.py delete mode 100644 Mac/Modules/icgluemodule.c delete mode 100644 Mac/Modules/icn/Icnmodule.c delete mode 100644 Mac/Modules/icn/icnscan.py delete mode 100644 Mac/Modules/icn/icnsupport.py delete mode 100644 Mac/Modules/list/Listmodule.c delete mode 100644 Mac/Modules/list/listscan.py delete mode 100644 Mac/Modules/list/listsupport.py delete mode 100644 Mac/Modules/macconfig.c delete mode 100644 Mac/Modules/macfsmodule.c delete mode 100644 Mac/Modules/macmodule.c delete mode 100644 Mac/Modules/macosmodule.c delete mode 100644 Mac/Modules/macspeech/README delete mode 100644 Mac/Modules/macspeechmodule.c delete mode 100644 Mac/Modules/menu/Menumodule.c delete mode 100644 Mac/Modules/menu/menuedit.py delete mode 100644 Mac/Modules/menu/menuscan.py delete mode 100644 Mac/Modules/menu/menusupport.py delete mode 100644 Mac/Modules/qd/Qdmodule.c delete mode 100644 Mac/Modules/qd/qdedit.py delete mode 100644 Mac/Modules/qd/qdscan.py delete mode 100644 Mac/Modules/qd/qdsupport.py delete mode 100644 Mac/Modules/qdoffs/Qdoffsmodule.c delete mode 100644 Mac/Modules/qdoffs/qdoffsscan.py delete mode 100644 Mac/Modules/qdoffs/qdoffssupport.py delete mode 100644 Mac/Modules/qt/Qtmodule.c delete mode 100644 Mac/Modules/qt/qtscan.py delete mode 100644 Mac/Modules/qt/qtsupport.py delete mode 100644 Mac/Modules/res/Resmodule.c delete mode 100644 Mac/Modules/res/resedit.py delete mode 100644 Mac/Modules/res/resscan.py delete mode 100644 Mac/Modules/res/ressupport.py delete mode 100644 Mac/Modules/scrap/Scrapmodule.c delete mode 100644 Mac/Modules/scrap/scrapscan.py delete mode 100644 Mac/Modules/scrap/scrapsupport.py delete mode 100644 Mac/Modules/snd/Sndihooks.c delete mode 100644 Mac/Modules/snd/Sndmodule.c delete mode 100644 Mac/Modules/snd/sndscan.py delete mode 100644 Mac/Modules/snd/sndsupport.py delete mode 100644 Mac/Modules/te/TEmodule.c delete mode 100644 Mac/Modules/te/tescan.py delete mode 100644 Mac/Modules/te/tesupport.py delete mode 100644 Mac/Modules/waste/wastemodule.c delete mode 100644 Mac/Modules/waste/wastescan.py delete mode 100644 Mac/Modules/waste/wastesupport.py delete mode 100644 Mac/Modules/win/Winmodule.c delete mode 100644 Mac/Modules/win/winedit.py delete mode 100644 Mac/Modules/win/winscan.py delete mode 100644 Mac/Modules/win/winsupport.py delete mode 100644 Mac/PlugIns/readme.txt delete mode 100644 Mac/Python/getapplbycreator.c delete mode 100644 Mac/Python/gusiconfig.cpp delete mode 100644 Mac/Python/macapplication.c delete mode 100644 Mac/Python/macgetargv.c delete mode 100644 Mac/Python/macgetcompiler.c delete mode 100644 Mac/Python/macgetpath.c delete mode 100644 Mac/Python/macgetplatform.c delete mode 100644 Mac/Python/macglue.c delete mode 100644 Mac/Python/macimport.c delete mode 100644 Mac/Python/macmain.c delete mode 100644 Mac/Python/macsetfiletype.c delete mode 100644 Mac/Python/macshlglue.c delete mode 100644 Mac/Python/missingtoolboxcalls.c delete mode 100644 Mac/ReadMe delete mode 100644 Mac/ReadMe-dev delete mode 100644 Mac/ReadMe-src delete mode 100644 Mac/Relnotes delete mode 100644 Mac/Resources/Carbon.r delete mode 100644 Mac/Resources/balloons.bh delete mode 100644 Mac/Resources/bundle.rsrc delete mode 100644 Mac/Resources/dialogs.rsrc delete mode 100644 Mac/Resources/errors.rsrc delete mode 100644 Mac/Resources/gusiprefs.rsrc delete mode 100644 Mac/Resources/pythonpath.r delete mode 100644 Mac/Resources/tkpython.rsrc delete mode 100644 Mac/Resources/version.r delete mode 100644 Mac/Tools/CGI/BuildCGIApplet.py delete mode 100644 Mac/Tools/CGI/BuildCGIApplet.rsrc delete mode 100644 Mac/Tools/CGI/CGI_README.txt delete mode 100644 Mac/Tools/CGI/PythonCGISlave.py delete mode 100644 Mac/Tools/CGI/PythonCGISlave.rsrc delete mode 100644 Mac/Tools/IDE/BuildIDE.py delete mode 100644 Mac/Tools/IDE/FontSettings.py delete mode 100644 Mac/Tools/IDE/MacPrefs.py delete mode 100644 Mac/Tools/IDE/ModuleBrowser.py delete mode 100644 Mac/Tools/IDE/ProfileBrowser.py delete mode 100644 Mac/Tools/IDE/PyBrowser.py delete mode 100644 Mac/Tools/IDE/PyConsole.py delete mode 100644 Mac/Tools/IDE/PyDebugger.py delete mode 100644 Mac/Tools/IDE/PyDocSearch.py delete mode 100644 Mac/Tools/IDE/PyEdit.py delete mode 100644 Mac/Tools/IDE/PyFontify.py delete mode 100644 Mac/Tools/IDE/PyInteractive.py delete mode 100644 Mac/Tools/IDE/PythonIDE.py delete mode 100644 Mac/Tools/IDE/PythonIDE.rsrc delete mode 100644 Mac/Tools/IDE/PythonIDEMain.py delete mode 100644 Mac/Tools/IDE/Splash.py delete mode 100644 Mac/Tools/IDE/W.py delete mode 100644 Mac/Tools/IDE/Wapplication.py delete mode 100644 Mac/Tools/IDE/Wbase.py delete mode 100644 Mac/Tools/IDE/Wcontrols.py delete mode 100644 Mac/Tools/IDE/Widgets.rsrc delete mode 100644 Mac/Tools/IDE/Wkeys.py delete mode 100644 Mac/Tools/IDE/Wlists.py delete mode 100644 Mac/Tools/IDE/Wmenus.py delete mode 100644 Mac/Tools/IDE/Wminiapp.py delete mode 100644 Mac/Tools/IDE/Wquicktime.py delete mode 100644 Mac/Tools/IDE/Wsocket.py delete mode 100644 Mac/Tools/IDE/Wtext.py delete mode 100644 Mac/Tools/IDE/Wtraceback.py delete mode 100644 Mac/Tools/IDE/Wwindows.py delete mode 100644 Mac/Tools/macfreeze/directives.py delete mode 100644 Mac/Tools/macfreeze/hello/hello.py delete mode 100644 Mac/Tools/macfreeze/macfreeze.py delete mode 100644 Mac/Tools/macfreeze/macfreeze.rsrc delete mode 100644 Mac/Tools/macfreeze/macfreezegui.py delete mode 100644 Mac/Tools/macfreeze/macgen_bin.py delete mode 100644 Mac/Tools/macfreeze/macgen_info.py delete mode 100644 Mac/Tools/macfreeze/macgen_rsrc.py delete mode 100644 Mac/Tools/macfreeze/macgen_src.py delete mode 100644 Mac/Tools/macfreeze/macgenerate.py delete mode 100644 Mac/Tools/macfreeze/macmodulefinder.py delete mode 100644 Mac/Tools/twit/TwitCore.py delete mode 100644 Mac/Tools/twit/mac_widgets.py delete mode 100644 Mac/Tools/twit/mactwit_app.py delete mode 100644 Mac/Tools/twit/mactwit_browser.py delete mode 100644 Mac/Tools/twit/mactwit_edit.py delete mode 100644 Mac/Tools/twit/mactwit_mod.py delete mode 100644 Mac/Tools/twit/mactwit_stack.py delete mode 100644 Mac/Tools/twit/twit.py delete mode 100644 Mac/Tools/twit/twit.rsrc delete mode 100644 Mac/Tools/twit/twittest.py delete mode 100644 Mac/Unsupported/mactcp/MACTCPconst.py delete mode 100644 Mac/Unsupported/mactcp/MacTCPerrors.py delete mode 100644 Mac/Unsupported/mactcp/dnrglue.c delete mode 100644 Mac/Unsupported/mactcp/macdnrmodule.c delete mode 100644 Mac/Unsupported/mactcp/mactcpmodule.c delete mode 100644 Mac/Unsupported/mactcp/mactcpmodules.mu.exp delete mode 100644 Mac/Unsupported/mactcp/mactcpmodules.mu.hqx delete mode 100644 Mac/Unsupported/mactcp/socket.py delete mode 100644 Mac/Unsupported/mactcp/tcpglue.c delete mode 100644 Mac/Unsupported/mactcp/tcpglue.h delete mode 100644 Mac/Unsupported/stdwinmodule.mu.exp delete mode 100644 Mac/Unsupported/stdwinmodule.mu.hqx delete mode 100644 Mac/_checkversion.py delete mode 100644 Mac/errno_unix.h delete mode 100644 Mac/fopenRF.c delete mode 100644 Mac/mkapplet.py delete mode 100644 Mac/mwerks/errno_unix.h delete mode 100644 Mac/mwerks/macuseshlstart.c delete mode 100644 Mac/mwerks/malloc/README delete mode 100644 Mac/mwerks/malloc/calloc.c delete mode 100644 Mac/mwerks/malloc/malloc.c delete mode 100644 Mac/mwerks/mwerks_applet_config.h delete mode 100644 Mac/mwerks/mwerks_carbon_config.h delete mode 100644 Mac/mwerks/mwerks_config.h delete mode 100644 Mac/mwerks/mwerks_nonshared_config.h delete mode 100644 Mac/mwerks/mwerks_plugin_config.h delete mode 100644 Mac/mwerks/mwerks_shared_config.h delete mode 100644 Mac/mwerks/mwerks_shlib_config.h delete mode 100644 Mac/mwerks/mwerks_small_config.h delete mode 100644 Mac/mwerks/mwerks_threadsmall_config.h delete mode 100644 Mac/mwerks/mwerks_tkplugin_config.h delete mode 100644 Mac/mwerks/mwfopenrf.c delete mode 100644 Mac/mwerks/old/mwerks_cfm68k_config.h delete mode 100644 Mac/mwerks/old/mwerks_nsgusi_config.h delete mode 100644 Mac/mwerks/old/mwerks_nsgusitk_config.h delete mode 100644 Mac/mwerks/old/mwerks_shgusi_config.h delete mode 100644 Mac/mwerks/old/mwerks_tk_config.h delete mode 100644 Mac/mwerks/projects/README-Projectfiles delete mode 100644 Mac/mwerks/projects/build.macfreeze/frozen.prj delete mode 100644 Mac/mwerks/projects/build.macfreeze/frozenbundle.rsrc delete mode 100644 Mac/mwerks/projects/build.macfreeze/templatefrozenconfig.c delete mode 100644 Mac/mwerksglue.c delete mode 100644 Mac/scripts/BuildApplet.py delete mode 100644 Mac/scripts/BuildApplet.rsrc delete mode 100644 Mac/scripts/BuildApplication.py delete mode 100644 Mac/scripts/BuildApplication.rsrc delete mode 100644 Mac/scripts/ConfigurePython.py delete mode 100644 Mac/scripts/ConfigurePython.rsrc delete mode 100644 Mac/scripts/EditPythonPrefs.py delete mode 100644 Mac/scripts/EditPythonPrefs.rsrc delete mode 100644 Mac/scripts/EditPythonPrefsBH.bh delete mode 100644 Mac/scripts/EditPythonPrefsBH.prj delete mode 100644 Mac/scripts/EditPythonPrefsBH.rsrc delete mode 100644 Mac/scripts/FixCreator.py delete mode 100644 Mac/scripts/MkDistr.py delete mode 100644 Mac/scripts/MkDistr.rsrc delete mode 100644 Mac/scripts/MkDistr_ui.py delete mode 100644 Mac/scripts/PackLibDir.py delete mode 100644 Mac/scripts/PackLibDir.rsrc delete mode 100644 Mac/scripts/RunLibScript.py delete mode 100644 Mac/scripts/RunLibScript.rsrc delete mode 100644 Mac/scripts/binhextree.py delete mode 100644 Mac/scripts/cfmfile.py delete mode 100755 Mac/scripts/crlf.py delete mode 100644 Mac/scripts/errors.txt delete mode 100644 Mac/scripts/findgremlins.py delete mode 100644 Mac/scripts/fixfiletypes.py delete mode 100644 Mac/scripts/fixgusidir.py delete mode 100644 Mac/scripts/fullbuild.py delete mode 100644 Mac/scripts/fullbuild.rsrc delete mode 100644 Mac/scripts/gensuitemodule.py delete mode 100644 Mac/scripts/makeclean.py delete mode 100644 Mac/scripts/mkestrres-errno.h delete mode 100644 Mac/scripts/mkestrres.py delete mode 100644 Mac/scripts/mkfrozenresources.py delete mode 100644 Mac/scripts/run.py delete mode 100644 Mac/scripts/unshar.py delete mode 100644 Mac/tclmods/license-terms.txt delete mode 100644 Mac/tclmods/tclMacNotify.c delete mode 100644 Mac/tclmods/tclSelectNotify.c delete mode 100644 Makefile.in delete mode 100644 Misc/ACKS delete mode 100644 Misc/AIX-NOTES delete mode 100644 Misc/BLURB delete mode 100644 Misc/BLURB.LUTZ delete mode 100644 Misc/BLURB.WINDOWS delete mode 100644 Misc/COPYRIGHT delete mode 100755 Misc/Fixcprt.py delete mode 100644 Misc/HISTORY delete mode 100644 Misc/HPUX-NOTES delete mode 100644 Misc/HYPE delete mode 100644 Misc/Makefile delete mode 100644 Misc/Makefile.pre.in delete mode 100644 Misc/NEWS delete mode 100644 Misc/NEXT-NOTES delete mode 100644 Misc/PURIFY.README delete mode 100644 Misc/Porting delete mode 100644 Misc/README delete mode 100644 Misc/RENAME delete mode 100644 Misc/RFD delete mode 100644 Misc/bugrelease.txt delete mode 100644 Misc/ccpy-style.el delete mode 100644 Misc/cheatsheet delete mode 100644 Misc/comparisons delete mode 100644 Misc/editline-fix delete mode 100755 Misc/faq2html.py delete mode 100755 Misc/fixfuncptrs.sh delete mode 100644 Misc/indent.pro delete mode 100644 Misc/legalfaq.txt delete mode 100644 Misc/python-mode.el delete mode 100644 Misc/python.man delete mode 100755 Misc/renumber.py delete mode 100644 Misc/setuid-prog.c delete mode 100644 Misc/unicode.txt delete mode 100644 Misc/vgrindefs delete mode 100644 Misc/wetsign.txt delete mode 100644 Modules/.cvsignore delete mode 100644 Modules/Makefile.pre.in delete mode 100644 Modules/Setup.config.in delete mode 100644 Modules/Setup.in delete mode 100644 Modules/_codecsmodule.c delete mode 100644 Modules/_cursesmodule.c delete mode 100644 Modules/_localemodule.c delete mode 100644 Modules/_sre.c delete mode 100644 Modules/_tkinter.c delete mode 100644 Modules/almodule.c delete mode 100644 Modules/arraymodule.c delete mode 100644 Modules/audioop.c delete mode 100644 Modules/binascii.c delete mode 100644 Modules/bsddbmodule.c delete mode 100644 Modules/cPickle.c delete mode 100644 Modules/cStringIO.c delete mode 100644 Modules/ccpython.cc delete mode 100644 Modules/cdmodule.c delete mode 100644 Modules/cgen.py delete mode 100644 Modules/cgensupport.c delete mode 100644 Modules/cgensupport.h delete mode 100644 Modules/clmodule.c delete mode 100644 Modules/cmathmodule.c delete mode 100644 Modules/config.c.in delete mode 100644 Modules/cryptmodule.c delete mode 100644 Modules/cstubs delete mode 100644 Modules/dbmmodule.c delete mode 100644 Modules/dlmodule.c delete mode 100644 Modules/errnomodule.c delete mode 100644 Modules/fcntlmodule.c delete mode 100644 Modules/flmodule.c delete mode 100644 Modules/fmmodule.c delete mode 100644 Modules/fpectlmodule.c delete mode 100644 Modules/fpetestmodule.c delete mode 100644 Modules/gcmodule.c delete mode 100644 Modules/gdbmmodule.c delete mode 100644 Modules/getbuildinfo.c delete mode 100644 Modules/getpath.c delete mode 100644 Modules/glmodule.c delete mode 100644 Modules/grpmodule.c delete mode 100644 Modules/imageop.c delete mode 100644 Modules/imgfile.c delete mode 100755 Modules/ld_so_aix delete mode 100644 Modules/license.terms delete mode 100644 Modules/linuxaudiodev.c delete mode 100644 Modules/main.c delete mode 100755 Modules/makesetup delete mode 100755 Modules/makexp_aix delete mode 100644 Modules/mathmodule.c delete mode 100644 Modules/md5.h delete mode 100644 Modules/md5c.c delete mode 100644 Modules/md5module.c delete mode 100644 Modules/mmapmodule.c delete mode 100644 Modules/mpzmodule.c delete mode 100644 Modules/newmodule.c delete mode 100644 Modules/nismodule.c delete mode 100644 Modules/operator.c delete mode 100644 Modules/parsermodule.c delete mode 100644 Modules/pcre-int.h delete mode 100644 Modules/pcre.h delete mode 100644 Modules/pcremodule.c delete mode 100644 Modules/posixmodule.c delete mode 100644 Modules/puremodule.c delete mode 100644 Modules/pwdmodule.c delete mode 100644 Modules/pyexpat.c delete mode 100644 Modules/pypcre.c delete mode 100644 Modules/python.c delete mode 100644 Modules/readline.c delete mode 100644 Modules/regexmodule.c delete mode 100644 Modules/regexpr.c delete mode 100644 Modules/regexpr.h delete mode 100644 Modules/resource.c delete mode 100644 Modules/rgbimgmodule.c delete mode 100644 Modules/rotormodule.c delete mode 100644 Modules/selectmodule.c delete mode 100644 Modules/sgimodule.c delete mode 100644 Modules/shamodule.c delete mode 100644 Modules/signalmodule.c delete mode 100644 Modules/socketmodule.c delete mode 100644 Modules/soundex.c delete mode 100644 Modules/sre.h delete mode 100644 Modules/sre_constants.h delete mode 100644 Modules/stropmodule.c delete mode 100644 Modules/structmodule.c delete mode 100644 Modules/sunaudiodev.c delete mode 100644 Modules/svmodule.c delete mode 100644 Modules/syslogmodule.c delete mode 100644 Modules/tclNotify.c delete mode 100644 Modules/termios.c delete mode 100644 Modules/threadmodule.c delete mode 100644 Modules/timemodule.c delete mode 100644 Modules/timing.h delete mode 100644 Modules/timingmodule.c delete mode 100644 Modules/tkappinit.c delete mode 100644 Modules/ucnhash.c delete mode 100644 Modules/unicodedata.c delete mode 100644 Modules/unicodedatabase.c delete mode 100644 Modules/unicodedatabase.h delete mode 100644 Modules/xxmodule.c delete mode 100644 Modules/yuv.h delete mode 100644 Modules/yuvconvert.c delete mode 100644 Modules/zlibmodule.c delete mode 100644 Objects/.cvsignore delete mode 100644 Objects/Makefile.in delete mode 100644 Objects/abstract.c delete mode 100644 Objects/bufferobject.c delete mode 100644 Objects/classobject.c delete mode 100644 Objects/cobject.c delete mode 100644 Objects/complexobject.c delete mode 100644 Objects/dictobject.c delete mode 100644 Objects/fileobject.c delete mode 100644 Objects/floatobject.c delete mode 100644 Objects/frameobject.c delete mode 100644 Objects/funcobject.c delete mode 100644 Objects/intobject.c delete mode 100644 Objects/listobject.c delete mode 100644 Objects/longobject.c delete mode 100644 Objects/methodobject.c delete mode 100644 Objects/moduleobject.c delete mode 100644 Objects/object.c delete mode 100644 Objects/rangeobject.c delete mode 100644 Objects/sliceobject.c delete mode 100644 Objects/stringobject.c delete mode 100644 Objects/tupleobject.c delete mode 100644 Objects/typeobject.c delete mode 100644 Objects/unicodectype.c delete mode 100644 Objects/unicodeobject.c delete mode 100644 Objects/xxobject.c delete mode 100644 PC/WinMain.c delete mode 100644 PC/_winreg.c delete mode 100644 PC/config.c delete mode 100644 PC/config.h delete mode 100644 PC/dl_nt.c delete mode 100644 PC/dllbase_nt.txt delete mode 100644 PC/example_nt/.cvsignore delete mode 100644 PC/example_nt/example.c delete mode 100644 PC/example_nt/example.def delete mode 100644 PC/example_nt/example.dsp delete mode 100644 PC/example_nt/example.dsw delete mode 100644 PC/example_nt/readme.txt delete mode 100644 PC/frozen_dllmain.c delete mode 100644 PC/getpathp.c delete mode 100644 PC/import_nt.c delete mode 100644 PC/make8x3.py delete mode 100644 PC/makesrc.exe delete mode 100755 PC/msvcrtmodule.c delete mode 100644 PC/os2vacpp/_tkinter.def delete mode 100644 PC/os2vacpp/config.c delete mode 100644 PC/os2vacpp/config.h delete mode 100644 PC/os2vacpp/getpathp.c delete mode 100644 PC/os2vacpp/makefile delete mode 100644 PC/os2vacpp/makefile.omk delete mode 100644 PC/os2vacpp/python.def delete mode 100644 PC/os2vacpp/readme.txt delete mode 100644 PC/py.ico delete mode 100644 PC/pyc.ico delete mode 100644 PC/pycon.ico delete mode 100644 PC/pyth_w31.def delete mode 100644 PC/python.mk delete mode 100644 PC/python.wpj delete mode 100644 PC/python_exe.rc delete mode 100644 PC/python_nt.rc delete mode 100644 PC/readme.txt delete mode 100644 PC/src/readme.txt delete mode 100644 PC/testpy.py delete mode 100755 PC/utils/makesrc.c delete mode 100755 PC/utils/makesrc.lk1 delete mode 100755 PC/utils/makesrc.mk1 delete mode 100755 PC/utils/makesrc.tgt delete mode 100755 PC/utils/utils.mk delete mode 100755 PC/utils/utils.wpj delete mode 100644 PC/vc15_lib/_.c delete mode 100644 PC/vc15_lib/python.mak delete mode 100644 PC/vc15_lib/python.vcw delete mode 100644 PC/vc15_lib/python.wsp delete mode 100644 PC/vc15_w31/_.c delete mode 100644 PC/vc15_w31/pyth_w31.mak delete mode 100644 PC/vc15_w31/pyth_w31.pdb delete mode 100644 PC/vc15_w31/pyth_w31.vcw delete mode 100644 PC/vc15_w31/pyth_w31.wsp delete mode 100644 PC/w9xpopen.c delete mode 100755 PC/wat_dos/pyth_dos.lk1 delete mode 100755 PC/wat_dos/pyth_dos.mk1 delete mode 100755 PC/wat_dos/pyth_dos.tgt delete mode 100755 PC/wat_os2/pyth_os2.lk1 delete mode 100755 PC/wat_os2/pyth_os2.mk1 delete mode 100755 PC/wat_os2/pyth_os2.tgt delete mode 100644 PC/winsound.c delete mode 100644 PCbuild/.cvsignore delete mode 100755 PCbuild/_socket.dsp delete mode 100755 PCbuild/_sre.dsp delete mode 100644 PCbuild/_tkinter.dsp delete mode 100644 PCbuild/bsddb.dsp delete mode 100644 PCbuild/mmap.dsp delete mode 100644 PCbuild/parser.dsp delete mode 100644 PCbuild/pcbuild.dsw delete mode 100755 PCbuild/pyexpat.dsp delete mode 100644 PCbuild/python.dsp delete mode 100644 PCbuild/python20.dsp delete mode 100644 PCbuild/python20.wse delete mode 100644 PCbuild/pythonw.dsp delete mode 100644 PCbuild/readme.txt delete mode 100755 PCbuild/select.dsp delete mode 100644 PCbuild/ucnhash.dsp delete mode 100755 PCbuild/unicodedata.dsp delete mode 100644 PCbuild/w9xpopen.dsp delete mode 100644 PCbuild/winreg.dsp delete mode 100644 PCbuild/winsound.dsp delete mode 100644 PCbuild/zlib.dsp delete mode 100644 Parser/.cvsignore delete mode 100644 Parser/Makefile.in delete mode 100644 Parser/acceler.c delete mode 100644 Parser/assert.h delete mode 100644 Parser/bitset.c delete mode 100644 Parser/firstsets.c delete mode 100644 Parser/grammar.c delete mode 100644 Parser/grammar1.c delete mode 100644 Parser/intrcheck.c delete mode 100644 Parser/listnode.c delete mode 100644 Parser/metagrammar.c delete mode 100644 Parser/myreadline.c delete mode 100644 Parser/node.c delete mode 100644 Parser/parser.c delete mode 100644 Parser/parser.h delete mode 100644 Parser/parsetok.c delete mode 100644 Parser/pgen.c delete mode 100644 Parser/pgen.h delete mode 100644 Parser/pgenmain.c delete mode 100644 Parser/printgrammar.c delete mode 100644 Parser/tokenizer.c delete mode 100644 Parser/tokenizer.h delete mode 100644 Python/.cvsignore delete mode 100644 Python/Makefile.in delete mode 100644 Python/atof.c delete mode 100644 Python/bltinmodule.c delete mode 100644 Python/ceval.c delete mode 100644 Python/codecs.c delete mode 100644 Python/compile.c delete mode 100644 Python/dup2.c delete mode 100644 Python/dynload_aix.c delete mode 100644 Python/dynload_beos.c delete mode 100644 Python/dynload_dl.c delete mode 100644 Python/dynload_hpux.c delete mode 100644 Python/dynload_mac.c delete mode 100644 Python/dynload_next.c delete mode 100644 Python/dynload_os2.c delete mode 100644 Python/dynload_shlib.c delete mode 100644 Python/dynload_stub.c delete mode 100644 Python/dynload_win.c delete mode 100644 Python/errors.c delete mode 100644 Python/exceptions.c delete mode 100644 Python/fmod.c delete mode 100644 Python/frozen.c delete mode 100644 Python/frozenmain.c delete mode 100644 Python/getargs.c delete mode 100644 Python/getcompiler.c delete mode 100644 Python/getcopyright.c delete mode 100644 Python/getcwd.c delete mode 100644 Python/getmtime.c delete mode 100644 Python/getopt.c delete mode 100644 Python/getplatform.c delete mode 100644 Python/getversion.c delete mode 100644 Python/graminit.c delete mode 100644 Python/hypot.c delete mode 100644 Python/import.c delete mode 100644 Python/importdl.c delete mode 100644 Python/importdl.h delete mode 100644 Python/marshal.c delete mode 100644 Python/memmove.c delete mode 100644 Python/modsupport.c delete mode 100644 Python/mystrtoul.c delete mode 100644 Python/pyfpe.c delete mode 100644 Python/pystate.c delete mode 100644 Python/pythonmain.c delete mode 100644 Python/pythonrun.c delete mode 100644 Python/sigcheck.c delete mode 100644 Python/strdup.c delete mode 100644 Python/strerror.c delete mode 100644 Python/strtod.c delete mode 100644 Python/structmember.c delete mode 100644 Python/sysmodule.c delete mode 100644 Python/thread.c delete mode 100644 Python/thread_beos.h delete mode 100644 Python/thread_cthread.h delete mode 100644 Python/thread_foobar.h delete mode 100644 Python/thread_lwp.h delete mode 100644 Python/thread_nt.h delete mode 100644 Python/thread_os2.h delete mode 100644 Python/thread_pth.h delete mode 100644 Python/thread_pthread.h delete mode 100644 Python/thread_sgi.h delete mode 100644 Python/thread_solaris.h delete mode 100644 Python/thread_wince.h delete mode 100644 Python/traceback.c delete mode 100644 README delete mode 100644 Tools/README delete mode 100644 Tools/audiopy/README delete mode 100755 Tools/audiopy/audiopy delete mode 100644 Tools/bgen/README delete mode 100644 Tools/bgen/bgen/bgen.py delete mode 100644 Tools/bgen/bgen/bgenBuffer.py delete mode 100644 Tools/bgen/bgen/bgenGenerator.py delete mode 100644 Tools/bgen/bgen/bgenGeneratorGroup.py delete mode 100644 Tools/bgen/bgen/bgenHeapBuffer.py delete mode 100644 Tools/bgen/bgen/bgenModule.py delete mode 100644 Tools/bgen/bgen/bgenObjectDefinition.py delete mode 100644 Tools/bgen/bgen/bgenOutput.py delete mode 100644 Tools/bgen/bgen/bgenStackBuffer.py delete mode 100644 Tools/bgen/bgen/bgenStringBuffer.py delete mode 100644 Tools/bgen/bgen/bgenType.py delete mode 100644 Tools/bgen/bgen/bgenVariable.py delete mode 100644 Tools/bgen/bgen/bgenlocations.py delete mode 100644 Tools/bgen/bgen/macsupport.py delete mode 100644 Tools/bgen/bgen/scantools.py delete mode 100644 Tools/compiler/compile.py delete mode 100644 Tools/compiler/compiler/__init__.py delete mode 100644 Tools/compiler/compiler/ast.py delete mode 100644 Tools/compiler/compiler/consts.py delete mode 100644 Tools/compiler/compiler/misc.py delete mode 100644 Tools/compiler/compiler/pyassem.py delete mode 100644 Tools/compiler/compiler/pycodegen.py delete mode 100644 Tools/compiler/compiler/transformer.py delete mode 100644 Tools/compiler/compiler/visitor.py delete mode 100755 Tools/compiler/demo.py delete mode 100644 Tools/faqwiz/README delete mode 100644 Tools/faqwiz/faqconf.py delete mode 100644 Tools/faqwiz/faqcust.py delete mode 100755 Tools/faqwiz/faqw.py delete mode 100644 Tools/faqwiz/faqwiz.py delete mode 100644 Tools/freeze/.cvsignore delete mode 100644 Tools/freeze/README delete mode 100644 Tools/freeze/bkfile.py delete mode 100644 Tools/freeze/checkextensions.py delete mode 100644 Tools/freeze/checkextensions_win32.py delete mode 100644 Tools/freeze/extensions_win32.ini delete mode 100755 Tools/freeze/freeze.py delete mode 100644 Tools/freeze/hello.py delete mode 100644 Tools/freeze/makeconfig.py delete mode 100644 Tools/freeze/makefreeze.py delete mode 100644 Tools/freeze/makemakefile.py delete mode 100644 Tools/freeze/modulefinder.py delete mode 100644 Tools/freeze/parsesetup.py delete mode 100644 Tools/freeze/win32.html delete mode 100644 Tools/freeze/winmakemakefile.py delete mode 100755 Tools/i18n/pygettext.py delete mode 100644 Tools/idle/AutoExpand.py delete mode 100644 Tools/idle/AutoIndent.py delete mode 100644 Tools/idle/Bindings.py delete mode 100755 Tools/idle/BrowserControl.py delete mode 100644 Tools/idle/CallTipWindow.py delete mode 100644 Tools/idle/CallTips.py delete mode 100644 Tools/idle/ChangeLog delete mode 100644 Tools/idle/ClassBrowser.py delete mode 100644 Tools/idle/ColorDelegator.py delete mode 100644 Tools/idle/Debugger.py delete mode 100644 Tools/idle/Delegator.py delete mode 100644 Tools/idle/EditorWindow.py delete mode 100644 Tools/idle/FileList.py delete mode 100644 Tools/idle/FormatParagraph.py delete mode 100644 Tools/idle/FrameViewer.py delete mode 100644 Tools/idle/GrepDialog.py delete mode 100644 Tools/idle/IOBinding.py delete mode 100644 Tools/idle/Icons/folder.gif delete mode 100644 Tools/idle/Icons/minusnode.gif delete mode 100644 Tools/idle/Icons/openfolder.gif delete mode 100644 Tools/idle/Icons/plusnode.gif delete mode 100644 Tools/idle/Icons/python.gif delete mode 100644 Tools/idle/Icons/tk.gif delete mode 100644 Tools/idle/IdleConf.py delete mode 100644 Tools/idle/IdleHistory.py delete mode 100644 Tools/idle/MultiScrolledLists.py delete mode 100644 Tools/idle/MultiStatusBar.py delete mode 100644 Tools/idle/NEWS.txt delete mode 100644 Tools/idle/ObjectBrowser.py delete mode 100644 Tools/idle/OldStackViewer.py delete mode 100644 Tools/idle/OutputWindow.py delete mode 100644 Tools/idle/ParenMatch.py delete mode 100644 Tools/idle/PathBrowser.py delete mode 100644 Tools/idle/Percolator.py delete mode 100644 Tools/idle/PyParse.py delete mode 100644 Tools/idle/PyShell.py delete mode 100644 Tools/idle/README.txt delete mode 100644 Tools/idle/RemoteInterp.py delete mode 100644 Tools/idle/ReplaceDialog.py delete mode 100644 Tools/idle/ScriptBinding.py delete mode 100644 Tools/idle/ScrolledList.py delete mode 100644 Tools/idle/SearchBinding.py delete mode 100644 Tools/idle/SearchDialog.py delete mode 100644 Tools/idle/SearchDialogBase.py delete mode 100644 Tools/idle/SearchEngine.py delete mode 100644 Tools/idle/Separator.py delete mode 100644 Tools/idle/StackViewer.py delete mode 100644 Tools/idle/TODO.txt delete mode 100644 Tools/idle/ToolTip.py delete mode 100644 Tools/idle/TreeWidget.py delete mode 100644 Tools/idle/UndoDelegator.py delete mode 100644 Tools/idle/WidgetRedirector.py delete mode 100644 Tools/idle/WindowList.py delete mode 100644 Tools/idle/ZoomHeight.py delete mode 100644 Tools/idle/__init__.py delete mode 100644 Tools/idle/config-unix.txt delete mode 100644 Tools/idle/config-win.txt delete mode 100644 Tools/idle/config.txt delete mode 100644 Tools/idle/eventparse.py delete mode 100644 Tools/idle/extend.txt delete mode 100644 Tools/idle/help.txt delete mode 100644 Tools/idle/idle.bat delete mode 100755 Tools/idle/idle.py delete mode 100644 Tools/idle/idle.pyw delete mode 100644 Tools/idle/idlever.py delete mode 100644 Tools/idle/keydefs.py delete mode 100644 Tools/idle/testcode.py delete mode 100644 Tools/modulator/EXAMPLE.py delete mode 100644 Tools/modulator/README delete mode 100644 Tools/modulator/ScrolledListbox.py delete mode 100644 Tools/modulator/Templates/copyright delete mode 100644 Tools/modulator/Templates/module_head delete mode 100644 Tools/modulator/Templates/module_method delete mode 100644 Tools/modulator/Templates/module_tail delete mode 100644 Tools/modulator/Templates/object_head delete mode 100644 Tools/modulator/Templates/object_method delete mode 100644 Tools/modulator/Templates/object_mlist delete mode 100644 Tools/modulator/Templates/object_new delete mode 100644 Tools/modulator/Templates/object_structure delete mode 100644 Tools/modulator/Templates/object_tail delete mode 100644 Tools/modulator/Templates/object_tp_as_mapping delete mode 100644 Tools/modulator/Templates/object_tp_as_number delete mode 100644 Tools/modulator/Templates/object_tp_as_sequence delete mode 100644 Tools/modulator/Templates/object_tp_call delete mode 100644 Tools/modulator/Templates/object_tp_compare delete mode 100644 Tools/modulator/Templates/object_tp_dealloc delete mode 100644 Tools/modulator/Templates/object_tp_getattr delete mode 100644 Tools/modulator/Templates/object_tp_hash delete mode 100644 Tools/modulator/Templates/object_tp_print delete mode 100644 Tools/modulator/Templates/object_tp_repr delete mode 100644 Tools/modulator/Templates/object_tp_setattr delete mode 100644 Tools/modulator/Templates/object_tp_str delete mode 100755 Tools/modulator/Tkextra.py delete mode 100755 Tools/modulator/genmodule.py delete mode 100755 Tools/modulator/modulator.py delete mode 100644 Tools/modulator/varsubst.py delete mode 100644 Tools/pynche/ChipViewer.py delete mode 100644 Tools/pynche/ColorDB.py delete mode 100644 Tools/pynche/DetailsViewer.py delete mode 100644 Tools/pynche/ListViewer.py delete mode 100644 Tools/pynche/Main.py delete mode 100644 Tools/pynche/PyncheWidget.py delete mode 100644 Tools/pynche/README delete mode 100644 Tools/pynche/StripViewer.py delete mode 100644 Tools/pynche/Switchboard.py delete mode 100644 Tools/pynche/TextViewer.py delete mode 100644 Tools/pynche/TypeinViewer.py delete mode 100644 Tools/pynche/X/rgb.txt delete mode 100644 Tools/pynche/X/xlicense.txt delete mode 100644 Tools/pynche/__init__.py delete mode 100644 Tools/pynche/html40colors.txt delete mode 100644 Tools/pynche/namedcolors.txt delete mode 100644 Tools/pynche/pyColorChooser.py delete mode 100755 Tools/pynche/pynche delete mode 100755 Tools/pynche/pynche.pyw delete mode 100644 Tools/pynche/webcolors.txt delete mode 100644 Tools/pynche/websafe.txt delete mode 100644 Tools/scripts/README delete mode 100755 Tools/scripts/byteyears.py delete mode 100755 Tools/scripts/checkappend.py delete mode 100755 Tools/scripts/checkpyc.py delete mode 100755 Tools/scripts/classfix.py delete mode 100755 Tools/scripts/copytime.py delete mode 100755 Tools/scripts/crlf.py delete mode 100755 Tools/scripts/cvsfiles.py delete mode 100644 Tools/scripts/dutree.doc delete mode 100755 Tools/scripts/dutree.py delete mode 100755 Tools/scripts/eptags.py delete mode 100755 Tools/scripts/findlinksto.py delete mode 100755 Tools/scripts/fixcid.py delete mode 100755 Tools/scripts/fixheader.py delete mode 100755 Tools/scripts/fixnotice.py delete mode 100755 Tools/scripts/fixps.py delete mode 100755 Tools/scripts/ftpmirror.py delete mode 100644 Tools/scripts/gencodec.py delete mode 100755 Tools/scripts/h2py.py delete mode 100755 Tools/scripts/ifdef.py delete mode 100755 Tools/scripts/lfcr.py delete mode 100755 Tools/scripts/linktree.py delete mode 100755 Tools/scripts/lll.py delete mode 100755 Tools/scripts/logmerge.py delete mode 100755 Tools/scripts/mailerdaemon.py delete mode 100755 Tools/scripts/methfix.py delete mode 100755 Tools/scripts/mkreal.py delete mode 100755 Tools/scripts/ndiff.py delete mode 100755 Tools/scripts/nm2def.py delete mode 100755 Tools/scripts/objgraph.py delete mode 100755 Tools/scripts/parseentities.py delete mode 100755 Tools/scripts/pathfix.py delete mode 100755 Tools/scripts/pdeps.py delete mode 100755 Tools/scripts/pindent.py delete mode 100755 Tools/scripts/ptags.py delete mode 100755 Tools/scripts/rgrep.py delete mode 100755 Tools/scripts/suff.py delete mode 100755 Tools/scripts/sum5.py delete mode 100755 Tools/scripts/texi2html.py delete mode 100644 Tools/scripts/trace.py delete mode 100755 Tools/scripts/treesync.py delete mode 100755 Tools/scripts/untabify.py delete mode 100755 Tools/scripts/which.py delete mode 100755 Tools/scripts/xxci.py delete mode 100644 Tools/versioncheck/README delete mode 100644 Tools/versioncheck/_checkversion.py delete mode 100644 Tools/versioncheck/checkversions.py delete mode 100644 Tools/versioncheck/pyversioncheck.py delete mode 100644 Tools/webchecker/README delete mode 100644 Tools/webchecker/tktools.py delete mode 100755 Tools/webchecker/wcgui.py delete mode 100644 Tools/webchecker/wcmac.py delete mode 100755 Tools/webchecker/webchecker.py delete mode 100755 Tools/webchecker/websucker.py delete mode 100755 Tools/webchecker/wsgui.py delete mode 100644 Tools/world/README delete mode 100755 Tools/world/world delete mode 100644 acconfig.h delete mode 100644 config.h.in delete mode 100755 configure delete mode 100644 configure.in delete mode 100755 install-sh diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 04a4a99e4d..0000000000 --- a/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.purify -config.log -config.h -config.cache -config.status -Makefile -buildno -python diff --git a/BeOS/README b/BeOS/README deleted file mode 100644 index 989995ad6e..0000000000 --- a/BeOS/README +++ /dev/null @@ -1,93 +0,0 @@ -Python 1.5.x (x > 1) for BeOS - -This directory contains several useful things to help you build your own -version of Python for BeOS. - -What's Here? - -ar-fake - A shell script used by the build process to emulate a "real" - POSIX ar command; helps to build the Python shared library. - -dl_export.h - A header defining the evil magic declaration decorations - required for dynamic loading. - -linkcc - A shell script used by the build process to build the Python - shared library. - -linkmodule - A shell script used by the build process to build the - shared library versions of the standard modules; you'll - probably need this if you want to build dynamically loaded - modules from the Python archives. - -README - This file (obviously!). - -README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2. - You'll have to grab the GNU readline source code from - prep.ai.mit.edu:/pub/GNU or any other GNU mirror. - - The Python interpreter is much nicer to work with - interactively if you've got readline installed. Highly - recommended. - -Compiling Your Own Version - -To compile your own version of Python 1.5.x for BeOS (with any luck, -Python 1.5.2 and later will compile "out of the box" on BeOS), try this: - -1) Get the latest Python source code from ftp.python.org. - -2) Configure with: - - ./configure --verbose --prefix=/boot/home/config --with-thread - -3) Copy Modules/Setup.in to Modules/Setup. - -4) Edit Modules/Setup to turn on all the modules you want built. - - Make sure you use _socket instead of socket for the name of the - socketmodule on BeOS. - - If you want the modules to be built as shared libraries, instead of as - part of the Python shared library, be sure to uncomment the #*shared* - line. - - I've tried the following modules: - - regex pcre posix signal readline array cmath math strop struct time - operator _locale fcntl pwd grp select _socket errno crypt termios - audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex - binascii parser cStringIO cPickle zlib - - Note that some of these (readline, curses, gdbm, and zlib) require extra - libraries that aren't supplied with Python. If you don't have the extra - libs (you can probably get them from GeekGadgets), don't try to use - these modules; they won't compile. - -5) Make: - - make - -6) Test: - - make test - - Expect the following errors: - - test_grp crashed -- exceptions.KeyError : getgrnam(): name not found - test_pwd failed -- Writing: 'fakename', expected: 'caught e' - test_socket crashed -- exceptions.AttributeError : SOCK_RAW - - These are all due to either partial support for certain things (like - sockets), or valid differences between systems. - - NOTE: On R4/x86, the pause() function is broken; expect the signal - module test to crash Python! - -7) Install: - - make install - -8) Enjoy! - -- Chris Herborth (chrish@beoscentral.com) - January 12, 1999 diff --git a/BeOS/README.readline-2.2 b/BeOS/README.readline-2.2 deleted file mode 100644 index db53ac9f98..0000000000 --- a/BeOS/README.readline-2.2 +++ /dev/null @@ -1,56 +0,0 @@ -GNU readline 2.2 for BeOS - -You can get the original GNU readline 2.2 source code from your favourite -GNU software repository, such as ftp://prep.ai.mit.edu/pub/gnu/. - -You can get the only-slightly-modified-for-BeOS version of GNU readline 2.2 -from the GeekGadgets repository; ftp://ftp.ninemoons.com/pub/geekgadgets/. - -BUILDING libreadline for BeOS hosts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Note that we don't build a shared library version of libreadline and -libhistory. That's left as an exercise for the reader. - -You won't be able to link against libreadline.a using the limited linker. - -1) If you're on a PowerPC system, install the POSIX ar from - http://www.qnx.com/~chrish/Be/software/index.html#programming - (note that it's currently packaged with Python, in the BeOS/ar-1.1 - directory). - - If you're on an x86 system, you can leave out the "AR=ar-posix" part - of the following instructions. In fact, you'll have to... - -2) For PowerPC, configure with: - - CC=mwcc CFLAGS="-O7 -i- -I." AR=ar-posix RANLIB=: ./configure --verbose \ - --without-gcc --prefix=/boot/home/config powerpc-*-beos - - For x86, configure with: - - CC=mwcc CFLAGS="-O2 -i- -I." RANLIB=: ./configure --verbose \ - --without-gcc --prefix=/boot/home/config x86-*-beos - - Don't worry about the warnings/errors configure spews for - powerpc-*-beos or x86-*-beos; readline doesn't actually use this host - information for anything, although configure will die if you don't - specify it. - -3) Edit config.h to comment out "#define HAVE_SELECT 1"; select() on - BeOS doesn't work on file descriptors (such as stdin). - -4) For PowerPC, make with: - - make AR=ar-posix - - For x86, make with: - - make - -5) Install with: - - make install - -- Chris Herborth (chrish@qnx.com) - April 21, 1998 diff --git a/BeOS/ar-fake b/BeOS/ar-fake deleted file mode 100755 index b4f5996c58..0000000000 --- a/BeOS/ar-fake +++ /dev/null @@ -1,157 +0,0 @@ -#! /bin/sh -# -# Fake "ar" to build the Python shared library on BeOS. This "ar" -# manipulates a .ar-libname file listing all the objects and regenerates -# the shared lib every time it's called. This is probably only suitable -# for things that get built like Python, and you'll probably have to make -# some small modifications here and there. -# -# This stupid hackery is necessary due to the brain-damaged __declspec() -# semantics on x86; on PowerPC, we could just build a static library -# and turn that into a shared library using an exports list. On x86, you'd -# need to use a fake table of pointers to every symbol you wanted to -# export, otherwise you'd end up with an empty shared lib. This is -# progress? -# -# Called via: -# -# ar-fake cr lib-name objects -# ar-fake d lib-name objects -# -# This fake "ar" DOES NOT support any other POSIX "ar" commands! DO NOT -# expect it to behave very intelligently, it's designed to build Python, -# not any old shared lib. - -AR_COMMAND=$1 ; shift -AR_LIB=$1 ; shift -AR_LIB_NAME=$(basename $AR_LIB) -AR_SO_LIB_NAME=${AR_LIB_NAME/.a/.so} -AR_LIB_PATH=${AR_LIB/$AR_LIB_NAME/} -if [ "$AR_LIB_PATH" = "" ] ; then - AR_LIB_PATH="." -fi -AR_CRUD=${AR_LIB_PATH}/.ar-${AR_LIB_NAME} - -AR_CWD=$(pwd) - -# Function to tell is if the arg is an absolute path. Use it like this: -# -# if is_abs pathname ; then ... -is_abs() { - if [ "$1" != "$(echo $1 | sed -e "s,^/,,")" ] ; then - return 0 - fi - return 1 -} - -# Function to build the shared library. It does the right thing for -# PowerPC or x86 systems running BeOS. -build_lib() { - LIB=$1 ; shift - SO_LIB=${LIB/.a/.so} - SO_NAME=$1 ; shift - CRUD_NAME=$1 ; shift - - # maybe too much... - EXTRA_LIBS="-lroot -lbe -lnet" - - case $BE_HOST_CPU in - ppc) - case $(uname -r) in - 4.0*) AR_CC="mwcc -xms -export pragma -nodup" ;; - *) AR_CC="mwcc -shared -export pragma -nodup" ;; - esac - GLUE_LOC=/boot/develop/lib/ppc - AR_GLUE="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o ${GLUE_LOC}/start_dyn.o" - ;; - - x86) - AR_CC="gcc -nostart -Wl,-soname=${SO_NAME}" - AR_GLUE= - ;; - - *) - # Send me the mystery system (soo-pah aitch!), then we'll talk... - echo "No, no, no... $0 doesn't support $BE_HOST_CPU" - exit 2 - ;; - esac - - # Build a list of the objects... - PARTS="" - while read OBJ_FILE OBJ_PATH ; do - PARTS="$PARTS ${OBJ_PATH}${OBJ_FILE}" - done < $CRUD_NAME - - $AR_CC -o $SO_LIB $PARTS $AR_GLUE $EXTRA_LIBS > /dev/null 2>&1 - - return 0 -} - -# Make a backup of the old AR_CRUD file, just to be nice, and clean up -# any of our temp files that may be laying around. -if [ -e $AR_CRUD ] ; then - mv -f $AR_CRUD ${AR_CRUD}.old - cp ${AR_CRUD}.old $AR_CRUD -else - touch $AR_CRUD -fi - -if [ -e ${AR_CRUD}.grepper ] ; then - rm -f ${AR_CRUD}.grepper -fi - -case $AR_COMMAND in - cr) - # Add the extra bits to the $AR_CRUD file. - for OBJECT in "$@" ; do - OBJ_NAME=$(basename $OBJECT) - OBJ_PATH=${OBJECT%$OBJ_NAME} - if ! is_abs $OBJ_PATH ; then - OBJ_PATH=${AR_CWD}/${OBJECT} - OBJ_PATH=${OBJ_PATH%$OBJ_NAME} - fi - - # If this is already in there, we have to blow it away so - # we can replace it with the new one. - if egrep -q "^$OBJ_NAME " $AR_CRUD ; then - egrep -v "^$OBJ_NAME " < $AR_CRUD > ${AR_CRUD}.grepper - mv -f ${AR_CRUD}.grepper $AR_CRUD - fi - - echo $OBJ_NAME $OBJ_PATH >> $AR_CRUD - done - - # Now build a library from the files. - build_lib $AR_LIB $AR_SO_LIB_NAME $AR_CRUD - ;; - - d) - # Remove files from the $AR_CRUD file. This isn't terribly - # efficient. - for OBJECT in "$@" ; do - OBJ_NAME=$(basename $OBJECT) - OBJ_PATH=${OBJECT%$OBJ_NAME} - if ! is_abs $OBJ_PATH ; then - OBJ_PATH=${AR_CWD}/${OBJECT} - OBJ_PATH=${OBJ_PATH%$OBJ_NAME} - fi - - # Strip the objects from the list, if they're in there. - egrep -v "^$OBJ_NAME " < $AR_CRUD > ${AR_CRUD}.grepper - mv -f ${AR_CRUD}.grepper $AR_CRUD - done - - # Now build a library from the remaining objects. - build_lib $AR_LIB $AR_SO_LIB_NAME $AR_CRUD - ;; - - *) - echo "$0 error:" - echo " Unsupported command: $AR_COMMAND" - exit 1 - ;; -esac - -# If we make it here, all went well. Hopefully. -exit 0 diff --git a/BeOS/dl_export.h b/BeOS/dl_export.h deleted file mode 100644 index d65d534fde..0000000000 --- a/BeOS/dl_export.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef BEOS_DL_EXPORT_H -#define BEOS_DL_EXPORT_H - -/* There are no declarations here, so no #ifdef __cplusplus... - * - * This is the nasty declaration decorations required by certain systems - * (in our case, BeOS) for dynamic object loading. - * - * This trivial header is released under the same license as the rest of - * Python: - * - * Copyright (c) 2000, BeOpen.com. - * Copyright (c) 1995-2000, Corporation for National Research Initiatives. - * Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - * All rights reserved. - * - * See the file "Misc/COPYRIGHT" for information on usage and - * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * - Chris Herborth (chrish@beoscentral.com) - * January 11, 1999 - */ - -#ifndef DL_EXPORT -# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE -#endif -#ifndef DL_IMPORT -# ifdef USE_DL_EXPORT -# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE -# else -# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE -# endif -#endif - -#endif diff --git a/BeOS/linkcc b/BeOS/linkcc deleted file mode 100755 index 687c92ecd6..0000000000 --- a/BeOS/linkcc +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# -# linkcc for Python -# Chris Herborth (chrish@qnx.com) -# -# This is covered by the same copyright/licensing terms as the rest of -# Python. -# -# Shell script to build the Python shared library properly; if we haven't -# already built the export list, we'll need to link twice (argh...) so we -# can eliminate some unwatnted global symbols from the system glue/init -# objects. -# -# This is called by the Modules/Makefile as part of $(LINKCC): -# -# $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ -# -L.. -lpython$(VERSION) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) -# -# In 1.5.1 this changed to: -# -# $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ -# $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) -# -# For BeOS we should set $(LINKCC) to this in configure (similar to the -# AIX situation): -# -# $(srcdir)../BeOS/linkcc $(LIBRARY) $(PURIFY) $(CC) $(OPT) -# -# -L.. -lpython$(VERSION) will automagically pick up the shared library. -# -# As of Python 1.5.2, this isn't strictly necessary, but it makes me -# feel safer. It makes sure we've got all the BeOS-specific libraries, -# and it creates the "lib" symlink that we'll need for chance of running -# "make test" successfully. - -LIBRARY="$1"; shift - -# What we want to end up with. -DYNAMIC=${LIBRARY/.a/.so} -LINK_DYNAMIC="-l$(basename ${DYNAMIC%.so} | sed -e s,lib,,)" - -# Grab the rest of the args and build them into the command used to -# link the python binary. Make sure we link against the shared lib -# and not the static lib. -LINK_CMD="" -while [ "$#" != "0" ] ; do - case "$1" in - $LIBRARY) - LINK_CMD="$LINK_CMD -L.. $LINK_DYNAMIC" - shift - ;; - - *) - LINK_CMD="$LINK_CMD $1" - shift - ;; - esac -done - -# The shared libraries and glue objects we need to link against; this is -# a little overkill, but it'll be OK. -LIBS="-lbe -lnet -lroot" - -case $BE_HOST_CPU in - ppc) - LIBS="-nodup $LIBS" - ;; -esac - -# We'll need this or the python binary won't load libpython.so... handy -# for testing. -( cd .. ; ln -sf $(pwd) lib ) - -# Now build the python binary. -echo "Link command: $LINK_CMD $LIBS" -$LINK_CMD $LIBS diff --git a/BeOS/linkmodule b/BeOS/linkmodule deleted file mode 100755 index 103882a720..0000000000 --- a/BeOS/linkmodule +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -# -# linkmodule for Python -# Chris Herborth (chrish@qnx.com) -# -# This is covered by the same copyright/licensing terms as the rest of -# Python. -# -# Shell script to build shared library versions of the modules; since -# the change to the *ahem* "proper" import/export mechanism, this script -# is much simpler. It handles PowerPC and x86, too. -# -# This is called by the Modules/Makefile as $(LDSHARED): -# -# $(LDSHARED) foomodule.o -o foomodule$(SO) -# -# Could also be called as: -# -# $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \ -# -o readline$(SO) -# -# so we need to preserve the arguments, sort of. - -# Make sure we got reasonable arguments. -TARGET="" -ARGS="" - -while [ "$#" != "0" ]; do - case "$1" in - -o) TARGET="$2"; shift; shift;; - *) ARGS="$ARGS $1"; shift;; - esac -done - -if [ "$TARGET" = "" ] ; then - echo "Usage:" - echo - echo " $0 [args] -o foomodule.so [args] foomodule.o [args]" - echo - echo "Where:" - echo - echo " [args] normal compiler arguments" - exit 1 -fi - -# The shared libraries and glue objects we need to link against; these -# libs are overkill for most of the standard modules, but it makes life -# in this shell script easier. -LIBS="-L.. -lpython1.5 -lbe -lnet -lroot" - -case $BE_HOST_CPU in - ppc) - # Boy, do we need a lot of crap... - GLUE_LOC=/boot/develop/lib/ppc - GLUE="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o" - case $(uname -r) in - 4.0*) CC="mwcc -xms -export pragma -nodup" ;; - *) CC="mwcc -shared -export pragma -nodup" ;; - esac - ;; - - x86) - # We don't need as much crap here... - GLUE="" - CC="gcc -nostart -Wl,-soname=${TARGET}" - ;; - - *) - # What the?!? - echo "$0 doesn't support $BE_HOST_CPU systems..." - echo "You're on your own... I'd be surprised if this works." - GLUE="" - CC="cc" - ;; -esac - -# Now link that shared lib... -$CC -o $TARGET $ARGS $GLUE $LIBS diff --git a/Demo/Makefile b/Demo/Makefile deleted file mode 100644 index b70dc12f9b..0000000000 --- a/Demo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all: - @echo Nothing to make in this directory. - -clean: - find . '(' -name '*.pyc' -o -name '*.fdc' \ - -o -name core -o -name '*~' \ - -o -name '[@,#]*' -o -name '*.old' \ - -o -name '*.orig' -o -name '*.rej' \ - -o -name '*.bak' ')' \ - -print -exec rm -f {} ';' - -clobber: clean diff --git a/Demo/README b/Demo/README deleted file mode 100644 index 87017a9e88..0000000000 --- a/Demo/README +++ /dev/null @@ -1,48 +0,0 @@ -This directory contains various demonstrations of what you can do with -Python. They were all written by me except where explicitly stated -otherwise -- in general, demos contributed by others ends up in the -../Contrib directory, unless I think they're of utmost general -importance (like Matt Conway's Tk demos). - -A fair number of utilities that are useful when while developing -Python code can be found in the ../Tools directory -- some of these -can also be considered good examples of how to write Python code. - -Finally, in order to save disk space and net bandwidth, not all -subdirectories listed here are distributed. They are listed just -in case I change my mind about them. - - -classes Some examples of how to use classes. - -embed An example of embedding Python in another application - (see also pysvr). - -extend An example of using the generic Makefile.pre.in from - the Misc directory to build a statically linked or - shared extension module. - -md5test Test program for the optional md5 module. - -pysvr An example of embedding Python in a threaded - application. - -rpc A set of classes for building clients and servers for - Sun RPC. - -scripts Some useful Python scripts that I put in my bin - directory. No optional built-in modules needed. - -sockets Examples for the new built-in module 'socket'. - -sgi Demos that only run on Silicon Graphics machines. - These require at least one of the optional built-in - modules that only make sense for the SGI, such as - 'gl', 'al', and 'sv'. Split in subdirectories - per subject. - -threads Demos that use the 'thread' module. (Currently these - only run on SGIs, but this may change in the future.) - -tkinter Demos using the Tk interface (including Matt Conway's - excellent set of demos). diff --git a/Demo/classes/Complex.py b/Demo/classes/Complex.py deleted file mode 100755 index bfb0d95ea9..0000000000 --- a/Demo/classes/Complex.py +++ /dev/null @@ -1,298 +0,0 @@ -# Complex numbers -# --------------- - -# [Now that Python has a complex data type built-in, this is not very -# useful, but it's still a nice example class] - -# This module represents complex numbers as instances of the class Complex. -# A Complex instance z has two data attribues, z.re (the real part) and z.im -# (the imaginary part). In fact, z.re and z.im can have any value -- all -# arithmetic operators work regardless of the type of z.re and z.im (as long -# as they support numerical operations). -# -# The following functions exist (Complex is actually a class): -# Complex([re [,im]) -> creates a complex number from a real and an imaginary part -# IsComplex(z) -> true iff z is a complex number (== has .re and .im attributes) -# ToComplex(z) -> a complex number equal to z; z itself if IsComplex(z) is true -# if z is a tuple(re, im) it will also be converted -# PolarToComplex([r [,phi [,fullcircle]]]) -> -# the complex number z for which r == z.radius() and phi == z.angle(fullcircle) -# (r and phi default to 0) -# exp(z) -> returns the complex exponential of z. Equivalent to pow(math.e,z). -# -# Complex numbers have the following methods: -# z.abs() -> absolute value of z -# z.radius() == z.abs() -# z.angle([fullcircle]) -> angle from positive X axis; fullcircle gives units -# z.phi([fullcircle]) == z.angle(fullcircle) -# -# These standard functions and unary operators accept complex arguments: -# abs(z) -# -z -# +z -# not z -# repr(z) == `z` -# str(z) -# hash(z) -> a combination of hash(z.re) and hash(z.im) such that if z.im is zero -# the result equals hash(z.re) -# Note that hex(z) and oct(z) are not defined. -# -# These conversions accept complex arguments only if their imaginary part is zero: -# int(z) -# long(z) -# float(z) -# -# The following operators accept two complex numbers, or one complex number -# and one real number (int, long or float): -# z1 + z2 -# z1 - z2 -# z1 * z2 -# z1 / z2 -# pow(z1, z2) -# cmp(z1, z2) -# Note that z1 % z2 and divmod(z1, z2) are not defined, -# nor are shift and mask operations. -# -# The standard module math does not support complex numbers. -# (I suppose it would be easy to implement a cmath module.) -# -# Idea: -# add a class Polar(r, phi) and mixed-mode arithmetic which -# chooses the most appropriate type for the result: -# Complex for +,-,cmp -# Polar for *,/,pow - - -import types, math - -twopi = math.pi*2.0 -halfpi = math.pi/2.0 - -def IsComplex(obj): - return hasattr(obj, 're') and hasattr(obj, 'im') - -def ToComplex(obj): - if IsComplex(obj): - return obj - elif type(obj) == types.TupleType: - return apply(Complex, obj) - else: - return Complex(obj) - -def PolarToComplex(r = 0, phi = 0, fullcircle = twopi): - phi = phi * (twopi / fullcircle) - return Complex(math.cos(phi)*r, math.sin(phi)*r) - -def Re(obj): - if IsComplex(obj): - return obj.re - else: - return obj - -def Im(obj): - if IsComplex(obj): - return obj.im - else: - return obj - -class Complex: - - def __init__(self, re=0, im=0): - if IsComplex(re): - im = i + Complex(0, re.im) - re = re.re - if IsComplex(im): - re = re - im.im - im = im.re - self.__dict__['re'] = re - self.__dict__['im'] = im - - def __setattr__(self, name, value): - raise TypeError, 'Complex numbers are immutable' - - def __hash__(self): - if not self.im: return hash(self.re) - mod = sys.maxint + 1L - return int((hash(self.re) + 2L*hash(self.im) + mod) % (2L*mod) - mod) - - def __repr__(self): - if not self.im: - return 'Complex(%s)' % `self.re` - else: - return 'Complex(%s, %s)' % (`self.re`, `self.im`) - - def __str__(self): - if not self.im: - return `self.re` - else: - return 'Complex(%s, %s)' % (`self.re`, `self.im`) - - def __neg__(self): - return Complex(-self.re, -self.im) - - def __pos__(self): - return self - - def __abs__(self): - # XXX could be done differently to avoid overflow! - return math.sqrt(self.re*self.re + self.im*self.im) - - def __int__(self): - if self.im: - raise ValueError, "can't convert Complex with nonzero im to int" - return int(self.re) - - def __long__(self): - if self.im: - raise ValueError, "can't convert Complex with nonzero im to long" - return long(self.re) - - def __float__(self): - if self.im: - raise ValueError, "can't convert Complex with nonzero im to float" - return float(self.re) - - def __cmp__(self, other): - other = ToComplex(other) - return cmp((self.re, self.im), (other.re, other.im)) - - def __rcmp__(self, other): - other = ToComplex(other) - return cmp(other, self) - - def __nonzero__(self): - return not (self.re == self.im == 0) - - abs = radius = __abs__ - - def angle(self, fullcircle = twopi): - return (fullcircle/twopi) * ((halfpi - math.atan2(self.re, self.im)) % twopi) - - phi = angle - - def __add__(self, other): - other = ToComplex(other) - return Complex(self.re + other.re, self.im + other.im) - - __radd__ = __add__ - - def __sub__(self, other): - other = ToComplex(other) - return Complex(self.re - other.re, self.im - other.im) - - def __rsub__(self, other): - other = ToComplex(other) - return other - self - - def __mul__(self, other): - other = ToComplex(other) - return Complex(self.re*other.re - self.im*other.im, - self.re*other.im + self.im*other.re) - - __rmul__ = __mul__ - - def __div__(self, other): - other = ToComplex(other) - d = float(other.re*other.re + other.im*other.im) - if not d: raise ZeroDivisionError, 'Complex division' - return Complex((self.re*other.re + self.im*other.im) / d, - (self.im*other.re - self.re*other.im) / d) - - def __rdiv__(self, other): - other = ToComplex(other) - return other / self - - def __pow__(self, n, z=None): - if z is not None: - raise TypeError, 'Complex does not support ternary pow()' - if IsComplex(n): - if n.im: - if self.im: raise TypeError, 'Complex to the Complex power' - else: return exp(math.log(self.re)*n) - n = n.re - r = pow(self.abs(), n) - phi = n*self.angle() - return Complex(math.cos(phi)*r, math.sin(phi)*r) - - def __rpow__(self, base): - base = ToComplex(base) - return pow(base, self) - -def exp(z): - r = math.exp(z.re) - return Complex(math.cos(z.im)*r,math.sin(z.im)*r) - - -def checkop(expr, a, b, value, fuzz = 1e-6): - import sys - print ' ', a, 'and', b, - try: - result = eval(expr) - except: - result = sys.exc_type - print '->', result - if (type(result) == type('') or type(value) == type('')): - ok = result == value - else: - ok = abs(result - value) <= fuzz - if not ok: - print '!!\t!!\t!! should be', value, 'diff', abs(result - value) - - -def test(): - testsuite = { - 'a+b': [ - (1, 10, 11), - (1, Complex(0,10), Complex(1,10)), - (Complex(0,10), 1, Complex(1,10)), - (Complex(0,10), Complex(1), Complex(1,10)), - (Complex(1), Complex(0,10), Complex(1,10)), - ], - 'a-b': [ - (1, 10, -9), - (1, Complex(0,10), Complex(1,-10)), - (Complex(0,10), 1, Complex(-1,10)), - (Complex(0,10), Complex(1), Complex(-1,10)), - (Complex(1), Complex(0,10), Complex(1,-10)), - ], - 'a*b': [ - (1, 10, 10), - (1, Complex(0,10), Complex(0, 10)), - (Complex(0,10), 1, Complex(0,10)), - (Complex(0,10), Complex(1), Complex(0,10)), - (Complex(1), Complex(0,10), Complex(0,10)), - ], - 'a/b': [ - (1., 10, 0.1), - (1, Complex(0,10), Complex(0, -0.1)), - (Complex(0, 10), 1, Complex(0, 10)), - (Complex(0, 10), Complex(1), Complex(0, 10)), - (Complex(1), Complex(0,10), Complex(0, -0.1)), - ], - 'pow(a,b)': [ - (1, 10, 1), - (1, Complex(0,10), 1), - (Complex(0,10), 1, Complex(0,10)), - (Complex(0,10), Complex(1), Complex(0,10)), - (Complex(1), Complex(0,10), 1), - (2, Complex(4,0), 16), - ], - 'cmp(a,b)': [ - (1, 10, -1), - (1, Complex(0,10), 1), - (Complex(0,10), 1, -1), - (Complex(0,10), Complex(1), -1), - (Complex(1), Complex(0,10), 1), - ], - } - exprs = testsuite.keys() - exprs.sort() - for expr in exprs: - print expr + ':' - t = (expr,) - for item in testsuite[expr]: - apply(checkop, t+item) - - -if __name__ == '__main__': - test() diff --git a/Demo/classes/Dates.py b/Demo/classes/Dates.py deleted file mode 100755 index 2c37a4e3bf..0000000000 --- a/Demo/classes/Dates.py +++ /dev/null @@ -1,218 +0,0 @@ -# Class Date supplies date objects that support date arithmetic. -# -# Date(month,day,year) returns a Date object. An instance prints as, -# e.g., 'Mon 16 Aug 1993'. -# -# Addition, subtraction, comparison operators, min, max, and sorting -# all work as expected for date objects: int+date or date+int returns -# the date `int' days from `date'; date+date raises an exception; -# date-int returns the date `int' days before `date'; date2-date1 returns -# an integer, the number of days from date1 to date2; int-date raises an -# exception; date1 < date2 is true iff date1 occurs before date2 (& -# similarly for other comparisons); min(date1,date2) is the earlier of -# the two dates and max(date1,date2) the later; and date objects can be -# used as dictionary keys. -# -# Date objects support one visible method, date.weekday(). This returns -# the day of the week the date falls on, as a string. -# -# Date objects also have 4 read-only data attributes: -# .month in 1..12 -# .day in 1..31 -# .year int or long int -# .ord the ordinal of the date relative to an arbitrary staring point -# -# The Dates module also supplies function today(), which returns the -# current date as a date object. -# -# Those entranced by calendar trivia will be disappointed, as no attempt -# has been made to accommodate the Julian (etc) system. On the other -# hand, at least this package knows that 2000 is a leap year but 2100 -# isn't, and works fine for years with a hundred decimal digits . - -# Tim Peters tim@ksr.com -# not speaking for Kendall Square Research Corp - -# Adapted to Python 1.1 (where some hacks to overcome coercion are unnecessary) -# by Guido van Rossum - -# vi:set tabsize=8: - -_MONTH_NAMES = [ 'January', 'February', 'March', 'April', 'May', - 'June', 'July', 'August', 'September', 'October', - 'November', 'December' ] - -_DAY_NAMES = [ 'Friday', 'Saturday', 'Sunday', 'Monday', - 'Tuesday', 'Wednesday', 'Thursday' ] - -_DAYS_IN_MONTH = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ] - -_DAYS_BEFORE_MONTH = [] -dbm = 0 -for dim in _DAYS_IN_MONTH: - _DAYS_BEFORE_MONTH.append(dbm) - dbm = dbm + dim -del dbm, dim - -_INT_TYPES = type(1), type(1L) - -def _is_leap( year ): # 1 if leap year, else 0 - if year % 4 != 0: return 0 - if year % 400 == 0: return 1 - return year % 100 != 0 - -def _days_in_year( year ): # number of days in year - return 365 + _is_leap(year) - -def _days_before_year( year ): # number of days before year - return year*365L + (year+3)/4 - (year+99)/100 + (year+399)/400 - -def _days_in_month( month, year ): # number of days in month of year - if month == 2 and _is_leap(year): return 29 - return _DAYS_IN_MONTH[month-1] - -def _days_before_month( month, year ): # number of days in year before month - return _DAYS_BEFORE_MONTH[month-1] + (month > 2 and _is_leap(year)) - -def _date2num( date ): # compute ordinal of date.month,day,year - return _days_before_year( date.year ) + \ - _days_before_month( date.month, date.year ) + \ - date.day - -_DI400Y = _days_before_year( 400 ) # number of days in 400 years - -def _num2date( n ): # return date with ordinal n - if type(n) not in _INT_TYPES: - raise TypeError, 'argument must be integer: ' + `type(n)` - - ans = Date(1,1,1) # arguments irrelevant; just getting a Date obj - del ans.ord, ans.month, ans.day, ans.year # un-initialize it - ans.ord = n - - n400 = (n-1)/_DI400Y # # of 400-year blocks preceding - year, n = 400 * n400, n - _DI400Y * n400 - more = n / 365 - dby = _days_before_year( more ) - if dby >= n: - more = more - 1 - dby = dby - _days_in_year( more ) - year, n = year + more, int(n - dby) - - try: year = int(year) # chop to int, if it fits - except (ValueError, OverflowError): pass - - month = min( n/29 + 1, 12 ) - dbm = _days_before_month( month, year ) - if dbm >= n: - month = month - 1 - dbm = dbm - _days_in_month( month, year ) - - ans.month, ans.day, ans.year = month, n-dbm, year - return ans - -def _num2day( n ): # return weekday name of day with ordinal n - return _DAY_NAMES[ int(n % 7) ] - - -class Date: - def __init__( self, month, day, year ): - if not 1 <= month <= 12: - raise ValueError, 'month must be in 1..12: ' + `month` - dim = _days_in_month( month, year ) - if not 1 <= day <= dim: - raise ValueError, 'day must be in 1..' + `dim` + ': ' + `day` - self.month, self.day, self.year = month, day, year - self.ord = _date2num( self ) - - # don't allow setting existing attributes - def __setattr__( self, name, value ): - if self.__dict__.has_key(name): - raise AttributeError, 'read-only attribute ' + name - self.__dict__[name] = value - - def __cmp__( self, other ): - return cmp( self.ord, other.ord ) - - # define a hash function so dates can be used as dictionary keys - def __hash__( self ): - return hash( self.ord ) - - # print as, e.g., Mon 16 Aug 1993 - def __repr__( self ): - return '%.3s %2d %.3s ' % ( - self.weekday(), - self.day, - _MONTH_NAMES[self.month-1] ) + `self.year` - - # Python 1.1 coerces neither int+date nor date+int - def __add__( self, n ): - if type(n) not in _INT_TYPES: - raise TypeError, 'can\'t add ' + `type(n)` + ' to date' - return _num2date( self.ord + n ) - __radd__ = __add__ # handle int+date - - # Python 1.1 coerces neither date-int nor date-date - def __sub__( self, other ): - if type(other) in _INT_TYPES: # date-int - return _num2date( self.ord - other ) - else: - return self.ord - other.ord # date-date - - # complain about int-date - def __rsub__( self, other ): - raise TypeError, 'Can\'t subtract date from integer' - - def weekday( self ): - return _num2day( self.ord ) - -def today(): - import time - local = time.localtime(time.time()) - return Date( local[1], local[2], local[0] ) - -DateTestError = 'DateTestError' -def test( firstyear, lastyear ): - a = Date(9,30,1913) - b = Date(9,30,1914) - if `a` != 'Tue 30 Sep 1913': - raise DateTestError, '__repr__ failure' - if (not a < b) or a == b or a > b or b != b: - raise DateTestError, '__cmp__ failure' - if a+365 != b or 365+a != b: - raise DateTestError, '__add__ failure' - if b-a != 365 or b-365 != a: - raise DateTestError, '__sub__ failure' - try: - x = 1 - a - raise DateTestError, 'int-date should have failed' - except TypeError: - pass - try: - x = a + b - raise DateTestError, 'date+date should have failed' - except TypeError: - pass - if a.weekday() != 'Tuesday': - raise DateTestError, 'weekday() failure' - if max(a,b) is not b or min(a,b) is not a: - raise DateTestError, 'min/max failure' - d = {a-1:b, b:a+1} - if d[b-366] != b or d[a+(b-a)] != Date(10,1,1913): - raise DateTestError, 'dictionary failure' - - # verify date<->number conversions for first and last days for - # all years in firstyear .. lastyear - - lord = _days_before_year( firstyear ) - y = firstyear - while y <= lastyear: - ford = lord + 1 - lord = ford + _days_in_year(y) - 1 - fd, ld = Date(1,1,y), Date(12,31,y) - if (fd.ord,ld.ord) != (ford,lord): - raise DateTestError, ('date->num failed', y) - fd, ld = _num2date(ford), _num2date(lord) - if (1,1,y,12,31,y) != \ - (fd.month,fd.day,fd.year,ld.month,ld.day,ld.year): - raise DateTestError, ('num->date failed', y) - y = y + 1 diff --git a/Demo/classes/Dbm.py b/Demo/classes/Dbm.py deleted file mode 100755 index 8d7fe0f8f4..0000000000 --- a/Demo/classes/Dbm.py +++ /dev/null @@ -1,66 +0,0 @@ -# A wrapper around the (optional) built-in class dbm, supporting keys -# and values of almost any type instead of just string. -# (Actually, this works only for keys and values that can be read back -# correctly after being converted to a string.) - - -class Dbm: - - def __init__(self, filename, mode, perm): - import dbm - self.db = dbm.open(filename, mode, perm) - - def __repr__(self): - s = '' - for key in self.keys(): - t = `key` + ': ' + `self[key]` - if s: t = ', ' + t - s = s + t - return '{' + s + '}' - - def __len__(self): - return len(self.db) - - def __getitem__(self, key): - return eval(self.db[`key`]) - - def __setitem__(self, key, value): - self.db[`key`] = `value` - - def __delitem__(self, key): - del self.db[`key`] - - def keys(self): - res = [] - for key in self.db.keys(): - res.append(eval(key)) - return res - - def has_key(self, key): - return self.db.has_key(`key`) - - -def test(): - d = Dbm('@dbm', 'rw', 0600) - print d - while 1: - try: - key = input('key: ') - if d.has_key(key): - value = d[key] - print 'currently:', value - value = input('value: ') - if value == None: - del d[key] - else: - d[key] = value - except KeyboardInterrupt: - print '' - print d - except EOFError: - print '[eof]' - break - print d - - -test() diff --git a/Demo/classes/README b/Demo/classes/README deleted file mode 100644 index cca7524891..0000000000 --- a/Demo/classes/README +++ /dev/null @@ -1,14 +0,0 @@ -Examples of classes that implement special operators (see reference manual): - -Complex.py Complex numbers -Dates.py Date manipulation package by Tim Peters -Dbm.py Wrapper around built-in dbm, supporting arbitrary values -Range.py Example of a generator: re-implement built-in range() -Rat.py Rational numbers -Rev.py Yield the reverse of a sequence -Vec.py A simple vector class -bitvec.py A bit-vector class by Jan-Hein B\"uhrman - -(For straightforward examples of basic class features, such as use of -methods and inheritance, see the library code -- especially the window -modules are full of them.) diff --git a/Demo/classes/Range.py b/Demo/classes/Range.py deleted file mode 100755 index 18f626f458..0000000000 --- a/Demo/classes/Range.py +++ /dev/null @@ -1,71 +0,0 @@ -# Example of a generator: re-implement the built-in range function -# without actually constructing the list of values. (It turns out -# that the built-in function is about 20 times faster -- that's why -# it's built-in. :-) - - -# Wrapper function to emulate the complicated range() arguments - -def range(*a): - if len(a) == 1: - start, stop, step = 0, a[0], 1 - elif len(a) == 2: - start, stop = a - step = 1 - elif len(a) == 3: - start, stop, step = a - else: - raise TypeError, 'range() needs 1-3 arguments' - return Range(start, stop, step) - - -# Class implementing a range object. -# To the user the instances feel like immutable sequences -# (and you can't concatenate or slice them) - -class Range: - - # initialization -- should be called only by range() above - def __init__(self, start, stop, step): - if step == 0: - raise ValueError, 'range() called with zero step' - self.start = start - self.stop = stop - self.step = step - self.len = max(0, int((self.stop - self.start) / self.step)) - - # implement `x` and is also used by print x - def __repr__(self): - return 'range' + `self.start, self.stop, self.step` - - # implement len(x) - def __len__(self): - return self.len - - # implement x[i] - def __getitem__(self, i): - if 0 <= i < self.len: - return self.start + self.step * i - else: - raise IndexError, 'range[i] index out of range' - - -# Small test program - -def test(): - import time, __builtin__ - print range(10), range(-10, 10), range(0, 10, 2) - for i in range(100, -100, -10): print i, - print - t1 = time.time() - for i in range(1000): - pass - t2 = time.time() - for i in __builtin__.range(1000): - pass - t3 = time.time() - print t2-t1, 'sec (class)' - print t3-t2, 'sec (built-in)' - - -test() diff --git a/Demo/classes/Rat.py b/Demo/classes/Rat.py deleted file mode 100755 index 4fc4a1786f..0000000000 --- a/Demo/classes/Rat.py +++ /dev/null @@ -1,307 +0,0 @@ -'''\ -This module implements rational numbers. - -The entry point of this module is the function - rat(numerator, denominator) -If either numerator or denominator is of an integral or rational type, -the result is a rational number, else, the result is the simplest of -the types float and complex which can hold numerator/denominator. -If denominator is omitted, it defaults to 1. -Rational numbers can be used in calculations with any other numeric -type. The result of the calculation will be rational if possible. - -There is also a test function with calling sequence - test() -The documentation string of the test function contains the expected -output. -''' - -# Contributed by Sjoerd Mullender - -from types import * - -def gcd(a, b): - '''Calculate the Greatest Common Divisor.''' - while b: - a, b = b, a%b - return a - -def rat(num, den = 1): - # must check complex before float - if type(num) is ComplexType or type(den) is ComplexType: - # numerator or denominator is complex: return a complex - return complex(num) / complex(den) - if type(num) is FloatType or type(den) is FloatType: - # numerator or denominator is float: return a float - return float(num) / float(den) - # otherwise return a rational - return Rat(num, den) - -class Rat: - '''This class implements rational numbers.''' - - def __init__(self, num, den = 1): - if den == 0: - raise ZeroDivisionError, 'rat(x, 0)' - - # normalize - - # must check complex before float - if type(num) is ComplexType or type(den) is ComplexType: - # numerator or denominator is complex: - # normalized form has denominator == 1+0j - self.__num = complex(num) / complex(den) - self.__den = complex(1) - return - if type(num) is FloatType or type(den) is FloatType: - # numerator or denominator is float: - # normalized form has denominator == 1.0 - self.__num = float(num) / float(den) - self.__den = 1.0 - return - if (type(num) is InstanceType and - num.__class__ is self.__class__) or \ - (type(den) is InstanceType and - den.__class__ is self.__class__): - # numerator or denominator is rational - new = num / den - if type(new) is not InstanceType or \ - new.__class__ is not self.__class__: - self.__num = new - if type(new) is ComplexType: - self.__den = complex(1) - else: - self.__den = 1.0 - else: - self.__num = new.__num - self.__den = new.__den - else: - # make sure numerator and denominator don't - # have common factors - # this also makes sure that denominator > 0 - g = gcd(num, den) - self.__num = num / g - self.__den = den / g - # try making numerator and denominator of IntType if they fit - try: - numi = int(self.__num) - deni = int(self.__den) - except (OverflowError, TypeError): - pass - else: - if self.__num == numi and self.__den == deni: - self.__num = numi - self.__den = deni - - def __repr__(self): - return 'Rat(%s,%s)' % (self.__num, self.__den) - - def __str__(self): - if self.__den == 1: - return str(self.__num) - else: - return '(%s/%s)' % (str(self.__num), str(self.__den)) - - # a + b - def __add__(a, b): - try: - return rat(a.__num * b.__den + b.__num * a.__den, - a.__den * b.__den) - except OverflowError: - return rat(long(a.__num) * long(b.__den) + - long(b.__num) * long(a.__den), - long(a.__den) * long(b.__den)) - - def __radd__(b, a): - return Rat(a) + b - - # a - b - def __sub__(a, b): - try: - return rat(a.__num * b.__den - b.__num * a.__den, - a.__den * b.__den) - except OverflowError: - return rat(long(a.__num) * long(b.__den) - - long(b.__num) * long(a.__den), - long(a.__den) * long(b.__den)) - - def __rsub__(b, a): - return Rat(a) - b - - # a * b - def __mul__(a, b): - try: - return rat(a.__num * b.__num, a.__den * b.__den) - except OverflowError: - return rat(long(a.__num) * long(b.__num), - long(a.__den) * long(b.__den)) - - def __rmul__(b, a): - return Rat(a) * b - - # a / b - def __div__(a, b): - try: - return rat(a.__num * b.__den, a.__den * b.__num) - except OverflowError: - return rat(long(a.__num) * long(b.__den), - long(a.__den) * long(b.__num)) - - def __rdiv__(b, a): - return Rat(a) / b - - # a % b - def __mod__(a, b): - div = a / b - try: - div = int(div) - except OverflowError: - div = long(div) - return a - b * div - - def __rmod__(b, a): - return Rat(a) % b - - # a ** b - def __pow__(a, b): - if b.__den != 1: - if type(a.__num) is ComplexType: - a = complex(a) - else: - a = float(a) - if type(b.__num) is ComplexType: - b = complex(b) - else: - b = float(b) - return a ** b - try: - return rat(a.__num ** b.__num, a.__den ** b.__num) - except OverflowError: - return rat(long(a.__num) ** b.__num, - long(a.__den) ** b.__num) - - def __rpow__(b, a): - return Rat(a) ** b - - # -a - def __neg__(a): - try: - return rat(-a.__num, a.__den) - except OverflowError: - # a.__num == sys.maxint - return rat(-long(a.__num), a.__den) - - # abs(a) - def __abs__(a): - return rat(abs(a.__num), a.__den) - - # int(a) - def __int__(a): - return int(a.__num / a.__den) - - # long(a) - def __long__(a): - return long(a.__num) / long(a.__den) - - # float(a) - def __float__(a): - return float(a.__num) / float(a.__den) - - # complex(a) - def __complex__(a): - return complex(a.__num) / complex(a.__den) - - # cmp(a,b) - def __cmp__(a, b): - diff = Rat(a - b) - if diff.__num < 0: - return -1 - elif diff.__num > 0: - return 1 - else: - return 0 - - def __rcmp__(b, a): - return cmp(Rat(a), b) - - # a != 0 - def __nonzero__(a): - return a.__num != 0 - - # coercion - def __coerce__(a, b): - return a, Rat(b) - -def test(): - '''\ - Test function for rat module. - - The expected output is (module some differences in floating - precission): - -1 - -1 - 0 0L 0.1 (0.1+0j) - [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] - [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] - 0 - (11/10) - (11/10) - 1.1 - OK - 2 1.5 (3/2) (1.5+1.5j) (15707963/5000000) - 2 2 2.0 (2+0j) - - 4 0 4 1 4 0 - 3.5 0.5 3.0 1.33333333333 2.82842712475 1 - (7/2) (1/2) 3 (4/3) 2.82842712475 1 - (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 - 1.5 1 1.5 (1.5+0j) - - 3.5 -0.5 3.0 0.75 2.25 -1 - 3.0 0.0 2.25 1.0 1.83711730709 0 - 3.0 0.0 2.25 1.0 1.83711730709 1 - (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 - (3/2) 1 1.5 (1.5+0j) - - (7/2) (-1/2) 3 (3/4) (9/4) -1 - 3.0 0.0 2.25 1.0 1.83711730709 -1 - 3 0 (9/4) 1 1.83711730709 0 - (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 - (1.5+1.5j) (1.5+1.5j) - - (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 - (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 - (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 - (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 - ''' - print rat(-1L, 1) - print rat(1, -1) - a = rat(1, 10) - print int(a), long(a), float(a), complex(a) - b = rat(2, 5) - l = [a+b, a-b, a*b, a/b] - print l - l.sort() - print l - print rat(0, 1) - print a+1 - print a+1L - print a+1.0 - try: - print rat(1, 0) - raise SystemError, 'should have been ZeroDivisionError' - except ZeroDivisionError: - print 'OK' - print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) - list = [2, 1.5, rat(3,2), 1.5+1.5j] - for i in list: - print i, - if type(i) is not ComplexType: - print int(i), float(i), - print complex(i) - print - for j in list: - print i + j, i - j, i * j, i / j, i ** j, cmp(i, j) - -if __name__ == '__main__': - test() diff --git a/Demo/classes/Rev.py b/Demo/classes/Rev.py deleted file mode 100755 index c1874c65c5..0000000000 --- a/Demo/classes/Rev.py +++ /dev/null @@ -1,89 +0,0 @@ -# A class which presents the reverse of a sequence without duplicating it. -# From: "Steven D. Majewski" - -# It works on mutable or inmutable sequences. -# -# >>> for c in Rev( 'Hello World!' ) : sys.stdout.write( c ) -# ... else: sys.stdout.write( '\n' ) -# ... -# !dlroW olleH -# -# The .forw is so you can use anonymous sequences in __init__, and still -# keep a reference the forward sequence. ) -# If you give it a non-anonymous mutable sequence, the reverse sequence -# will track the updated values. ( but not reassignment! - another -# good reason to use anonymous values in creating the sequence to avoid -# confusion. Maybe it should be change to copy input sequence to break -# the connection completely ? ) -# -# >>> nnn = range( 0, 3 ) -# >>> rnn = Rev( nnn ) -# >>> for n in rnn: print n -# ... -# 2 -# 1 -# 0 -# >>> for n in range( 4, 6 ): nnn.append( n ) # update nnn -# ... -# >>> for n in rnn: print n # prints reversed updated values -# ... -# 5 -# 4 -# 2 -# 1 -# 0 -# >>> nnn = nnn[1:-1] -# >>> nnn -# [1, 2, 4] -# >>> for n in rnn: print n # prints reversed values of old nnn -# ... -# 5 -# 4 -# 2 -# 1 -# 0 -# >>> -# -# WH = Rev( 'Hello World!' ) -# print WH.forw, WH.back -# nnn = Rev( range( 1, 10 ) ) -# print nnn.forw -# print nnn -# -# produces output: -# -# Hello World! !dlroW olleH -# [1, 2, 3, 4, 5, 6, 7, 8, 9] -# [9, 8, 7, 6, 5, 4, 3, 2, 1] -# -# >>>rrr = Rev( nnn ) -# >>>rrr -# <1, 2, 3, 4, 5, 6, 7, 8, 9> - -from string import joinfields -class Rev: - def __init__( self, seq ): - self.forw = seq - self.back = self - def __len__( self ): - return len( self.forw ) - def __getitem__( self, j ): - return self.forw[ -( j + 1 ) ] - def __repr__( self ): - seq = self.forw - if type(seq) == type( [] ) : - wrap = '[]' - sep = ', ' - elif type(seq) == type( () ) : - wrap = '()' - sep = ', ' - elif type(seq) == type( '' ) : - wrap = '' - sep = '' - else: - wrap = '<>' - sep = ', ' - outstrs = [] - for item in self.back : - outstrs.append( str( item ) ) - return wrap[:1] + joinfields( outstrs, sep ) + wrap[-1:] diff --git a/Demo/classes/Vec.py b/Demo/classes/Vec.py deleted file mode 100755 index 8289bc847e..0000000000 --- a/Demo/classes/Vec.py +++ /dev/null @@ -1,64 +0,0 @@ -# A simple vector class - - -def vec(*v): - return apply(Vec, v) - - -class Vec: - - def __init__(self, *v): - self.v = [] - for x in v: - self.v.append(x) - - - def fromlist(self, v): - self.v = [] - if type(v) <> type([]): - raise TypeError - self.v = v[:] - return self - - - def __repr__(self): - return 'vec(' + `self.v`[1:-1] + ')' - - def __len__(self): - return len(self.v) - - def __getitem__(self, i): - return self.v[i] - - def __add__(a, b): - # Element-wise addition - v = [] - for i in range(len(a)): - v.append(a[i] + b[i]) - return Vec().fromlist(v) - - def __sub__(a, b): - # Element-wise subtraction - v = [] - for i in range(len(a)): - v.append(a[i] - b[i]) - return Vec().fromlist(v) - - def __mul__(self, scalar): - # Multiply by scalar - v = [] - for i in range(len(self.v)): - v.append(self.v[i]*scalar) - return Vec().fromlist(v) - - - -def test(): - a = vec(1, 2, 3) - b = vec(3, 2, 1) - print a - print b - print a+b - print a*3.0 - -test() diff --git a/Demo/classes/bitvec.py b/Demo/classes/bitvec.py deleted file mode 100755 index b3469975a5..0000000000 --- a/Demo/classes/bitvec.py +++ /dev/null @@ -1,332 +0,0 @@ -# -# this is a rather strict implementation of a bit vector class -# it is accessed the same way as an array of python-ints, except -# the value must be 0 or 1 -# - -import sys; rprt = sys.stderr.write #for debugging - -error = 'bitvec.error' - - -def _check_value(value): - if type(value) != type(0) or not 0 <= value < 2: - raise error, 'bitvec() items must have int value 0 or 1' - - -import math - -def _compute_len(param): - mant, l = math.frexp(float(param)) - bitmask = 1L << l - if bitmask <= param: - raise 'FATAL', '(param, l) = ' + `param, l` - while l: - bitmask = bitmask >> 1 - if param & bitmask: - break - l = l - 1 - return l - - -def _check_key(len, key): - if type(key) != type(0): - raise TypeError, 'sequence subscript not int' - if key < 0: - key = key + len - if not 0 <= key < len: - raise IndexError, 'list index out of range' - return key - -def _check_slice(len, i, j): - #the type is ok, Python already checked that - i, j = max(i, 0), min(len, j) - if i > j: - i = j - return i, j - - -class BitVec: - - def __init__(self, *params): - self._data = 0L - self._len = 0 - if not len(params): - pass - elif len(params) == 1: - param, = params - if type(param) == type([]): - value = 0L - bit_mask = 1L - for item in param: - # strict check - #_check_value(item) - if item: - value = value | bit_mask - bit_mask = bit_mask << 1 - self._data = value - self._len = len(param) - elif type(param) == type(0L): - if param < 0: - raise error, 'bitvec() can\'t handle negative longs' - self._data = param - self._len = _compute_len(param) - else: - raise error, 'bitvec() requires array or long parameter' - elif len(params) == 2: - param, length = params - if type(param) == type(0L): - if param < 0: - raise error, \ - 'can\'t handle negative longs' - self._data = param - if type(length) != type(0): - raise error, 'bitvec()\'s 2nd parameter must be int' - computed_length = _compute_len(param) - if computed_length > length: - print 'warning: bitvec() value is longer than the length indicates, truncating value' - self._data = self._data & \ - ((1L << length) - 1) - self._len = length - else: - raise error, 'bitvec() requires array or long parameter' - else: - raise error, 'bitvec() requires 0 -- 2 parameter(s)' - - - def append(self, item): - #_check_value(item) - #self[self._len:self._len] = [item] - self[self._len:self._len] = \ - BitVec(long(not not item), 1) - - - def count(self, value): - #_check_value(value) - if value: - data = self._data - else: - data = (~self)._data - count = 0 - while data: - data, count = data >> 1, count + (data & 1 != 0) - return count - - - def index(self, value): - #_check_value(value): - if value: - data = self._data - else: - data = (~self)._data - index = 0 - if not data: - raise ValueError, 'list.index(x): x not in list' - while not (data & 1): - data, index = data >> 1, index + 1 - return index - - - def insert(self, index, item): - #_check_value(item) - #self[index:index] = [item] - self[index:index] = BitVec(long(not not item), 1) - - - def remove(self, value): - del self[self.index(value)] - - - def reverse(self): - #ouch, this one is expensive! - #for i in self._len>>1: self[i], self[l-i] = self[l-i], self[i] - data, result = self._data, 0L - for i in range(self._len): - if not data: - result = result << (self._len - i) - break - result, data = (result << 1) | (data & 1), data >> 1 - self._data = result - - - def sort(self): - c = self.count(1) - self._data = ((1L << c) - 1) << (self._len - c) - - - def copy(self): - return BitVec(self._data, self._len) - - - def seq(self): - result = [] - for i in self: - result.append(i) - return result - - - def __repr__(self): - ##rprt('.' + '__repr__()\n') - return 'bitvec' + `self._data, self._len` - - def __cmp__(self, other, *rest): - #rprt(`self`+'.__cmp__'+`(other, ) + rest`+'\n') - if type(other) != type(self): - other = apply(bitvec, (other, ) + rest) - #expensive solution... recursive binary, with slicing - length = self._len - if length == 0 or other._len == 0: - return cmp(length, other._len) - if length != other._len: - min_length = min(length, other._len) - return cmp(self[:min_length], other[:min_length]) or \ - cmp(self[min_length:], other[min_length:]) - #the lengths are the same now... - if self._data == other._data: - return 0 - if length == 1: - return cmp(self[0], other[0]) - else: - length = length >> 1 - return cmp(self[:length], other[:length]) or \ - cmp(self[length:], other[length:]) - - - def __len__(self): - #rprt(`self`+'.__len__()\n') - return self._len - - def __getitem__(self, key): - #rprt(`self`+'.__getitem__('+`key`+')\n') - key = _check_key(self._len, key) - return self._data & (1L << key) != 0 - - def __setitem__(self, key, value): - #rprt(`self`+'.__setitem__'+`key, value`+'\n') - key = _check_key(self._len, key) - #_check_value(value) - if value: - self._data = self._data | (1L << key) - else: - self._data = self._data & ~(1L << key) - - def __delitem__(self, key): - #rprt(`self`+'.__delitem__('+`key`+')\n') - key = _check_key(self._len, key) - #el cheapo solution... - self._data = self[:key]._data | self[key+1:]._data >> key - self._len = self._len - 1 - - def __getslice__(self, i, j): - #rprt(`self`+'.__getslice__'+`i, j`+'\n') - i, j = _check_slice(self._len, i, j) - if i >= j: - return BitVec(0L, 0) - if i: - ndata = self._data >> i - else: - ndata = self._data - nlength = j - i - if j != self._len: - #we'll have to invent faster variants here - #e.g. mod_2exp - ndata = ndata & ((1L << nlength) - 1) - return BitVec(ndata, nlength) - - def __setslice__(self, i, j, sequence, *rest): - #rprt(`self`+'.__setslice__'+`(i, j, sequence) + rest`+'\n') - i, j = _check_slice(self._len, i, j) - if type(sequence) != type(self): - sequence = apply(bitvec, (sequence, ) + rest) - #sequence is now of our own type - ls_part = self[:i] - ms_part = self[j:] - self._data = ls_part._data | \ - ((sequence._data | \ - (ms_part._data << sequence._len)) << ls_part._len) - self._len = self._len - j + i + sequence._len - - def __delslice__(self, i, j): - #rprt(`self`+'.__delslice__'+`i, j`+'\n') - i, j = _check_slice(self._len, i, j) - if i == 0 and j == self._len: - self._data, self._len = 0L, 0 - elif i < j: - self._data = self[:i]._data | (self[j:]._data >> i) - self._len = self._len - j + i - - def __add__(self, other): - #rprt(`self`+'.__add__('+`other`+')\n') - retval = self.copy() - retval[self._len:self._len] = other - return retval - - def __mul__(self, multiplier): - #rprt(`self`+'.__mul__('+`multiplier`+')\n') - if type(multiplier) != type(0): - raise TypeError, 'sequence subscript not int' - if multiplier <= 0: - return BitVec(0L, 0) - elif multiplier == 1: - return self.copy() - #handle special cases all 0 or all 1... - if self._data == 0L: - return BitVec(0L, self._len * multiplier) - elif (~self)._data == 0L: - return ~BitVec(0L, self._len * multiplier) - #otherwise el cheapo again... - retval = BitVec(0L, 0) - while multiplier: - retval, multiplier = retval + self, multiplier - 1 - return retval - - def __and__(self, otherseq, *rest): - #rprt(`self`+'.__and__'+`(otherseq, ) + rest`+'\n') - if type(otherseq) != type(self): - otherseq = apply(bitvec, (otherseq, ) + rest) - #sequence is now of our own type - return BitVec(self._data & otherseq._data, \ - min(self._len, otherseq._len)) - - - def __xor__(self, otherseq, *rest): - #rprt(`self`+'.__xor__'+`(otherseq, ) + rest`+'\n') - if type(otherseq) != type(self): - otherseq = apply(bitvec, (otherseq, ) + rest) - #sequence is now of our own type - return BitVec(self._data ^ otherseq._data, \ - max(self._len, otherseq._len)) - - - def __or__(self, otherseq, *rest): - #rprt(`self`+'.__or__'+`(otherseq, ) + rest`+'\n') - if type(otherseq) != type(self): - otherseq = apply(bitvec, (otherseq, ) + rest) - #sequence is now of our own type - return BitVec(self._data | otherseq._data, \ - max(self._len, otherseq._len)) - - - def __invert__(self): - #rprt(`self`+'.__invert__()\n') - return BitVec(~self._data & ((1L << self._len) - 1), \ - self._len) - - def __coerce__(self, otherseq, *rest): - #needed for *some* of the arithmetic operations - #rprt(`self`+'.__coerce__'+`(otherseq, ) + rest`+'\n') - if type(otherseq) != type(self): - otherseq = apply(bitvec, (otherseq, ) + rest) - return self, otherseq - - def __int__(self): - return int(self._data) - - def __long__(self): - return long(self._data) - - def __float__(self): - return float(self._data) - - -bitvec = BitVec diff --git a/Demo/classes/class.doc b/Demo/classes/class.doc deleted file mode 100755 index fddc60bf7b..0000000000 --- a/Demo/classes/class.doc +++ /dev/null @@ -1,110 +0,0 @@ -New features of classes -======================= - -A class can implement certain operations that are invoked by special -syntax (such as subscription or arithmetic operations) by defining -methods with special names. - - -Special methods for any type ----------------------------- - -__repr__(self) --> string - -Used by the print statement and conversions (reverse quotes) to -compute the string representation of an object. - -__cmp__(self, other) --> int - -Used by all comparison operations. Should return -1 if selfother. Due to limitations in the -interpreter, exceptions raised by comparisons are ignored, and the -objects will be considered equal in this case. - - -Special methods for sequence and mapping types ----------------------------------------------- - -__len__(self) --> int - -Used by the built-in function len(). Should return the length of the -object, which should be >= 0. Also, an object whose __len__() method -returns 0 - -__getitem__(self, key) --> value - -Used to implement value = self[key]. Note that the special -interpretation of negative keys (if the class wishes to emulate a -sequence type) is up to the __getitem__ method. - -__setitem__(self, key, value) - -Used to implement self[key] = value. Same note as for __getitem__. - -__delitem__(self, key) - -Used to implement del self[key]. Same note as for __getitem__. - - -Special methods for sequence types ----------------------------------- - -__getslice__(self, i, j) --> sequence - -Used to implement self[i:j]. Note that missing i or j are replaced by -0 or len(self), respectively, and len(self) has been added to negative -i or j. - -__setslice__(self, i, j, sequence) - -Used to implement self[i:j] = value. Same note as for __getslice__. - -__delslice__(self, i, j) - -Used to implement del self[i:j]. Same note as for __getslice__. - - -Special methods for numeric types ---------------------------------- - -__add__, __sub__, __mul__, __div__, __mod__, __divmod__, __pow__, -__lshift__, __rshift__, __and__, __xor__, __or__ - -Used to implement the binary arithmetic operations (divmod and pow are -called by built-in functions). All have the call pattern -func(self, other) --> number. - -__neg__, __pos__, __abs__, __invert__ - -Used to implement the unary arithmetic operations (-, +, abs and ~). -All have the call pattern func(self) --> number. - -__nonzero__(self) --> int - -Used to implement boolean testing. An alternative name for this -method is __len__. - -__coerce__(self, other) --> (self1, other1) or None - -Used to implement "mixed-mode" numeric arithmetic. Either return a -tuple containing self and other converted to some common type, or None -if no way of conversion is known. When the common type would be the -type of other, it is sufficient to return None, since the interpreter -will also ask the other object to attempt a coercion (but sometimes, -if the implementation of the other type cannot be changed, it is -useful to do the conversion to the other type here). - -__int__(self) --> int -__long__(self) --> long -__float__(self) --> float - -Used to implement the built-in functions int(), long() and float(). - - -Notes ------ - -Except for __repr__ and __cmp__, when no appropriate method is -defined, attempts to execute the operation raise an exception. For -__repr__ and __cmp__, the traditional interpretations are used -in this case. diff --git a/Demo/comparisons/README b/Demo/comparisons/README deleted file mode 100644 index 111667c264..0000000000 --- a/Demo/comparisons/README +++ /dev/null @@ -1,60 +0,0 @@ -Subject: Re: What language would you use? -From: Tom Christiansen -Date: 6 Nov 1994 15:14:51 GMT -Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl -Message-Id: <39irtb$3t4@csnews.cs.Colorado.EDU> -References: <39b7ha$j9v@zeno.nscf.org> <39hhjp$lgn@csnews.cs.Colorado.EDU> <39hvsu$dus@mathserv.mps.ohio-state.edu> - -[...] -If you're really into benchmarks, I'd love it if someone were to code up -the following problems in tcl, python, and scheme (and whatever else you'd -like). Separate versions (one optimized for speed, one for beauty :-) are -ok. Post your code so we can time it on our own systems. - -0) Factorial Test (numerics and function calls) - - (we did this already) - -1) Regular Expressions Test - - Read a file of (extended per egrep) regular expressions (one per line), - and apply those to all files whose names are listed on the command line. - Basically, an 'egrep -f' simulator. Test it with 20 "vt100" patterns - against a five /etc/termcap files. Tests using more elaborate patters - would also be interesting. Your code should not break if given hundreds - of regular expressions or binary files to scan. - -2) Sorting Test - - Sort an input file that consists of lines like this - - var1=23 other=14 ditto=23 fred=2 - - such that each output line is sorted WRT to the number. Order - of output lines does not change. Resolve collisions using the - variable name. e.g. - - fred=2 other=14 ditto=23 var1=23 - - Lines may be up to several kilobytes in length and contain - zillions of variables. - -3) System Test - - Given a list of directories, report any bogus symbolic links contained - anywhere in those subtrees. A bogus symbolic link is one that cannot - be resolved because it points to a nonexistent or otherwise - unresolvable file. Do *not* use an external find executable. - Directories may be very very deep. Print a warning immediately if the - system you're running on doesn't support symbolic links. - - -I'll post perl solutions if people post the others. - - ---tom --- -Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com - - "But Billy! A *small* allowance prepares you for a lifetime of small - salaries and for your Social Security payments." --Family Circus diff --git a/Demo/comparisons/patterns b/Demo/comparisons/patterns deleted file mode 100755 index f4da846af6..0000000000 --- a/Demo/comparisons/patterns +++ /dev/null @@ -1,4 +0,0 @@ -^def -^class -^import -^from diff --git a/Demo/comparisons/regextest.py b/Demo/comparisons/regextest.py deleted file mode 100755 index 97564b7939..0000000000 --- a/Demo/comparisons/regextest.py +++ /dev/null @@ -1,50 +0,0 @@ -#! /usr/bin/env python - -# 1) Regular Expressions Test -# -# Read a file of (extended per egrep) regular expressions (one per line), -# and apply those to all files whose names are listed on the command line. -# Basically, an 'egrep -f' simulator. Test it with 20 "vt100" patterns -# against a five /etc/termcap files. Tests using more elaborate patters -# would also be interesting. Your code should not break if given hundreds -# of regular expressions or binary files to scan. - -# This implementation: -# - combines all patterns into a single one using ( ... | ... | ... ) -# - reads patterns from stdin, scans files given as command line arguments -# - produces output in the format :: -# - is only about 2.5 times as slow as egrep (though I couldn't run -# Tom's test -- this system, a vanilla SGI, only has /etc/terminfo) - -import string -import sys -import regex -from regex_syntax import * - -regex.set_syntax(RE_SYNTAX_EGREP) - -def main(): - pats = map(chomp, sys.stdin.readlines()) - bigpat = '(' + string.joinfields(pats, '|') + ')' - prog = regex.compile(bigpat) - - for file in sys.argv[1:]: - try: - fp = open(file, 'r') - except IOError, msg: - print "%s: %s" % (file, msg) - continue - lineno = 0 - while 1: - line = fp.readline() - if not line: - break - lineno = lineno + 1 - if prog.search(line) >= 0: - print "%s:%s:%s" % (file, lineno, line), - -def chomp(s): - if s[-1:] == '\n': return s[:-1] - else: return s - -main() diff --git a/Demo/comparisons/sortingtest.py b/Demo/comparisons/sortingtest.py deleted file mode 100755 index d6c213ca75..0000000000 --- a/Demo/comparisons/sortingtest.py +++ /dev/null @@ -1,50 +0,0 @@ -#! /usr/bin/env python - -# 2) Sorting Test -# -# Sort an input file that consists of lines like this -# -# var1=23 other=14 ditto=23 fred=2 -# -# such that each output line is sorted WRT to the number. Order -# of output lines does not change. Resolve collisions using the -# variable name. e.g. -# -# fred=2 other=14 ditto=23 var1=23 -# -# Lines may be up to several kilobytes in length and contain -# zillions of variables. - -# This implementation: -# - Reads stdin, writes stdout -# - Uses any amount of whitespace to separate fields -# - Allows signed numbers -# - Treats illegally formatted fields as field=0 -# - Outputs the sorted fields with exactly one space between them -# - Handles blank input lines correctly - -import regex -import string -import sys - -def main(): - prog = regex.compile('^\(.*\)=\([-+]?[0-9]+\)') - def makekey(item, prog=prog): - if prog.match(item) >= 0: - var, num = prog.group(1, 2) - return string.atoi(num), var - else: - # Bad input -- pretend it's a var with value 0 - return 0, item - while 1: - line = sys.stdin.readline() - if not line: - break - items = string.split(line) - items = map(makekey, items) - items.sort() - for num, var in items: - print "%s=%s" % (var, num), - print - -main() diff --git a/Demo/comparisons/systemtest.py b/Demo/comparisons/systemtest.py deleted file mode 100755 index f2533b1c0c..0000000000 --- a/Demo/comparisons/systemtest.py +++ /dev/null @@ -1,74 +0,0 @@ -#! /usr/bin/env python - -# 3) System Test -# -# Given a list of directories, report any bogus symbolic links contained -# anywhere in those subtrees. A bogus symbolic link is one that cannot -# be resolved because it points to a nonexistent or otherwise -# unresolvable file. Do *not* use an external find executable. -# Directories may be very very deep. Print a warning immediately if the -# system you're running on doesn't support symbolic links. - -# This implementation: -# - takes one optional argument, using the current directory as default -# - uses chdir to increase performance -# - sorts the names per directory -# - prints output lines of the form "path1 -> path2" as it goes -# - prints error messages about directories it can't list or chdir into - -import os -import sys -from stat import * - -def main(): - try: - # Note: can't test for presence of lstat -- it's always there - dummy = os.readlink - except AttributeError: - print "This system doesn't have symbolic links" - sys.exit(0) - if sys.argv[1:]: - prefix = sys.argv[1] - else: - prefix = '' - if prefix: - os.chdir(prefix) - if prefix[-1:] != '/': prefix = prefix + '/' - reportboguslinks(prefix) - else: - reportboguslinks('') - -def reportboguslinks(prefix): - try: - names = os.listdir('.') - except os.error, msg: - print "%s%s: can't list: %s" % (prefix, '.', msg) - return - names.sort() - for name in names: - if name == os.curdir or name == os.pardir: - continue - try: - mode = os.lstat(name)[ST_MODE] - except os.error: - print "%s%s: can't stat: %s" % (prefix, name, msg) - continue - if S_ISLNK(mode): - try: - os.stat(name) - except os.error: - print "%s%s -> %s" % \ - (prefix, name, os.readlink(name)) - elif S_ISDIR(mode): - try: - os.chdir(name) - except os.error, msg: - print "%s%s: can't chdir: %s" % \ - (prefix, name, msg) - continue - try: - reportboguslinks(prefix + name + '/') - finally: - os.chdir('..') - -main() diff --git a/Demo/dns/README b/Demo/dns/README deleted file mode 100644 index 2f6d751f9d..0000000000 --- a/Demo/dns/README +++ /dev/null @@ -1,16 +0,0 @@ -This directory contains a module (dnslib) that implements a DNS -(Domain Name Server) client, plus additional modules that define some -symbolic constants used by DNS (dnstype, dnsclass, dnsopcode). - -Type "python dnslib.py -/" for a usage message. - -You can also import dnslib and write your own, more sophisticated -client code; use the test program as an example (there is currently no -documentation :-). - -Anthony Baxter maintains an enhanced version of this code at - - http://alumni.dgs.monash.edu.au/~anthony/python/ - ---Guido van Rossum, CWI, Amsterdam -URL: diff --git a/Demo/dns/asgethost.py b/Demo/dns/asgethost.py deleted file mode 100755 index 2e9185a13e..0000000000 --- a/Demo/dns/asgethost.py +++ /dev/null @@ -1,35 +0,0 @@ -import sys -import dnslib -import dnstype -import dnsopcode -import dnsclass -import socket -import select - -def main(): - server = 'cnri.reston.va.us' # How? - port = 53 - opcode = dnsopcode.QUERY - rd = 0 - qtype = dnstype.MX - qname = sys.argv[1:] and sys.argv[1] or 'www.python.org' - m = dnslib.Mpacker() - m.addHeader(0, - 0, opcode, 0, 0, rd, 0, 0, 0, - 1, 0, 0, 0) - m.addQuestion(qname, qtype, dnsclass.IN) - request = m.getbuf() - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - s.connect((server, port)) - s.send(request) - while 1: - r, w, x = [s], [], [] - r, w, x = select.select(r, w, x, 0.333) - print r, w, x - if r: - reply = s.recv(1024) - u = dnslib.Munpacker(reply) - dnslib.dumpM(u) - break - -main() diff --git a/Demo/dns/dnsclass.py b/Demo/dns/dnsclass.py deleted file mode 100755 index f90b9e8460..0000000000 --- a/Demo/dns/dnsclass.py +++ /dev/null @@ -1,23 +0,0 @@ -# CLASS values (section 3.2.4) - -IN = 1 # the Internet -CS = 2 # the CSNET class (Obsolete - used only for examples in - # some obsolete RFCs) -CH = 3 # the CHAOS class -HS = 4 # Hesiod [Dyer 87] - -# QCLASS values (section 3.2.5) - -ANY = 255 # any class - - -# Construct reverse mapping dictionary - -_names = dir() -classmap = {} -for _name in _names: - if _name[0] != '_': classmap[eval(_name)] = _name - -def classstr(klass): - if classmap.has_key(klass): return classmap[klass] - else: return `klass` diff --git a/Demo/dns/dnslib.py b/Demo/dns/dnslib.py deleted file mode 100755 index 4e1fb87b2c..0000000000 --- a/Demo/dns/dnslib.py +++ /dev/null @@ -1,588 +0,0 @@ -# Domain Name Server (DNS) interface -# -# See RFC 1035: -# ------------------------------------------------------------------------ -# Network Working Group P. Mockapetris -# Request for Comments: 1035 ISI -# November 1987 -# Obsoletes: RFCs 882, 883, 973 -# -# DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION -# ------------------------------------------------------------------------ - - -import string - -import dnstype -import dnsclass -import dnsopcode - - -# Low-level 16 and 32 bit integer packing and unpacking - -def pack16bit(n): - return chr((n>>8)&0xFF) + chr(n&0xFF) - -def pack32bit(n): - return chr((n>>24)&0xFF) + chr((n>>16)&0xFF) \ - + chr((n>>8)&0xFF) + chr(n&0xFF) - -def unpack16bit(s): - return (ord(s[0])<<8) | ord(s[1]) - -def unpack32bit(s): - return (ord(s[0])<<24) | (ord(s[1])<<16) \ - | (ord(s[2])<<8) | ord(s[3]) - -def addr2bin(addr): - if type(addr) == type(0): - return addr - bytes = string.splitfields(addr, '.') - if len(bytes) != 4: raise ValueError, 'bad IP address' - n = 0 - for byte in bytes: n = n<<8 | string.atoi(byte) - return n - -def bin2addr(n): - return '%d.%d.%d.%d' % ((n>>24)&0xFF, (n>>16)&0xFF, - (n>>8)&0xFF, n&0xFF) - - -# Packing class - -class Packer: - def __init__(self): - self.buf = '' - self.index = {} - def getbuf(self): - return self.buf - def addbyte(self, c): - if len(c) != 1: raise TypeError, 'one character expected' - self.buf = self.buf + c - def addbytes(self, bytes): - self.buf = self.buf + bytes - def add16bit(self, n): - self.buf = self.buf + pack16bit(n) - def add32bit(self, n): - self.buf = self.buf + pack32bit(n) - def addaddr(self, addr): - n = addr2bin(addr) - self.buf = self.buf + pack32bit(n) - def addstring(self, s): - self.addbyte(chr(len(s))) - self.addbytes(s) - def addname(self, name): - # Domain name packing (section 4.1.4) - # Add a domain name to the buffer, possibly using pointers. - # The case of the first occurrence of a name is preserved. - # Redundant dots are ignored. - list = [] - for label in string.splitfields(name, '.'): - if label: - if len(label) > 63: - raise PackError, 'label too long' - list.append(label) - keys = [] - for i in range(len(list)): - key = string.upper(string.joinfields(list[i:], '.')) - keys.append(key) - if self.index.has_key(key): - pointer = self.index[key] - break - else: - i = len(list) - pointer = None - # Do it into temporaries first so exceptions don't - # mess up self.index and self.buf - buf = '' - offset = len(self.buf) - index = [] - for j in range(i): - label = list[j] - n = len(label) - if offset + len(buf) < 0x3FFF: - index.append( (keys[j], offset + len(buf)) ) - else: - print 'dnslib.Packer.addname:', - print 'warning: pointer too big' - buf = buf + (chr(n) + label) - if pointer: - buf = buf + pack16bit(pointer | 0xC000) - else: - buf = buf + '\0' - self.buf = self.buf + buf - for key, value in index: - self.index[key] = value - def dump(self): - keys = self.index.keys() - keys.sort() - print '-'*40 - for key in keys: - print '%20s %3d' % (key, self.index[key]) - print '-'*40 - space = 1 - for i in range(0, len(self.buf)+1, 2): - if self.buf[i:i+2] == '**': - if not space: print - space = 1 - continue - space = 0 - print '%4d' % i, - for c in self.buf[i:i+2]: - if ' ' < c < '\177': - print ' %c' % c, - else: - print '%2d' % ord(c), - print - print '-'*40 - - -# Unpacking class - -UnpackError = 'dnslib.UnpackError' # Exception - -class Unpacker: - def __init__(self, buf): - self.buf = buf - self.offset = 0 - def getbyte(self): - c = self.buf[self.offset] - self.offset = self.offset + 1 - return c - def getbytes(self, n): - s = self.buf[self.offset : self.offset + n] - if len(s) != n: raise UnpackError, 'not enough data left' - self.offset = self.offset + n - return s - def get16bit(self): - return unpack16bit(self.getbytes(2)) - def get32bit(self): - return unpack32bit(self.getbytes(4)) - def getaddr(self): - return bin2addr(self.get32bit()) - def getstring(self): - return self.getbytes(ord(self.getbyte())) - def getname(self): - # Domain name unpacking (section 4.1.4) - c = self.getbyte() - i = ord(c) - if i & 0xC0 == 0xC0: - d = self.getbyte() - j = ord(d) - pointer = ((i<<8) | j) & ~0xC000 - save_offset = self.offset - try: - self.offset = pointer - domain = self.getname() - finally: - self.offset = save_offset - return domain - if i == 0: - return '' - domain = self.getbytes(i) - remains = self.getname() - if not remains: - return domain - else: - return domain + '.' + remains - - -# Test program for packin/unpacking (section 4.1.4) - -def testpacker(): - N = 25 - R = range(N) - import timing - # See section 4.1.4 of RFC 1035 - timing.start() - for i in R: - p = Packer() - p.addbytes('*' * 20) - p.addname('f.ISI.ARPA') - p.addbytes('*' * 8) - p.addname('Foo.F.isi.arpa') - p.addbytes('*' * 18) - p.addname('arpa') - p.addbytes('*' * 26) - p.addname('') - timing.finish() - print round(timing.milli() * 0.001 / N, 3), 'seconds per packing' - p.dump() - u = Unpacker(p.buf) - u.getbytes(20) - u.getname() - u.getbytes(8) - u.getname() - u.getbytes(18) - u.getname() - u.getbytes(26) - u.getname() - timing.start() - for i in R: - u = Unpacker(p.buf) - res = (u.getbytes(20), - u.getname(), - u.getbytes(8), - u.getname(), - u.getbytes(18), - u.getname(), - u.getbytes(26), - u.getname()) - timing.finish() - print round(timing.milli() * 0.001 / N, 3), 'seconds per unpacking' - for item in res: print item - - -# Pack/unpack RR toplevel format (section 3.2.1) - -class RRpacker(Packer): - def __init__(self): - Packer.__init__(self) - self.rdstart = None - def addRRheader(self, name, type, klass, ttl, *rest): - self.addname(name) - self.add16bit(type) - self.add16bit(klass) - self.add32bit(ttl) - if rest: - if res[1:]: raise TypeError, 'too many args' - rdlength = rest[0] - else: - rdlength = 0 - self.add16bit(rdlength) - self.rdstart = len(self.buf) - def patchrdlength(self): - rdlength = unpack16bit(self.buf[self.rdstart-2:self.rdstart]) - if rdlength == len(self.buf) - self.rdstart: - return - rdata = self.buf[self.rdstart:] - save_buf = self.buf - ok = 0 - try: - self.buf = self.buf[:self.rdstart-2] - self.add16bit(len(rdata)) - self.buf = self.buf + rdata - ok = 1 - finally: - if not ok: self.buf = save_buf - def endRR(self): - if self.rdstart is not None: - self.patchrdlength() - self.rdstart = None - def getbuf(self): - if self.rdstart is not None: self.patchrdlenth() - return Packer.getbuf(self) - # Standard RRs (section 3.3) - def addCNAME(self, name, klass, ttl, cname): - self.addRRheader(name, dnstype.CNAME, klass, ttl) - self.addname(cname) - self.endRR() - def addHINFO(self, name, klass, ttl, cpu, os): - self.addRRheader(name, dnstype.HINFO, klass, ttl) - self.addstring(cpu) - self.addstring(os) - self.endRR() - def addMX(self, name, klass, ttl, preference, exchange): - self.addRRheader(name, dnstype.MX, klass, ttl) - self.add16bit(preference) - self.addname(exchange) - self.endRR() - def addNS(self, name, klass, ttl, nsdname): - self.addRRheader(name, dnstype.NS, klass, ttl) - self.addname(nsdname) - self.endRR() - def addPTR(self, name, klass, ttl, ptrdname): - self.addRRheader(name, dnstype.PTR, klass, ttl) - self.addname(ptrdname) - self.endRR() - def addSOA(self, name, klass, ttl, - mname, rname, serial, refresh, retry, expire, minimum): - self.addRRheader(name, dnstype.SOA, klass, ttl) - self.addname(mname) - self.addname(rname) - self.add32bit(serial) - self.add32bit(refresh) - self.add32bit(retry) - self.add32bit(expire) - self.add32bit(minimum) - self.endRR() - def addTXT(self, name, klass, ttl, list): - self.addRRheader(name, dnstype.TXT, klass, ttl) - for txtdata in list: - self.addstring(txtdata) - self.endRR() - # Internet specific RRs (section 3.4) -- class = IN - def addA(self, name, ttl, address): - self.addRRheader(name, dnstype.A, dnsclass.IN, ttl) - self.addaddr(address) - self.endRR() - def addWKS(self, name, ttl, address, protocol, bitmap): - self.addRRheader(name, dnstype.WKS, dnsclass.IN, ttl) - self.addaddr(address) - self.addbyte(chr(protocol)) - self.addbytes(bitmap) - self.endRR() - - -class RRunpacker(Unpacker): - def __init__(self, buf): - Unpacker.__init__(self, buf) - self.rdend = None - def getRRheader(self): - name = self.getname() - type = self.get16bit() - klass = self.get16bit() - ttl = self.get32bit() - rdlength = self.get16bit() - self.rdend = self.offset + rdlength - return (name, type, klass, ttl, rdlength) - def endRR(self): - if self.offset != self.rdend: - raise UnpackError, 'end of RR not reached' - def getCNAMEdata(self): - return self.getname() - def getHINFOdata(self): - return self.getstring(), self.getstring() - def getMXdata(self): - return self.get16bit(), self.getname() - def getNSdata(self): - return self.getname() - def getPTRdata(self): - return self.getname() - def getSOAdata(self): - return self.getname(), \ - self.getname(), \ - self.get32bit(), \ - self.get32bit(), \ - self.get32bit(), \ - self.get32bit(), \ - self.get32bit() - def getTXTdata(self): - list = [] - while self.offset != self.rdend: - list.append(self.getstring()) - return list - def getAdata(self): - return self.getaddr() - def getWKSdata(self): - address = self.getaddr() - protocol = ord(self.getbyte()) - bitmap = self.getbytes(self.rdend - self.offset) - return address, protocol, bitmap - - -# Pack/unpack Message Header (section 4.1) - -class Hpacker(Packer): - def addHeader(self, id, qr, opcode, aa, tc, rd, ra, z, rcode, - qdcount, ancount, nscount, arcount): - self.add16bit(id) - self.add16bit((qr&1)<<15 | (opcode*0xF)<<11 | (aa&1)<<10 - | (tc&1)<<9 | (rd&1)<<8 | (ra&1)<<7 - | (z&7)<<4 | (rcode&0xF)) - self.add16bit(qdcount) - self.add16bit(ancount) - self.add16bit(nscount) - self.add16bit(arcount) - -class Hunpacker(Unpacker): - def getHeader(self): - id = self.get16bit() - flags = self.get16bit() - qr, opcode, aa, tc, rd, ra, z, rcode = ( - (flags>>15)&1, - (flags>>11)&0xF, - (flags>>10)&1, - (flags>>9)&1, - (flags>>8)&1, - (flags>>7)&1, - (flags>>4)&7, - (flags>>0)&0xF) - qdcount = self.get16bit() - ancount = self.get16bit() - nscount = self.get16bit() - arcount = self.get16bit() - return (id, qr, opcode, aa, tc, rd, ra, z, rcode, - qdcount, ancount, nscount, arcount) - - -# Pack/unpack Question (section 4.1.2) - -class Qpacker(Packer): - def addQuestion(self, qname, qtype, qclass): - self.addname(qname) - self.add16bit(qtype) - self.add16bit(qclass) - -class Qunpacker(Unpacker): - def getQuestion(self): - return self.getname(), self.get16bit(), self.get16bit() - - -# Pack/unpack Message(section 4) -# NB the order of the base classes is important for __init__()! - -class Mpacker(RRpacker, Qpacker, Hpacker): - pass - -class Munpacker(RRunpacker, Qunpacker, Hunpacker): - pass - - -# Routines to print an unpacker to stdout, for debugging. -# These affect the unpacker's current position! - -def dumpM(u): - print 'HEADER:', - (id, qr, opcode, aa, tc, rd, ra, z, rcode, - qdcount, ancount, nscount, arcount) = u.getHeader() - print 'id=%d,' % id, - print 'qr=%d, opcode=%d, aa=%d, tc=%d, rd=%d, ra=%d, z=%d, rcode=%d,' \ - % (qr, opcode, aa, tc, rd, ra, z, rcode) - if tc: print '*** response truncated! ***' - if rcode: print '*** nonzero error code! (%d) ***' % rcode - print ' qdcount=%d, ancount=%d, nscount=%d, arcount=%d' \ - % (qdcount, ancount, nscount, arcount) - for i in range(qdcount): - print 'QUESTION %d:' % i, - dumpQ(u) - for i in range(ancount): - print 'ANSWER %d:' % i, - dumpRR(u) - for i in range(nscount): - print 'AUTHORITY RECORD %d:' % i, - dumpRR(u) - for i in range(arcount): - print 'ADDITIONAL RECORD %d:' % i, - dumpRR(u) - -def dumpQ(u): - qname, qtype, qclass = u.getQuestion() - print 'qname=%s, qtype=%d(%s), qclass=%d(%s)' \ - % (qname, - qtype, dnstype.typestr(qtype), - qclass, dnsclass.classstr(qclass)) - -def dumpRR(u): - name, type, klass, ttl, rdlength = u.getRRheader() - typename = dnstype.typestr(type) - print 'name=%s, type=%d(%s), class=%d(%s), ttl=%d' \ - % (name, - type, typename, - klass, dnsclass.classstr(klass), - ttl) - mname = 'get%sdata' % typename - if hasattr(u, mname): - print ' formatted rdata:', getattr(u, mname)() - else: - print ' binary rdata:', u.getbytes(rdlength) - - -# Test program - -def test(): - import sys - import getopt - import socket - protocol = 'udp' - server = 'cnri.reston.va.us' # XXX adapt this to your local - port = 53 - opcode = dnsopcode.QUERY - rd = 0 - qtype = dnstype.MX - qname = 'cwi.nl' - try: - opts, args = getopt.getopt(sys.argv[1:], 'Trs:tu') - if len(args) > 2: raise getopt.error, 'too many arguments' - except getopt.error, msg: - print msg - print 'Usage: python dnslib.py', - print '[-T] [-r] [-s server] [-t] [-u]', - print '[qtype [qname]]' - print '-T: run testpacker() and exit' - print '-r: recursion desired (default not)' - print '-s server: use server (default %s)' % server - print '-t: use TCP protocol' - print '-u: use UDP protocol (default)' - print 'qtype: query type (default %s)' % \ - dnstype.typestr(qtype) - print 'qname: query name (default %s)' % qname - print 'Recognized qtype values:' - qtypes = dnstype.typemap.keys() - qtypes.sort() - n = 0 - for qtype in qtypes: - n = n+1 - if n >= 8: n = 1; print - print '%s = %d' % (dnstype.typemap[qtype], qtype), - print - sys.exit(2) - for o, a in opts: - if o == '-T': testpacker(); return - if o == '-t': protocol = 'tcp' - if o == '-u': protocol = 'udp' - if o == '-s': server = a - if o == '-r': rd = 1 - if args[0:]: - try: - qtype = eval(string.upper(args[0]), dnstype.__dict__) - except (NameError, SyntaxError): - print 'bad query type:', `args[0]` - sys.exit(2) - if args[1:]: - qname = args[1] - if qtype == dnstype.AXFR: - print 'Query type AXFR, protocol forced to TCP' - protocol = 'tcp' - print 'QTYPE %d(%s)' % (qtype, dnstype.typestr(qtype)) - m = Mpacker() - m.addHeader(0, - 0, opcode, 0, 0, rd, 0, 0, 0, - 1, 0, 0, 0) - m.addQuestion(qname, qtype, dnsclass.IN) - request = m.getbuf() - if protocol == 'udp': - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - s.connect((server, port)) - s.send(request) - reply = s.recv(1024) - else: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect((server, port)) - s.send(pack16bit(len(request)) + request) - s.shutdown(1) - f = s.makefile('r') - header = f.read(2) - if len(header) < 2: - print '*** EOF ***' - return - count = unpack16bit(header) - reply = f.read(count) - if len(reply) != count: - print '*** Incomplete reply ***' - return - u = Munpacker(reply) - dumpM(u) - if protocol == 'tcp' and qtype == dnstype.AXFR: - while 1: - header = f.read(2) - if len(header) < 2: - print '========== EOF ==========' - break - count = unpack16bit(header) - if not count: - print '========== ZERO COUNT ==========' - break - print '========== NEXT ==========' - reply = f.read(count) - if len(reply) != count: - print '*** Incomplete reply ***' - break - u = Munpacker(reply) - dumpM(u) - - -# Run test program when called as a script - -if __name__ == '__main__': - test() diff --git a/Demo/dns/dnsopcode.py b/Demo/dns/dnsopcode.py deleted file mode 100755 index f2e7cd5b0a..0000000000 --- a/Demo/dns/dnsopcode.py +++ /dev/null @@ -1,16 +0,0 @@ -# Opcode values in message header (section 4.1.1) - -QUERY = 0 -IQUERY = 1 -STATUS = 2 - -# Construct reverse mapping dictionary - -_names = dir() -opcodemap = {} -for _name in _names: - if _name[0] != '_': opcodemap[eval(_name)] = _name - -def opcodestr(opcode): - if opcodemap.has_key(opcode): return opcodemap[opcode] - else: return `opcode` diff --git a/Demo/dns/dnstype.py b/Demo/dns/dnstype.py deleted file mode 100755 index 80c2b76c45..0000000000 --- a/Demo/dns/dnstype.py +++ /dev/null @@ -1,41 +0,0 @@ -# TYPE values (section 3.2.2) - -A = 1 # a host address -NS = 2 # an authoritative name server -MD = 3 # a mail destination (Obsolete - use MX) -MF = 4 # a mail forwarder (Obsolete - use MX) -CNAME = 5 # the canonical name for an alias -SOA = 6 # marks the start of a zone of authority -MB = 7 # a mailbox domain name (EXPERIMENTAL) -MG = 8 # a mail group member (EXPERIMENTAL) -MR = 9 # a mail rename domain name (EXPERIMENTAL) -NULL = 10 # a null RR (EXPERIMENTAL) -WKS = 11 # a well known service description -PTR = 12 # a domain name pointer -HINFO = 13 # host information -MINFO = 14 # mailbox or mail list information -MX = 15 # mail exchange -TXT = 16 # text strings - -# Additional TYPE values from host.c source - -UNAME = 110 -MP = 240 - -# QTYPE values (section 3.2.3) - -AXFR = 252 # A request for a transfer of an entire zone -MAILB = 253 # A request for mailbox-related records (MB, MG or MR) -MAILA = 254 # A request for mail agent RRs (Obsolete - see MX) -ANY = 255 # A request for all records - -# Construct reverse mapping dictionary - -_names = dir() -typemap = {} -for _name in _names: - if _name[0] != '_': typemap[eval(_name)] = _name - -def typestr(type): - if typemap.has_key(type): return typemap[type] - else: return `type` diff --git a/Demo/embed/Makefile b/Demo/embed/Makefile deleted file mode 100644 index fb2b1edc2a..0000000000 --- a/Demo/embed/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# Makefile for embedded Python use demo. -# (This version tailored for my Red Hat Linux 6.1 setup; -# edit lines marked with XXX.) - -# XXX The compiler you are using -CC= gcc - -# XXX Top of the build tree and source tree -blddir= ../../linux -srcdir= ../.. - -# Python version -VERSION= 2.0 - -# Compiler flags -OPT= -g -INCLUDES= -I$(srcdir)/Include -I$(blddir) -CFLAGS= $(OPT) $(INCLUDES) - -# The Python library -LIBPYTHON= $(blddir)/libpython$(VERSION).a - -# XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile -LIBS= -lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil -LDFLAGS= -Xlinker -export-dynamic -SYSLIBS= -lm -MODLIBS= -ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS) - -# Build the demo application -all: demo -demo: demo.o - $(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo - -# Administrative targets - -test: demo - ./demo - -clean: - -rm -f *.o core - -clobber: clean - -rm -f *~ @* '#'* demo diff --git a/Demo/embed/README b/Demo/embed/README deleted file mode 100644 index 8858c713e4..0000000000 --- a/Demo/embed/README +++ /dev/null @@ -1,12 +0,0 @@ -This directory show how to embed the Python interpreter in your own -application. The file demo.c shows you all that is needed in your C -code. - -To build it, you may have to edit the Makefile: - -1) set blddir to the directory where you built Python, if it isn't in -the source directory (../..) - -2) change the variables that together define the list of libraries -(MODLIBS, LIBS, SYSLIBS) to link with, to match their definitions in -$(blddir)/Modules/Makefile diff --git a/Demo/embed/demo.c b/Demo/embed/demo.c deleted file mode 100644 index 26df355e5c..0000000000 --- a/Demo/embed/demo.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Example of embedding Python in another program */ - -#include "Python.h" - -void initxyzzy(void); /* Forward */ - -main(int argc, char **argv) -{ - /* Pass argv[0] to the Python interpreter */ - Py_SetProgramName(argv[0]); - - /* Initialize the Python interpreter. Required. */ - Py_Initialize(); - - /* Add a static module */ - initxyzzy(); - - /* Define sys.argv. It is up to the application if you - want this; you can also let it undefined (since the Python - code is generally not a main program it has no business - touching sys.argv...) */ - PySys_SetArgv(argc, argv); - - /* Do some application specific code */ - printf("Hello, brave new world\n\n"); - - /* Execute some Python statements (in module __main__) */ - PyRun_SimpleString("import sys\n"); - PyRun_SimpleString("print sys.builtin_module_names\n"); - PyRun_SimpleString("print sys.modules.keys()\n"); - PyRun_SimpleString("print sys.executable\n"); - PyRun_SimpleString("print sys.argv\n"); - - /* Note that you can call any public function of the Python - interpreter here, e.g. call_object(). */ - - /* Some more application specific code */ - printf("\nGoodbye, cruel world\n"); - - /* Exit, cleaning up the interpreter */ - Py_Exit(0); - /*NOTREACHED*/ -} - -/* A static module */ - -/* 'self' is not used */ -static PyObject * -xyzzy_foo(PyObject *self, PyObjecT *args) -{ - if (!PyArg_ParseTuple(args, "")) - return NULL; - return PyInt_FromLong(42L); -} - -static PyMethodDef xyzzy_methods[] = { - {"foo", xyzzy_foo, 1}, - {NULL, NULL} /* sentinel */ -}; - -void -initxyzzy(void) -{ - PyImport_AddModule("xyzzy"); - Py_InitModule("xyzzy", xyzzy_methods); -} diff --git a/Demo/extend/README b/Demo/extend/README deleted file mode 100644 index 26daf14548..0000000000 --- a/Demo/extend/README +++ /dev/null @@ -1,16 +0,0 @@ -This directory contains a test and demonstration of the power of the -generic Makefile.pre.in from the Misc directory. There are three -shell scripts. Study the source of the scripts to find out how they -work (it's really easy). - -./make_static Make a static python binary with the xx module - linked in. To test this, run ./python and try to - import xx. - -./make_shared Make a shared module xx. To test this, run the - standard python interpreter in this directory and try - to import xx. - -./make_clean Clean up after either of the above. Note that each - scripts starts by calling this script, to begin with a - clean slate. diff --git a/Demo/extend/make_clean b/Demo/extend/make_clean deleted file mode 100755 index 13203cd186..0000000000 --- a/Demo/extend/make_clean +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -# Reset the directory contents. - -rm -f Setup* Makefile* *.c *.o *.a *.so *~ python sedscript diff --git a/Demo/extend/make_shared b/Demo/extend/make_shared deleted file mode 100755 index b5fbe24300..0000000000 --- a/Demo/extend/make_shared +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -# This script tests and demonstrates the mechanism for building a -# shared library for an additional extension module using the -# generic Makefile.pre.in from the Misc directory. - -./make_clean - -cp ../../Misc/Makefile.pre.in . -cp ../../Modules/xxmodule.c . -echo '*shared*' >Setup.in -echo xx xxmodule.c >>Setup.in - -make -f Makefile.pre.in boot -make Makefile -make diff --git a/Demo/extend/make_static b/Demo/extend/make_static deleted file mode 100755 index cfa48feafd..0000000000 --- a/Demo/extend/make_static +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh - -# This script tests and demonstrates the mechanism for building a -# static Python binary with an additional extension module using the -# generic Makefile.pre.in from the Misc directory. - -./make_clean - -cp ../../Misc/Makefile.pre.in . -cp ../../Modules/xxmodule.c . -echo xx xxmodule.c >Setup.in - -make -f Makefile.pre.in boot -make Makefile -make static diff --git a/Demo/imputil/importers.py b/Demo/imputil/importers.py deleted file mode 100644 index 864ff02f52..0000000000 --- a/Demo/imputil/importers.py +++ /dev/null @@ -1,248 +0,0 @@ -# -# importers.py -# -# Demonstration subclasses of imputil.Importer -# - -# There should be consideration for the imports below if it is desirable -# to have "all" modules be imported through the imputil system. - -# these are C extensions -import sys -import imp -import struct -import marshal - -# these are .py modules -import imputil -import os - -###################################################################### - -_TupleType = type(()) -_StringType = type('') - -###################################################################### - -# byte-compiled file suffic character -_suffix_char = __debug__ and 'c' or 'o' - -# byte-compiled file suffix -_suffix = '.py' + _suffix_char - -# the C_EXTENSION suffixes -_c_suffixes = filter(lambda x: x[2] == imp.C_EXTENSION, imp.get_suffixes()) - -def _timestamp(pathname): - "Return the file modification time as a Long." - try: - s = os.stat(pathname) - except OSError: - return None - return long(s[8]) - -def _fs_import(dir, modname, fqname): - "Fetch a module from the filesystem." - - pathname = os.path.join(dir, modname) - if os.path.isdir(pathname): - values = { '__pkgdir__' : pathname, '__path__' : [ pathname ] } - ispkg = 1 - pathname = os.path.join(pathname, '__init__') - else: - values = { } - ispkg = 0 - - # look for dynload modules - for desc in _c_suffixes: - file = pathname + desc[0] - try: - fp = open(file, desc[1]) - except IOError: - pass - else: - module = imp.load_module(fqname, fp, file, desc) - values['__file__'] = file - return 0, module, values - - t_py = _timestamp(pathname + '.py') - t_pyc = _timestamp(pathname + _suffix) - if t_py is None and t_pyc is None: - return None - code = None - if t_py is None or (t_pyc is not None and t_pyc >= t_py): - file = pathname + _suffix - f = open(file, 'rb') - if f.read(4) == imp.get_magic(): - t = struct.unpack('., where - can be located using a subclass-specific mechanism and the - is found in the archive using a subclass-specific mechanism. - - This class defines two hooks for subclasses: one to locate an archive - (and possibly return some context for future subfile lookups), and one - to locate subfiles. - """ - - def get_code(self, parent, modname, fqname): - if parent: - # the Importer._finish_import logic ensures that we handle imports - # under the top level module (package / archive). - assert parent.__importer__ == self - - # if a parent "package" is provided, then we are importing a - # sub-file from the archive. - result = self.get_subfile(parent.__archive__, modname) - if result is None: - return None - if isinstance(result, _TupleType): - assert len(result) == 2 - return (0,) + result - return 0, result, {} - - # no parent was provided, so the archive should exist somewhere on the - # default "path". - archive = self.get_archive(modname) - if archive is None: - return None - return 1, "", {'__archive__':archive} - - def get_archive(self, modname): - """Get an archive of modules. - - This method should locate an archive and return a value which can be - used by get_subfile to load modules from it. The value may be a simple - pathname, an open file, or a complex object that caches information - for future imports. - - Return None if the archive was not found. - """ - raise RuntimeError, "get_archive not implemented" - - def get_subfile(self, archive, modname): - """Get code from a subfile in the specified archive. - - Given the specified archive (as returned by get_archive()), locate - and return a code object for the specified module name. - - A 2-tuple may be returned, consisting of a code object and a dict - of name/values to place into the target module. - - Return None if the subfile was not found. - """ - raise RuntimeError, "get_subfile not implemented" - - -class PackageArchive(PackageArchiveImporter): - "PackageArchiveImporter subclass that refers to a specific archive." - - def __init__(self, modname, archive_pathname): - self.__modname = modname - self.__path = archive_pathname - - def get_archive(self, modname): - if modname == self.__modname: - return self.__path - return None - - # get_subfile is passed the full pathname of the archive - - -###################################################################### -# -# Emulate the standard directory-based import mechanism -# -class DirectoryImporter(imputil.Importer): - "Importer subclass to emulate the standard importer." - - def __init__(self, dir): - self.dir = dir - - def get_code(self, parent, modname, fqname): - if parent: - dir = parent.__pkgdir__ - else: - dir = self.dir - - # Return the module (and other info) if found in the specified - # directory. Otherwise, return None. - return _fs_import(dir, modname, fqname) - - def __repr__(self): - return '<%s.%s for "%s" at 0x%x>' % (self.__class__.__module__, - self.__class__.__name__, - self.dir, - id(self)) - - -###################################################################### -# -# Emulate the standard path-style import mechanism -# -class PathImporter(imputil.Importer): - def __init__(self, path=sys.path): - self.path = path - - def get_code(self, parent, modname, fqname): - if parent: - # we are looking for a module inside of a specific package - return _fs_import(parent.__pkgdir__, modname, fqname) - - # scan sys.path, looking for the requested module - for dir in self.path: - if isinstance(dir, _StringType): - result = _fs_import(dir, modname, fqname) - if result: - return result - - # not found - return None - -###################################################################### - -def _test_dir(): - "Debug/test function to create DirectoryImporters from sys.path." - imputil.ImportManager().install() - path = sys.path[:] - path.reverse() - for d in path: - sys.path.insert(0, DirectoryImporter(d)) - sys.path.insert(0, imputil.BuiltinImporter()) - -def _test_revamp(): - "Debug/test function for the revamped import system." - imputil.ImportManager().install() - sys.path.insert(0, PathImporter()) - sys.path.insert(0, imputil.BuiltinImporter()) diff --git a/Demo/md5test/README b/Demo/md5test/README deleted file mode 100644 index be7621e464..0000000000 --- a/Demo/md5test/README +++ /dev/null @@ -1,10 +0,0 @@ -This is the Python version of the MD5 test program from the MD5 -Internet Draft (Rivest and Dusse, The MD5 Message-Digest Algorithm, 10 -July 1991). The file "foo" contains the string "abc" with no trailing -newline. - -When called without arguments, it acts as a filter. When called with -"-x", it executes a self-test, and the output should literally match -the output given in the RFC. - -Code by Jan-Hein B\"uhrman after the original in C. diff --git a/Demo/md5test/foo b/Demo/md5test/foo deleted file mode 100755 index f2ba8f84ab..0000000000 --- a/Demo/md5test/foo +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/Demo/md5test/md5driver.py b/Demo/md5test/md5driver.py deleted file mode 100755 index 326c0cf2a2..0000000000 --- a/Demo/md5test/md5driver.py +++ /dev/null @@ -1,125 +0,0 @@ -import string - -def MDPrint(str): - outstr = '' - for i in str: - o = ord(i) - outstr = outstr \ - + string.hexdigits[(o >> 4) & 0xF] \ - + string.hexdigits[o & 0xF] - print outstr, - - -from time import time - -def makestr(start, end): - result = '' - for i in range(start, end + 1): - result = result + chr(i) - - return result - - -from md5 import md5 - -def MDTimeTrial(): - TEST_BLOCK_SIZE = 1000 - TEST_BLOCKS = 10000 - - TEST_BYTES = TEST_BLOCK_SIZE * TEST_BLOCKS - - # initialize test data, need temporary string filler - - filsiz = 1 << 8 - filler = makestr(0, filsiz-1) - data = filler * (TEST_BLOCK_SIZE / filsiz); - data = data + filler[:(TEST_BLOCK_SIZE % filsiz)] - - del filsiz, filler - - - # start timer - print 'MD5 time trial. Processing', TEST_BYTES, 'characters...' - t1 = time() - - mdContext = md5() - - for i in range(TEST_BLOCKS): - mdContext.update(data) - - str = mdContext.digest() - t2 = time() - - MDPrint(str) - print 'is digest of test input.' - print 'Seconds to process test input:', t2 - t1 - print 'Characters processed per second:', TEST_BYTES / (t2 - t1) - - -def MDString(str): - MDPrint(md5(str).digest()) - print '"' + str + '"' - - -def MDFile(filename): - f = open(filename, 'rb'); - mdContext = md5() - - while 1: - data = f.read(1024) - if not data: - break - mdContext.update(data) - - MDPrint(mdContext.digest()) - print filename - - -import sys - -def MDFilter(): - mdContext = md5() - - while 1: - data = sys.stdin.read(16) - if not data: - break - mdContext.update(data) - - MDPrint(mdContext.digest()) - print - - -def MDTestSuite(): - print 'MD5 test suite results:' - MDString('') - MDString('a') - MDString('abc') - MDString('message digest') - MDString(makestr(ord('a'), ord('z'))) - MDString(makestr(ord('A'), ord('Z')) \ - + makestr(ord('a'), ord('z')) \ - + makestr(ord('0'), ord('9'))) - MDString((makestr(ord('1'), ord('9')) + '0') * 8) - - # Contents of file foo are "abc" - MDFile('foo') - - -from sys import argv - -# I don't wanna use getopt(), since I want to use the same i/f... -def main(): - if len(argv) == 1: - MDFilter() - for arg in argv[1:]: - if arg[:2] == '-s': - MDString(arg[2:]) - elif arg == '-t': - MDTimeTrial() - elif arg == '-x': - MDTestSuite() - else: - MDFile(arg) - -main() diff --git a/Demo/metaclasses/Eiffel.py b/Demo/metaclasses/Eiffel.py deleted file mode 100644 index d9c8a9a0c7..0000000000 --- a/Demo/metaclasses/Eiffel.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Support Eiffel-style preconditions and postconditions. - -For example, - -class C: - def m1(self, arg): - require arg > 0 - return whatever - ensure Result > arg - -can be written (clumsily, I agree) as: - -class C(Eiffel): - def m1(self, arg): - return whatever - def m1_pre(self, arg): - assert arg > 0 - def m1_post(self, Result, arg): - assert Result > arg - -Pre- and post-conditions for a method, being implemented as methods -themselves, are inherited independently from the method. This gives -much of the same effect of Eiffel, where pre- and post-conditions are -inherited when a method is overridden by a derived class. However, -when a derived class in Python needs to extend a pre- or -post-condition, it must manually merge the base class' pre- or -post-condition with that defined in the derived class', for example: - -class D(C): - def m1(self, arg): - return whatever**2 - def m1_post(self, Result, arg): - C.m1_post(self, Result, arg) - assert Result < 100 - -This gives derived classes more freedom but also more responsibility -than in Eiffel, where the compiler automatically takes care of this. - -In Eiffel, pre-conditions combine using contravariance, meaning a -derived class can only make a pre-condition weaker; in Python, this is -up to the derived class. For example, a derived class that takes away -the requirement that arg > 0 could write: - - def m1_pre(self, arg): - pass - -but one could equally write a derived class that makes a stronger -requirement: - - def m1_pre(self, arg): - require arg > 50 - -It would be easy to modify the classes shown here so that pre- and -post-conditions can be disabled (separately, on a per-class basis). - -A different design would have the pre- or post-condition testing -functions return true for success and false for failure. This would -make it possible to implement automatic combination of inherited -and new pre-/post-conditions. All this is left as an exercise to the -reader. - -""" - -from Meta import MetaClass, MetaHelper, MetaMethodWrapper - -class EiffelMethodWrapper(MetaMethodWrapper): - - def __init__(self, func, inst): - MetaMethodWrapper.__init__(self, func, inst) - # Note that the following causes recursive wrappers around - # the pre-/post-condition testing methods. These are harmless - # but inefficient; to avoid them, the lookup must be done - # using the class. - try: - self.pre = getattr(inst, self.__name__ + "_pre") - except AttributeError: - self.pre = None - try: - self.post = getattr(inst, self.__name__ + "_post") - except AttributeError: - self.post = None - - def __call__(self, *args, **kw): - if self.pre: - apply(self.pre, args, kw) - Result = apply(self.func, (self.inst,) + args, kw) - if self.post: - apply(self.post, (Result,) + args, kw) - return Result - -class EiffelHelper(MetaHelper): - __methodwrapper__ = EiffelMethodWrapper - -class EiffelMetaClass(MetaClass): - __helper__ = EiffelHelper - -Eiffel = EiffelMetaClass('Eiffel', (), {}) - - -def _test(): - class C(Eiffel): - def m1(self, arg): - return arg+1 - def m1_pre(self, arg): - assert arg > 0, "precondition for m1 failed" - def m1_post(self, Result, arg): - assert Result > arg - x = C() - x.m1(12) -## x.m1(-1) - -if __name__ == '__main__': - _test() diff --git a/Demo/metaclasses/Enum.py b/Demo/metaclasses/Enum.py deleted file mode 100644 index 13a3ed7d6d..0000000000 --- a/Demo/metaclasses/Enum.py +++ /dev/null @@ -1,169 +0,0 @@ -"""Enumeration metaclass. - -XXX This is very much a work in progress. - -""" - -import string - -class EnumMetaClass: - """Metaclass for enumeration. - - To define your own enumeration, do something like - - class Color(Enum): - red = 1 - green = 2 - blue = 3 - - Now, Color.red, Color.green and Color.blue behave totally - different: they are enumerated values, not integers. - - Enumerations cannot be instantiated; however they can be - subclassed. - - """ - - def __init__(self, name, bases, dict): - """Constructor -- create an enumeration. - - Called at the end of the class statement. The arguments are - the name of the new class, a tuple containing the base - classes, and a dictionary containing everything that was - entered in the class' namespace during execution of the class - statement. In the above example, it would be {'red': 1, - 'green': 2, 'blue': 3}. - - """ - for base in bases: - if base.__class__ is not EnumMetaClass: - raise TypeError, "Enumeration base class must be enumeration" - bases = filter(lambda x: x is not Enum, bases) - self.__name__ = name - self.__bases__ = bases - self.__dict = {} - for key, value in dict.items(): - self.__dict[key] = EnumInstance(name, key, value) - - def __getattr__(self, name): - """Return an enumeration value. - - For example, Color.red returns the value corresponding to red. - - XXX Perhaps the values should be created in the constructor? - - This looks in the class dictionary and if it is not found - there asks the base classes. - - The special attribute __members__ returns the list of names - defined in this class (it does not merge in the names defined - in base classes). - - """ - if name == '__members__': - return self.__dict.keys() - - try: - return self.__dict[name] - except KeyError: - for base in self.__bases__: - try: - return getattr(base, name) - except AttributeError: - continue - - raise AttributeError, name - - def __repr__(self): - s = self.__name__ - if self.__bases__: - s = s + '(' + string.join(map(lambda x: x.__name__, - self.__bases__), ", ") + ')' - if self.__dict: - list = [] - for key, value in self.__dict.items(): - list.append("%s: %s" % (key, int(value))) - s = "%s: {%s}" % (s, string.join(list, ", ")) - return s - - -class EnumInstance: - """Class to represent an enumeration value. - - EnumInstance('Color', 'red', 12) prints as 'Color.red' and behaves - like the integer 12 when compared, but doesn't support arithmetic. - - XXX Should it record the actual enumeration rather than just its - name? - - """ - - def __init__(self, classname, enumname, value): - self.__classname = classname - self.__enumname = enumname - self.__value = value - - def __int__(self): - return self.__value - - def __repr__(self): - return "EnumInstance(%s, %s, %s)" % (`self.__classname`, - `self.__enumname`, - `self.__value`) - - def __str__(self): - return "%s.%s" % (self.__classname, self.__enumname) - - def __cmp__(self, other): - return cmp(self.__value, int(other)) - - -# Create the base class for enumerations. -# It is an empty enumeration. -Enum = EnumMetaClass("Enum", (), {}) - - -def _test(): - - class Color(Enum): - red = 1 - green = 2 - blue = 3 - - print Color.red - print dir(Color) - - print Color.red == Color.red - print Color.red == Color.blue - print Color.red == 1 - print Color.red == 2 - - class ExtendedColor(Color): - white = 0 - orange = 4 - yellow = 5 - purple = 6 - black = 7 - - print ExtendedColor.orange - print ExtendedColor.red - - print Color.red == ExtendedColor.red - - class OtherColor(Enum): - white = 4 - blue = 5 - - class MergedColor(Color, OtherColor): - pass - - print MergedColor.red - print MergedColor.white - - print Color - print ExtendedColor - print OtherColor - print MergedColor - -if __name__ == '__main__': - _test() diff --git a/Demo/metaclasses/Meta.py b/Demo/metaclasses/Meta.py deleted file mode 100644 index 771205cf3d..0000000000 --- a/Demo/metaclasses/Meta.py +++ /dev/null @@ -1,120 +0,0 @@ -"""Generic metaclass. - -XXX This is very much a work in progress. - -""" - -import types - -class MetaMethodWrapper: - - def __init__(self, func, inst): - self.func = func - self.inst = inst - self.__name__ = self.func.__name__ - - def __call__(self, *args, **kw): - return apply(self.func, (self.inst,) + args, kw) - -class MetaHelper: - - __methodwrapper__ = MetaMethodWrapper # For derived helpers to override - - def __helperinit__(self, formalclass): - self.__formalclass__ = formalclass - - def __getattr__(self, name): - # Invoked for any attr not in the instance's __dict__ - try: - raw = self.__formalclass__.__getattr__(name) - except AttributeError: - try: - ga = self.__formalclass__.__getattr__('__usergetattr__') - except KeyError: - raise AttributeError, name - return ga(self, name) - if type(raw) != types.FunctionType: - return raw - return self.__methodwrapper__(raw, self) - -class MetaClass: - - """A generic metaclass. - - This can be subclassed to implement various kinds of meta-behavior. - - """ - - __helper__ = MetaHelper # For derived metaclasses to override - - __inited = 0 - - def __init__(self, name, bases, dict): - try: - ga = dict['__getattr__'] - except KeyError: - pass - else: - dict['__usergetattr__'] = ga - del dict['__getattr__'] - self.__name__ = name - self.__bases__ = bases - self.__realdict__ = dict - self.__inited = 1 - - def __getattr__(self, name): - try: - return self.__realdict__[name] - except KeyError: - for base in self.__bases__: - try: - return base.__getattr__(name) - except AttributeError: - pass - raise AttributeError, name - - def __setattr__(self, name, value): - if not self.__inited: - self.__dict__[name] = value - else: - self.__realdict__[name] = value - - def __call__(self, *args, **kw): - inst = self.__helper__() - inst.__helperinit__(self) - try: - init = inst.__getattr__('__init__') - except AttributeError: - init = lambda: None - apply(init, args, kw) - return inst - - -Meta = MetaClass('Meta', (), {}) - - -def _test(): - class C(Meta): - def __init__(self, *args): - print "__init__, args =", args - def m1(self, x): - print "m1(x=%s)" %`x` - print C - x = C() - print x - x.m1(12) - class D(C): - def __getattr__(self, name): - if name[:2] == '__': raise AttributeError, name - return "getattr:%s" % name - x = D() - print x.foo - print x._foo -## print x.__foo -## print x.__foo__ - - -if __name__ == '__main__': - _test() - - diff --git a/Demo/metaclasses/Simple.py b/Demo/metaclasses/Simple.py deleted file mode 100644 index 03ed2592ee..0000000000 --- a/Demo/metaclasses/Simple.py +++ /dev/null @@ -1,45 +0,0 @@ -import types - -class Tracing: - def __init__(self, name, bases, namespace): - """Create a new class.""" - self.__name__ = name - self.__bases__ = bases - self.__namespace__ = namespace - def __call__(self): - """Create a new instance.""" - return Instance(self) - -class Instance: - def __init__(self, klass): - self.__klass__ = klass - def __getattr__(self, name): - try: - value = self.__klass__.__namespace__[name] - except KeyError: - raise AttributeError, name - if type(value) is not types.FunctionType: - return value - return BoundMethod(value, self) - -class BoundMethod: - def __init__(self, function, instance): - self.function = function - self.instance = instance - def __call__(self, *args): - print "calling", self.function, "for", self.instance, "with", args - return apply(self.function, (self.instance,) + args) - -Trace = Tracing('Trace', (), {}) - -class MyTracedClass(Trace): - def method1(self, a): - self.a = a - def method2(self): - return self.a - -aninstance = MyTracedClass() - -aninstance.method1(10) - -print aninstance.method2() diff --git a/Demo/metaclasses/Synch.py b/Demo/metaclasses/Synch.py deleted file mode 100644 index df70337924..0000000000 --- a/Demo/metaclasses/Synch.py +++ /dev/null @@ -1,256 +0,0 @@ -"""Synchronization metaclass. - -This metaclass makes it possible to declare synchronized methods. - -""" - -import thread - -# First we need to define a reentrant lock. -# This is generally useful and should probably be in a standard Python -# library module. For now, we in-line it. - -class Lock: - - """Reentrant lock. - - This is a mutex-like object which can be acquired by the same - thread more than once. It keeps a reference count of the number - of times it has been acquired by the same thread. Each acquire() - call must be matched by a release() call and only the last - release() call actually releases the lock for acquisition by - another thread. - - The implementation uses two locks internally: - - __mutex is a short term lock used to protect the instance variables - __wait is the lock for which other threads wait - - A thread intending to acquire both locks should acquire __wait - first. - - The implementation uses two other instance variables, protected by - locking __mutex: - - __tid is the thread ID of the thread that currently has the lock - __count is the number of times the current thread has acquired it - - When the lock is released, __tid is None and __count is zero. - - """ - - def __init__(self): - """Constructor. Initialize all instance variables.""" - self.__mutex = thread.allocate_lock() - self.__wait = thread.allocate_lock() - self.__tid = None - self.__count = 0 - - def acquire(self, flag=1): - """Acquire the lock. - - If the optional flag argument is false, returns immediately - when it cannot acquire the __wait lock without blocking (it - may still block for a little while in order to acquire the - __mutex lock). - - The return value is only relevant when the flag argument is - false; it is 1 if the lock is acquired, 0 if not. - - """ - self.__mutex.acquire() - try: - if self.__tid == thread.get_ident(): - self.__count = self.__count + 1 - return 1 - finally: - self.__mutex.release() - locked = self.__wait.acquire(flag) - if not flag and not locked: - return 0 - try: - self.__mutex.acquire() - assert self.__tid == None - assert self.__count == 0 - self.__tid = thread.get_ident() - self.__count = 1 - return 1 - finally: - self.__mutex.release() - - def release(self): - """Release the lock. - - If this thread doesn't currently have the lock, an assertion - error is raised. - - Only allow another thread to acquire the lock when the count - reaches zero after decrementing it. - - """ - self.__mutex.acquire() - try: - assert self.__tid == thread.get_ident() - assert self.__count > 0 - self.__count = self.__count - 1 - if self.__count == 0: - self.__tid = None - self.__wait.release() - finally: - self.__mutex.release() - - -def _testLock(): - - done = [] - - def f2(lock, done=done): - lock.acquire() - print "f2 running in thread %d\n" % thread.get_ident(), - lock.release() - done.append(1) - - def f1(lock, f2=f2, done=done): - lock.acquire() - print "f1 running in thread %d\n" % thread.get_ident(), - try: - f2(lock) - finally: - lock.release() - done.append(1) - - lock = Lock() - lock.acquire() - f1(lock) # Adds 2 to done - lock.release() - - lock.acquire() - - thread.start_new_thread(f1, (lock,)) # Adds 2 - thread.start_new_thread(f1, (lock, f1)) # Adds 3 - thread.start_new_thread(f2, (lock,)) # Adds 1 - thread.start_new_thread(f2, (lock,)) # Adds 1 - - lock.release() - import time - while len(done) < 9: - print len(done) - time.sleep(0.001) - print len(done) - - -# Now, the Locking metaclass is a piece of cake. -# As an example feature, methods whose name begins with exactly one -# underscore are not synchronized. - -from Meta import MetaClass, MetaHelper, MetaMethodWrapper - -class LockingMethodWrapper(MetaMethodWrapper): - def __call__(self, *args, **kw): - if self.__name__[:1] == '_' and self.__name__[1:] != '_': - return apply(self.func, (self.inst,) + args, kw) - self.inst.__lock__.acquire() - try: - return apply(self.func, (self.inst,) + args, kw) - finally: - self.inst.__lock__.release() - -class LockingHelper(MetaHelper): - __methodwrapper__ = LockingMethodWrapper - def __helperinit__(self, formalclass): - MetaHelper.__helperinit__(self, formalclass) - self.__lock__ = Lock() - -class LockingMetaClass(MetaClass): - __helper__ = LockingHelper - -Locking = LockingMetaClass('Locking', (), {}) - -def _test(): - # For kicks, take away the Locking base class and see it die - class Buffer(Locking): - def __init__(self, initialsize): - assert initialsize > 0 - self.size = initialsize - self.buffer = [None]*self.size - self.first = self.last = 0 - def put(self, item): - # Do we need to grow the buffer? - if (self.last+1) % self.size != self.first: - # Insert the new item - self.buffer[self.last] = item - self.last = (self.last+1) % self.size - return - # Double the buffer size - # First normalize it so that first==0 and last==size-1 - print "buffer =", self.buffer - print "first = %d, last = %d, size = %d" % ( - self.first, self.last, self.size) - if self.first <= self.last: - temp = self.buffer[self.first:self.last] - else: - temp = self.buffer[self.first:] + self.buffer[:self.last] - print "temp =", temp - self.buffer = temp + [None]*(self.size+1) - self.first = 0 - self.last = self.size-1 - self.size = self.size*2 - print "Buffer size doubled to", self.size - print "new buffer =", self.buffer - print "first = %d, last = %d, size = %d" % ( - self.first, self.last, self.size) - self.put(item) # Recursive call to test the locking - def get(self): - # Is the buffer empty? - if self.first == self.last: - raise EOFError # Avoid defining a new exception - item = self.buffer[self.first] - self.first = (self.first+1) % self.size - return item - - def producer(buffer, wait, n=1000): - import time - i = 0 - while i < n: - print "put", i - buffer.put(i) - i = i+1 - print "Producer: done producing", n, "items" - wait.release() - - def consumer(buffer, wait, n=1000): - import time - i = 0 - tout = 0.001 - while i < n: - try: - x = buffer.get() - if x != i: - raise AssertionError, \ - "get() returned %s, expected %s" % (x, i) - print "got", i - i = i+1 - tout = 0.001 - except EOFError: - time.sleep(tout) - tout = tout*2 - print "Consumer: done consuming", n, "items" - wait.release() - - pwait = thread.allocate_lock() - pwait.acquire() - cwait = thread.allocate_lock() - cwait.acquire() - buffer = Buffer(1) - n = 1000 - thread.start_new_thread(consumer, (buffer, cwait, n)) - thread.start_new_thread(producer, (buffer, pwait, n)) - pwait.acquire() - print "Producer done" - cwait.acquire() - print "All done" - print "buffer size ==", len(buffer.buffer) - -if __name__ == '__main__': - _testLock() - _test() diff --git a/Demo/metaclasses/Trace.py b/Demo/metaclasses/Trace.py deleted file mode 100644 index 86e199d602..0000000000 --- a/Demo/metaclasses/Trace.py +++ /dev/null @@ -1,145 +0,0 @@ -"""Tracing metaclass. - -XXX This is very much a work in progress. - -""" - -import types, sys - -class TraceMetaClass: - """Metaclass for tracing. - - Classes defined using this metaclass have an automatic tracing - feature -- by setting the __trace_output__ instance (or class) - variable to a file object, trace messages about all calls are - written to the file. The trace formatting can be changed by - defining a suitable __trace_call__ method. - - """ - - __inited = 0 - - def __init__(self, name, bases, dict): - self.__name__ = name - self.__bases__ = bases - self.__dict = dict - # XXX Can't define __dict__, alas - self.__inited = 1 - - def __getattr__(self, name): - try: - return self.__dict[name] - except KeyError: - for base in self.__bases__: - try: - return base.__getattr__(name) - except AttributeError: - pass - raise AttributeError, name - - def __setattr__(self, name, value): - if not self.__inited: - self.__dict__[name] = value - else: - self.__dict[name] = value - - def __call__(self, *args, **kw): - inst = TracingInstance() - inst.__meta_init__(self) - try: - init = inst.__getattr__('__init__') - except AttributeError: - init = lambda: None - apply(init, args, kw) - return inst - - __trace_output__ = None - -class TracingInstance: - """Helper class to represent an instance of a tracing class.""" - - def __trace_call__(self, fp, fmt, *args): - fp.write((fmt+'\n') % args) - - def __meta_init__(self, klass): - self.__class = klass - - def __getattr__(self, name): - # Invoked for any attr not in the instance's __dict__ - try: - raw = self.__class.__getattr__(name) - except AttributeError: - raise AttributeError, name - if type(raw) != types.FunctionType: - return raw - # It's a function - fullname = self.__class.__name__ + "." + name - if not self.__trace_output__ or name == '__trace_call__': - return NotTracingWrapper(fullname, raw, self) - else: - return TracingWrapper(fullname, raw, self) - -class NotTracingWrapper: - def __init__(self, name, func, inst): - self.__name__ = name - self.func = func - self.inst = inst - def __call__(self, *args, **kw): - return apply(self.func, (self.inst,) + args, kw) - -class TracingWrapper(NotTracingWrapper): - def __call__(self, *args, **kw): - self.inst.__trace_call__(self.inst.__trace_output__, - "calling %s, inst=%s, args=%s, kw=%s", - self.__name__, self.inst, args, kw) - try: - rv = apply(self.func, (self.inst,) + args, kw) - except: - t, v, tb = sys.exc_info() - self.inst.__trace_call__(self.inst.__trace_output__, - "returning from %s with exception %s: %s", - self.__name__, t, v) - raise t, v, tb - else: - self.inst.__trace_call__(self.inst.__trace_output__, - "returning from %s with value %s", - self.__name__, rv) - return rv - -Traced = TraceMetaClass('Traced', (), {'__trace_output__': None}) - - -def _test(): - global C, D - class C(Traced): - def __init__(self, x=0): self.x = x - def m1(self, x): self.x = x - def m2(self, y): return self.x + y - __trace_output__ = sys.stdout - class D(C): - def m2(self, y): print "D.m2(%s)" % `y`; return C.m2(self, y) - __trace_output__ = None - x = C(4321) - print x - print x.x - print x.m1(100) - print x.m1(10) - print x.m2(33) - print x.m1(5) - print x.m2(4000) - print x.x - - print C.__init__ - print C.m2 - print D.__init__ - print D.m2 - - y = D() - print y - print y.m1(10) - print y.m2(100) - print y.x - -if __name__ == '__main__': - _test() - diff --git a/Demo/metaclasses/index.html b/Demo/metaclasses/index.html deleted file mode 100644 index af9caa9f58..0000000000 --- a/Demo/metaclasses/index.html +++ /dev/null @@ -1,605 +0,0 @@ - - - -Metaclasses in Python 1.5 - - - - -

Metaclasses in Python 1.5

-

(A.k.a. The Killer Joke :-)

- -
- -(Postscript: reading this essay is probably not the best way to -understand the metaclass hook described here. See a message posted by Vladimir Marangozov -which may give a gentler introduction to the matter. You may also -want to search Deja News for messages with "metaclass" in the subject -posted to comp.lang.python in July and August 1998.) - -
- -

In previous Python releases (and still in 1.5), there is something -called the ``Don Beaudry hook'', after its inventor and champion. -This allows C extensions to provide alternate class behavior, thereby -allowing the Python class syntax to be used to define other class-like -entities. Don Beaudry has used this in his infamous MESS package; Jim -Fulton has used it in his Extension -Classes package. (It has also been referred to as the ``Don -Beaudry hack,'' but that's a misnomer. There's nothing hackish -about it -- in fact, it is rather elegant and deep, even though -there's something dark to it.) - -

(On first reading, you may want to skip directly to the examples in -the section "Writing Metaclasses in Python" below, unless you want -your head to explode.) - -

- -


- -

Documentation of the Don Beaudry hook has purposefully been kept -minimal, since it is a feature of incredible power, and is easily -abused. Basically, it checks whether the type of the base -class is callable, and if so, it is called to create the new -class. - -

Note the two indirection levels. Take a simple example: - -

-class B:
-    pass
-
-class C(B):
-    pass
-
- -Take a look at the second class definition, and try to fathom ``the -type of the base class is callable.'' - -

(Types are not classes, by the way. See questions 4.2, 4.19 and in -particular 6.22 in the Python FAQ -for more on this topic.) - -

- -

    - -
  • The base class is B; this one's easy.

    - -

  • Since B is a class, its type is ``class''; so the type of the -base class is the type ``class''. This is also known as -types.ClassType, assuming the standard module types has -been imported.

    - -

  • Now is the type ``class'' callable? No, because types (in -core Python) are never callable. Classes are callable (calling a -class creates a new instance) but types aren't.

    - -

- -

So our conclusion is that in our example, the type of the base -class (of C) is not callable. So the Don Beaudry hook does not apply, -and the default class creation mechanism is used (which is also used -when there is no base class). In fact, the Don Beaudry hook never -applies when using only core Python, since the type of a core object -is never callable. - -

So what do Don and Jim do in order to use Don's hook? Write an -extension that defines at least two new Python object types. The -first would be the type for ``class-like'' objects usable as a base -class, to trigger Don's hook. This type must be made callable. -That's why we need a second type. Whether an object is callable -depends on its type. So whether a type object is callable depends on -its type, which is a meta-type. (In core Python there -is only one meta-type, the type ``type'' (types.TypeType), which is -the type of all type objects, even itself.) A new meta-type must -be defined that makes the type of the class-like objects callable. -(Normally, a third type would also be needed, the new ``instance'' -type, but this is not an absolute requirement -- the new class type -could return an object of some existing type when invoked to create an -instance.) - -

Still confused? Here's a simple device due to Don himself to -explain metaclasses. Take a simple class definition; assume B is a -special class that triggers Don's hook: - -

-class C(B):
-    a = 1
-    b = 2
-
- -This can be though of as equivalent to: - -
-C = type(B)('C', (B,), {'a': 1, 'b': 2})
-
- -If that's too dense for you, here's the same thing written out using -temporary variables: - -
-creator = type(B)               # The type of the base class
-name = 'C'                      # The name of the new class
-bases = (B,)                    # A tuple containing the base class(es)
-namespace = {'a': 1, 'b': 2}    # The namespace of the class statement
-C = creator(name, bases, namespace)
-
- -This is analogous to what happens without the Don Beaudry hook, except -that in that case the creator function is set to the default class -creator. - -

In either case, the creator is called with three arguments. The -first one, name, is the name of the new class (as given at the -top of the class statement). The bases argument is a tuple of -base classes (a singleton tuple if there's only one base class, like -the example). Finally, namespace is a dictionary containing -the local variables collected during execution of the class statement. - -

Note that the contents of the namespace dictionary is simply -whatever names were defined in the class statement. A little-known -fact is that when Python executes a class statement, it enters a new -local namespace, and all assignments and function definitions take -place in this namespace. Thus, after executing the following class -statement: - -

-class C:
-    a = 1
-    def f(s): pass
-
- -the class namespace's contents would be {'a': 1, 'f': <function f -...>}. - -

But enough already about writing Python metaclasses in C; read the -documentation of MESS or Extension -Classes for more information. - -

- -


- -

Writing Metaclasses in Python

- -

In Python 1.5, the requirement to write a C extension in order to -write metaclasses has been dropped (though you can still do -it, of course). In addition to the check ``is the type of the base -class callable,'' there's a check ``does the base class have a -__class__ attribute.'' If so, it is assumed that the __class__ -attribute refers to a class. - -

Let's repeat our simple example from above: - -

-class C(B):
-    a = 1
-    b = 2
-
- -Assuming B has a __class__ attribute, this translates into: - -
-C = B.__class__('C', (B,), {'a': 1, 'b': 2})
-
- -This is exactly the same as before except that instead of type(B), -B.__class__ is invoked. If you have read FAQ question 6.22 you will understand that while there is a big -technical difference between type(B) and B.__class__, they play the -same role at different abstraction levels. And perhaps at some point -in the future they will really be the same thing (at which point you -would be able to derive subclasses from built-in types). - -

At this point it may be worth mentioning that C.__class__ is the -same object as B.__class__, i.e., C's metaclass is the same as B's -metaclass. In other words, subclassing an existing class creates a -new (meta)inststance of the base class's metaclass. - -

Going back to the example, the class B.__class__ is instantiated, -passing its constructor the same three arguments that are passed to -the default class constructor or to an extension's metaclass: -name, bases, and namespace. - -

It is easy to be confused by what exactly happens when using a -metaclass, because we lose the absolute distinction between classes -and instances: a class is an instance of a metaclass (a -``metainstance''), but technically (i.e. in the eyes of the python -runtime system), the metaclass is just a class, and the metainstance -is just an instance. At the end of the class statement, the metaclass -whose metainstance is used as a base class is instantiated, yielding a -second metainstance (of the same metaclass). This metainstance is -then used as a (normal, non-meta) class; instantiation of the class -means calling the metainstance, and this will return a real instance. -And what class is that an instance of? Conceptually, it is of course -an instance of our metainstance; but in most cases the Python runtime -system will see it as an instance of a a helper class used by the -metaclass to implement its (non-meta) instances... - -

Hopefully an example will make things clearer. Let's presume we -have a metaclass MetaClass1. It's helper class (for non-meta -instances) is callled HelperClass1. We now (manually) instantiate -MetaClass1 once to get an empty special base class: - -

-BaseClass1 = MetaClass1("BaseClass1", (), {})
-
- -We can now use BaseClass1 as a base class in a class statement: - -
-class MySpecialClass(BaseClass1):
-    i = 1
-    def f(s): pass
-
- -At this point, MySpecialClass is defined; it is a metainstance of -MetaClass1 just like BaseClass1, and in fact the expression -``BaseClass1.__class__ == MySpecialClass.__class__ == MetaClass1'' -yields true. - -

We are now ready to create instances of MySpecialClass. Let's -assume that no constructor arguments are required: - -

-x = MySpecialClass()
-y = MySpecialClass()
-print x.__class__, y.__class__
-
- -The print statement shows that x and y are instances of HelperClass1. -How did this happen? MySpecialClass is an instance of MetaClass1 -(``meta'' is irrelevant here); when an instance is called, its -__call__ method is invoked, and presumably the __call__ method defined -by MetaClass1 returns an instance of HelperClass1. - -

Now let's see how we could use metaclasses -- what can we do -with metaclasses that we can't easily do without them? Here's one -idea: a metaclass could automatically insert trace calls for all -method calls. Let's first develop a simplified example, without -support for inheritance or other ``advanced'' Python features (we'll -add those later). - -

-import types
-
-class Tracing:
-    def __init__(self, name, bases, namespace):
-        """Create a new class."""
-        self.__name__ = name
-        self.__bases__ = bases
-        self.__namespace__ = namespace
-    def __call__(self):
-        """Create a new instance."""
-        return Instance(self)
-
-class Instance:
-    def __init__(self, klass):
-        self.__klass__ = klass
-    def __getattr__(self, name):
-        try:
-            value = self.__klass__.__namespace__[name]
-        except KeyError:
-            raise AttributeError, name
-        if type(value) is not types.FunctionType:
-            return value
-        return BoundMethod(value, self)
-
-class BoundMethod:
-    def __init__(self, function, instance):
-        self.function = function
-        self.instance = instance
-    def __call__(self, *args):
-        print "calling", self.function, "for", self.instance, "with", args
-        return apply(self.function, (self.instance,) + args)
-
-Trace = Tracing('Trace', (), {})
-
-class MyTracedClass(Trace):
-    def method1(self, a):
-        self.a = a
-    def method2(self):
-        return self.a
-
-aninstance = MyTracedClass()
-
-aninstance.method1(10)
-
-print "the answer is %d" % aninstance.method2()
-
- -Confused already? The intention is to read this from top down. The -Tracing class is the metaclass we're defining. Its structure is -really simple. - -

- -

    - -
  • The __init__ method is invoked when a new Tracing instance is -created, e.g. the definition of class MyTracedClass later in the -example. It simply saves the class name, base classes and namespace -as instance variables.

    - -

  • The __call__ method is invoked when a Tracing instance is called, -e.g. the creation of aninstance later in the example. It returns an -instance of the class Instance, which is defined next.

    - -

- -

The class Instance is the class used for all instances of classes -built using the Tracing metaclass, e.g. aninstance. It has two -methods: - -

- -

    - -
  • The __init__ method is invoked from the Tracing.__call__ method -above to initialize a new instance. It saves the class reference as -an instance variable. It uses a funny name because the user's -instance variables (e.g. self.a later in the example) live in the same -namespace.

    - -

  • The __getattr__ method is invoked whenever the user code -references an attribute of the instance that is not an instance -variable (nor a class variable; but except for __init__ and -__getattr__ there are no class variables). It will be called, for -example, when aninstance.method1 is referenced in the example, with -self set to aninstance and name set to the string "method1".

    - -

- -

The __getattr__ method looks the name up in the __namespace__ -dictionary. If it isn't found, it raises an AttributeError exception. -(In a more realistic example, it would first have to look through the -base classes as well.) If it is found, there are two possibilities: -it's either a function or it isn't. If it's not a function, it is -assumed to be a class variable, and its value is returned. If it's a -function, we have to ``wrap'' it in instance of yet another helper -class, BoundMethod. - -

The BoundMethod class is needed to implement a familiar feature: -when a method is defined, it has an initial argument, self, which is -automatically bound to the relevant instance when it is called. For -example, aninstance.method1(10) is equivalent to method1(aninstance, -10). In the example if this call, first a temporary BoundMethod -instance is created with the following constructor call: temp = -BoundMethod(method1, aninstance); then this instance is called as -temp(10). After the call, the temporary instance is discarded. - -

- -

    - -
  • The __init__ method is invoked for the constructor call -BoundMethod(method1, aninstance). It simply saves away its -arguments.

    - -

  • The __call__ method is invoked when the bound method instance is -called, as in temp(10). It needs to call method1(aninstance, 10). -However, even though self.function is now method1 and self.instance is -aninstance, it can't call self.function(self.instance, args) directly, -because it should work regardless of the number of arguments passed. -(For simplicity, support for keyword arguments has been omitted.)

    - -

- -

In order to be able to support arbitrary argument lists, the -__call__ method first constructs a new argument tuple. Conveniently, -because of the notation *args in __call__'s own argument list, the -arguments to __call__ (except for self) are placed in the tuple args. -To construct the desired argument list, we concatenate a singleton -tuple containing the instance with the args tuple: (self.instance,) + -args. (Note the trailing comma used to construct the singleton -tuple.) In our example, the resulting argument tuple is (aninstance, -10). - -

The intrinsic function apply() takes a function and an argument -tuple and calls the function for it. In our example, we are calling -apply(method1, (aninstance, 10)) which is equivalent to calling -method(aninstance, 10). - -

From here on, things should come together quite easily. The output -of the example code is something like this: - -

-calling <function method1 at ae8d8> for <Instance instance at 95ab0> with (10,)
-calling <function method2 at ae900> for <Instance instance at 95ab0> with ()
-the answer is 10
-
- -

That was about the shortest meaningful example that I could come up -with. A real tracing metaclass (for example, Trace.py discussed below) needs to be more -complicated in two dimensions. - -

First, it needs to support more advanced Python features such as -class variables, inheritance, __init__ methods, and keyword arguments. - -

Second, it needs to provide a more flexible way to handle the -actual tracing information; perhaps it should be possible to write -your own tracing function that gets called, perhaps it should be -possible to enable and disable tracing on a per-class or per-instance -basis, and perhaps a filter so that only interesting calls are traced; -it should also be able to trace the return value of the call (or the -exception it raised if an error occurs). Even the Trace.py example -doesn't support all these features yet. - -

- -


- -

Real-life Examples

- -

Have a look at some very preliminary examples that I coded up to -teach myself how to write metaclasses: - -

- -
Enum.py - -
This (ab)uses the class syntax as an elegant way to define -enumerated types. The resulting classes are never instantiated -- -rather, their class attributes are the enumerated values. For -example: - -
-class Color(Enum):
-    red = 1
-    green = 2
-    blue = 3
-print Color.red
-
- -will print the string ``Color.red'', while ``Color.red==1'' is true, -and ``Color.red + 1'' raise a TypeError exception. - -

- -

Trace.py - -
The resulting classes work much like standard -classes, but by setting a special class or instance attribute -__trace_output__ to point to a file, all calls to the class's methods -are traced. It was a bit of a struggle to get this right. This -should probably redone using the generic metaclass below. - -

- -

Meta.py - -
A generic metaclass. This is an attempt at finding out how much -standard class behavior can be mimicked by a metaclass. The -preliminary answer appears to be that everything's fine as long as the -class (or its clients) don't look at the instance's __class__ -attribute, nor at the class's __dict__ attribute. The use of -__getattr__ internally makes the classic implementation of __getattr__ -hooks tough; we provide a similar hook _getattr_ instead. -(__setattr__ and __delattr__ are not affected.) -(XXX Hm. Could detect presence of __getattr__ and rename it.) - -

- -

Eiffel.py - -
Uses the above generic metaclass to implement Eiffel style -pre-conditions and post-conditions. - -

- -

Synch.py - -
Uses the above generic metaclass to implement synchronized -methods. - -

- -

Simple.py - -
The example module used above. - -

- -

- -

A pattern seems to be emerging: almost all these uses of -metaclasses (except for Enum, which is probably more cute than useful) -mostly work by placing wrappers around method calls. An obvious -problem with that is that it's not easy to combine the features of -different metaclasses, while this would actually be quite useful: for -example, I wouldn't mind getting a trace from the test run of the -Synch module, and it would be interesting to add preconditions to it -as well. This needs more research. Perhaps a metaclass could be -provided that allows stackable wrappers... - -

- -


- -

Things You Could Do With Metaclasses

- -

There are lots of things you could do with metaclasses. Most of -these can also be done with creative use of __getattr__, but -metaclasses make it easier to modify the attribute lookup behavior of -classes. Here's a partial list. - -

- -

    - -
  • Enforce different inheritance semantics, e.g. automatically call -base class methods when a derived class overrides

    - -

  • Implement class methods (e.g. if the first argument is not named -'self')

    - -

  • Implement that each instance is initialized with copies of -all class variables

    - -

  • Implement a different way to store instance variables (e.g. in a -list kept outside the the instance but indexed by the instance's id())

    - -

  • Automatically wrap or trap all or certain methods - -
      - -
    • for tracing - -
    • for precondition and postcondition checking - -
    • for synchronized methods - -
    • for automatic value caching - -
    -

    - -

  • When an attribute is a parameterless function, call it on -reference (to mimic it being an instance variable); same on assignment

    - -

  • Instrumentation: see how many times various attributes are used

    - -

  • Different semantics for __setattr__ and __getattr__ (e.g. disable -them when they are being used recursively)

    - -

  • Abuse class syntax for other things

    - -

  • Experiment with automatic type checking

    - -

  • Delegation (or acquisition)

    - -

  • Dynamic inheritance patterns

    - -

  • Automatic caching of methods

    - -

- -

- -


- -

Credits

- -

Many thanks to David Ascher and Donald Beaudry for their comments -on earlier draft of this paper. Also thanks to Matt Conway and Tommy -Burnette for putting a seed for the idea of metaclasses in my -mind, nearly three years ago, even though at the time my response was -``you can do that with __getattr__ hooks...'' :-) - -

- -


- - - - diff --git a/Demo/metaclasses/meta-vladimir.txt b/Demo/metaclasses/meta-vladimir.txt deleted file mode 100644 index 36406bb465..0000000000 --- a/Demo/metaclasses/meta-vladimir.txt +++ /dev/null @@ -1,256 +0,0 @@ -Subject: Re: The metaclass saga using Python -From: Vladimir Marangozov -To: tim_one@email.msn.com (Tim Peters) -Cc: python-list@cwi.nl -Date: Wed, 5 Aug 1998 15:59:06 +0200 (DFT) - -[Tim] -> -> building-on-examples-tends-to-prevent-abstract-thrashing-ly y'rs - tim -> - -OK, I stand corrected. I understand that anybody's interpretation of -the meta-class concept is likely to be difficult to digest by others. - -Here's another try, expressing the same thing, but using the Python -programming model, examples and, perhaps, more popular terms. - -1. Classes. - - This is pure Python of today. Sorry about the tutorial, but it is - meant to illustrate the second part, which is the one we're - interested in and which will follow the same development scenario. - Besides, newbies are likely to understand that the discussion is - affordable even for them :-) - - a) Class definition - - A class is meant to define the common properties of a set of objects. - A class is a "package" of properties. The assembly of properties - in a class package is sometimes called a class structure (which isn't - always appropriate). - - >>> class A: - attr1 = "Hello" # an attribute of A - def method1(self, *args): pass # method1 of A - def method2(self, *args): pass # method2 of A - >>> - - So far, we defined the structure of the class A. The class A is - of type . We can check this by asking Python: "what is A?" - - >>> A # What is A? - - - b) Class instantiation - - Creating an object with the properties defined in the class A is - called instantiation of the class A. After an instantiation of A, we - obtain a new object, called an instance, which has the properties - packaged in the class A. - - >>> a = A() # 'a' is the 1st instance of A - >>> a # What is 'a'? - <__main__.A instance at 2022b9d0> - - >>> b = A() # 'b' is another instance of A - >>> b # What is 'b'? - <__main__.A instance at 2022b9c0> - - The objects, 'a' and 'b', are of type and they both have - the same properties. Note, that 'a' and 'b' are different objects. - (their adresses differ). This is a bit hard to see, so let's ask Python: - - >>> a == b # Is 'a' the same object as 'b'? - 0 # No. - - Instance objects have one more special property, indicating the class - they are an instance of. This property is named __class__. - - >>> a.__class__ # What is the class of 'a'? - # 'a' is an instance of A - >>> b.__class__ # What is the class of 'b'? - # 'b' is an instance of A - >>> a.__class__ == b.__class__ # Is it really the same class A? - 1 # Yes. - - c) Class inheritance (class composition and specialization) - - Classes can be defined in terms of other existing classes (and only - classes! -- don't bug me on this now). Thus, we can compose property - packages and create new ones. We reuse the property set defined - in a class by defining a new class, which "inherits" from the former. - In other words, a class B which inherits from the class A, inherits - the properties defined in A, or, B inherits the structure of A. - - In the same time, at the definition of the new class B, we can enrich - the inherited set of properties by adding new ones and/or modify some - of the inherited properties. - - >>> class B(A): # B inherits A's properties - attr2 = "World" # additional attr2 - def method2(self, arg1): pass # method2 is redefined - def method3(self, *args): pass # additional method3 - - >>> B # What is B? - - >>> B == A # Is B the same class as A? - 0 # No. - - Classes define one special property, indicating whether a class - inherits the properties of another class. This property is called - __bases__ and it contains a list (a tuple) of the classes the new - class inherits from. The classes from which a class is inheriting the - properties are called superclasses (in Python, we call them also -- - base classes). - - >>> A.__bases__ # Does A have any superclasses? - () # No. - >>> B.__bases__ # Does B have any superclasses? - (,) # Yes. It has one superclass. - >>> B.__bases__[0] == A # Is it really the class A? - 1 # Yes, it is. - --------- - - Congratulations on getting this far! This was the hard part. - Now, let's continue with the easy one. - --------- - -2. Meta-classes - - You have to admit, that an anonymous group of Python wizards are - not satisfied with the property packaging facilities presented above. - They say, that the Real-World bugs them with problems that cannot be - modelled successfully with classes. Or, that the way classes are - implemented in Python and the way classes and instances behave at - runtime isn't always appropriate for reproducing the Real-World's - behavior in a way that satisfies them. - - Hence, what they want is the following: - - a) leave objects as they are (instances of classes) - b) leave classes as they are (property packages and object creators) - - BUT, at the same time: - - c) consider classes as being instances of mysterious objects. - d) label mysterious objects "meta-classes". - - Easy, eh? - - You may ask: "Why on earth do they want to do that?". - They answer: "Poor soul... Go and see how cruel the Real-World is!". - You - fuzzy: "OK, will do!" - - And here we go for another round of what I said in section 1 -- Classes. - - However, be warned! The features we're going to talk about aren't fully - implemented yet, because the Real-World don't let wizards to evaluate - precisely how cruel it is, so the features are still highly-experimental. - - a) Meta-class definition - - A meta-class is meant to define the common properties of a set of - classes. A meta-class is a "package" of properties. The assembly - of properties in a meta-class package is sometimes called a meta-class - structure (which isn't always appropriate). - - In Python, a meta-class definition would have looked like this: - - >>> metaclass M: - attr1 = "Hello" # an attribute of M - def method1(self, *args): pass # method1 of M - def method2(self, *args): pass # method2 of M - >>> - - So far, we defined the structure of the meta-class M. The meta-class - M is of type . We cannot check this by asking Python, but - if we could, it would have answered: - - >>> M # What is M? - - - b) Meta-class instantiation - - Creating an object with the properties defined in the meta-class M is - called instantiation of the meta-class M. After an instantiation of M, - we obtain a new object, called an class, but now it is called also - a meta-instance, which has the properties packaged in the meta-class M. - - In Python, instantiating a meta-class would have looked like this: - - >>> A = M() # 'A' is the 1st instance of M - >>> A # What is 'A'? - - - >>> B = M() # 'B' is another instance of M - >>> B # What is 'B'? - - - The metaclass-instances, A and B, are of type and they both - have the same properties. Note, that A and B are different objects. - (their adresses differ). This is a bit hard to see, but if it was - possible to ask Python, it would have answered: - - >>> A == B # Is A the same class as B? - 0 # No. - - Class objects have one more special property, indicating the meta-class - they are an instance of. This property is named __metaclass__. - - >>> A.__metaclass__ # What is the meta-class of A? - # A is an instance of M - >>> A.__metaclass__ # What is the meta-class of B? - # B is an instance of M - >>> A.__metaclass__ == B.__metaclass__ # Is it the same meta-class M? - 1 # Yes. - - c) Meta-class inheritance (meta-class composition and specialization) - - Meta-classes can be defined in terms of other existing meta-classes - (and only meta-classes!). Thus, we can compose property packages and - create new ones. We reuse the property set defined in a meta-class by - defining a new meta-class, which "inherits" from the former. - In other words, a meta-class N which inherits from the meta-class M, - inherits the properties defined in M, or, N inherits the structure of M. - - In the same time, at the definition of the new meta-class N, we can - enrich the inherited set of properties by adding new ones and/or modify - some of the inherited properties. - - >>> metaclass N(M): # N inherits M's properties - attr2 = "World" # additional attr2 - def method2(self, arg1): pass # method2 is redefined - def method3(self, *args): pass # additional method3 - - >>> N # What is N? - - >>> N == M # Is N the same meta-class as M? - 0 # No. - - Meta-classes define one special property, indicating whether a - meta-class inherits the properties of another meta-class. This property - is called __metabases__ and it contains a list (a tuple) of the - meta-classes the new meta-class inherits from. The meta-classes from - which a meta-class is inheriting the properties are called - super-meta-classes (in Python, we call them also -- super meta-bases). - - >>> M.__metabases__ # Does M have any supermetaclasses? - () # No. - >>> N.__metabases__ # Does N have any supermetaclasses? - (,) # Yes. It has a supermetaclass. - >>> N.__metabases__[0] == M # Is it really the meta-class M? - 1 # Yes, it is. - --------- - - Triple congratulations on getting this far! - Now you know everything about meta-classes and the Real-World! - - - --- - Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr -http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252 diff --git a/Demo/parser/FILES b/Demo/parser/FILES deleted file mode 100644 index 1ff59a31a2..0000000000 --- a/Demo/parser/FILES +++ /dev/null @@ -1,6 +0,0 @@ -Demo/parser -Doc/libparser.tex -Lib/AST.py -Lib/symbol.py -Lib/token.py -Modules/parsermodule.c diff --git a/Demo/parser/Makefile b/Demo/parser/Makefile deleted file mode 100644 index 0d02215c3c..0000000000 --- a/Demo/parser/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -parser.dvi: parser.tex ../../Doc/libparser.tex - TEXINPUTS=../../Doc:: $(LATEX) parser - -parser.ps: parser.dvi - $(DVIPS) parser >parser.ps - -parser.texi: @lib.texi - $(EMACS) -batch -l ../../Doc/fix.el -f save-buffer -kill - mv @lib.texi parser.texi - -@lib.texi:../../Doc/libparser.tex \ - texipre.dat ../../Doc/texipost.dat \ - ../../Doc/partparse.py ../../Doc/fix.el - $(PYTHON) ../../Doc/partparse.py -o @lib.texi \ - -t ../../Doc/texipost.dat \ - ../../Doc/libparser.tex - -parserwww: parser.texi - if test -d html ; then true; else mkdir html ; fi - $(PYTHON) ../../Doc/texi2html.py -d parser.texi html - -# Use a new name for this; the included file uses 'clean' already.... -clean-parser: - rm -f *.log *.aux *.dvi *.pyc *.ps - -dist: - (cd ../..; \ - tar cf - `cat Demo/parser/FILES` | gzip >parsermodule-1.4.tar.gz) - -include ../../Doc/Makefile diff --git a/Demo/parser/README b/Demo/parser/README deleted file mode 100644 index ec45ca9819..0000000000 --- a/Demo/parser/README +++ /dev/null @@ -1,30 +0,0 @@ -These files are from the large example of using the `parser' module. Refer -to the Python Library Reference for more information. - -Files: ------- - - FILES -- list of files associated with the parser module. - - README -- this file. - - example.py -- module that uses the `parser' module to extract - information from the parse tree of Python source - code. - - docstring.py -- sample source file containing only a module docstring. - - simple.py -- sample source containing a "short form" definition. - - source.py -- sample source code used to demonstrate ability to - handle nested constructs easily using the functions - and classes in example.py. - - test_parser.py program to put the parser module through it's paces. - - parser.tex -- LaTex driver file for formatting the parser module - documentation separately from the library reference. - - Makefile -- `make' rule set to format the parser module manual. - -Enjoy! diff --git a/Demo/parser/docstring.py b/Demo/parser/docstring.py deleted file mode 100644 index 45a261b61c..0000000000 --- a/Demo/parser/docstring.py +++ /dev/null @@ -1,2 +0,0 @@ -"""Some documentation. -""" diff --git a/Demo/parser/example.py b/Demo/parser/example.py deleted file mode 100644 index 2aa9ec2857..0000000000 --- a/Demo/parser/example.py +++ /dev/null @@ -1,190 +0,0 @@ -"""Simple code to extract class & function docstrings from a module. - -This code is used as an example in the library reference manual in the -section on using the parser module. Refer to the manual for a thorough -discussion of the operation of this code. -""" - -import os -import parser -import symbol -import token -import types - -from types import ListType, TupleType - - -def get_docs(fileName): - """Retrieve information from the parse tree of a source file. - - fileName - Name of the file to read Python source code from. - """ - source = open(fileName).read() - basename = os.path.basename(os.path.splitext(fileName)[0]) - ast = parser.suite(source) - return ModuleInfo(ast.totuple(), basename) - - -class SuiteInfoBase: - _docstring = '' - _name = '' - - def __init__(self, tree = None): - self._class_info = {} - self._function_info = {} - if tree: - self._extract_info(tree) - - def _extract_info(self, tree): - # extract docstring - if len(tree) == 2: - found, vars = match(DOCSTRING_STMT_PATTERN[1], tree[1]) - else: - found, vars = match(DOCSTRING_STMT_PATTERN, tree[3]) - if found: - self._docstring = eval(vars['docstring']) - # discover inner definitions - for node in tree[1:]: - found, vars = match(COMPOUND_STMT_PATTERN, node) - if found: - cstmt = vars['compound'] - if cstmt[0] == symbol.funcdef: - name = cstmt[2][1] - self._function_info[name] = FunctionInfo(cstmt) - elif cstmt[0] == symbol.classdef: - name = cstmt[2][1] - self._class_info[name] = ClassInfo(cstmt) - - def get_docstring(self): - return self._docstring - - def get_name(self): - return self._name - - def get_class_names(self): - return self._class_info.keys() - - def get_class_info(self, name): - return self._class_info[name] - - def __getitem__(self, name): - try: - return self._class_info[name] - except KeyError: - return self._function_info[name] - - -class SuiteFuncInfo: - # Mixin class providing access to function names and info. - - def get_function_names(self): - return self._function_info.keys() - - def get_function_info(self, name): - return self._function_info[name] - - -class FunctionInfo(SuiteInfoBase, SuiteFuncInfo): - def __init__(self, tree = None): - self._name = tree[2][1] - SuiteInfoBase.__init__(self, tree and tree[-1] or None) - - -class ClassInfo(SuiteInfoBase): - def __init__(self, tree = None): - self._name = tree[2][1] - SuiteInfoBase.__init__(self, tree and tree[-1] or None) - - def get_method_names(self): - return self._function_info.keys() - - def get_method_info(self, name): - return self._function_info[name] - - -class ModuleInfo(SuiteInfoBase, SuiteFuncInfo): - def __init__(self, tree = None, name = ""): - self._name = name - SuiteInfoBase.__init__(self, tree) - if tree: - found, vars = match(DOCSTRING_STMT_PATTERN, tree[1]) - if found: - self._docstring = vars["docstring"] - - -def match(pattern, data, vars=None): - """Match `data' to `pattern', with variable extraction. - - pattern - Pattern to match against, possibly containing variables. - - data - Data to be checked and against which variables are extracted. - - vars - Dictionary of variables which have already been found. If not - provided, an empty dictionary is created. - - The `pattern' value may contain variables of the form ['varname'] which - are allowed to match anything. The value that is matched is returned as - part of a dictionary which maps 'varname' to the matched value. 'varname' - is not required to be a string object, but using strings makes patterns - and the code which uses them more readable. - - This function returns two values: a boolean indicating whether a match - was found and a dictionary mapping variable names to their associated - values. - """ - if vars is None: - vars = {} - if type(pattern) is ListType: # 'variables' are ['varname'] - vars[pattern[0]] = data - return 1, vars - if type(pattern) is not TupleType: - return (pattern == data), vars - if len(data) != len(pattern): - return 0, vars - for pattern, data in map(None, pattern, data): - same, vars = match(pattern, data, vars) - if not same: - break - return same, vars - - -# This pattern identifies compound statements, allowing them to be readily -# differentiated from simple statements. -# -COMPOUND_STMT_PATTERN = ( - symbol.stmt, - (symbol.compound_stmt, ['compound']) - ) - - -# This pattern will match a 'stmt' node which *might* represent a docstring; -# docstrings require that the statement which provides the docstring be the -# first statement in the class or function, which this pattern does not check. -# -DOCSTRING_STMT_PATTERN = ( - symbol.stmt, - (symbol.simple_stmt, - (symbol.small_stmt, - (symbol.expr_stmt, - (symbol.testlist, - (symbol.test, - (symbol.and_test, - (symbol.not_test, - (symbol.comparison, - (symbol.expr, - (symbol.xor_expr, - (symbol.and_expr, - (symbol.shift_expr, - (symbol.arith_expr, - (symbol.term, - (symbol.factor, - (symbol.power, - (symbol.atom, - (token.STRING, ['docstring']) - )))))))))))))))), - (token.NEWLINE, '') - )) diff --git a/Demo/parser/parser.tex b/Demo/parser/parser.tex deleted file mode 100644 index 1a6b296b1a..0000000000 --- a/Demo/parser/parser.tex +++ /dev/null @@ -1,78 +0,0 @@ -\documentstyle[twoside,10pt,myformat]{report} - -%% This manual does not supplement the chapter from the Python -%% Library Reference, but only allows formatting of the parser module -%% component of that document as a separate document, and was created -%% primarily to ease review of the formatted document during authoring. - -\title{Python Parser Module Reference} -\author{ - Fred L. Drake, Jr. \\ - Corporation for National Research Initiatives (CNRI) \\ - 1895 Preston White Drive, Reston, Va 20191-5343, USA \\ - E-mail: {\tt fdrake@cnri.reston.va.us}, {\tt fdrake@intr.net} -} - -\date{September 3rd, 1996 \\ Release 1.4} - -\begin{document} - -\pagenumbering{roman} - -\maketitle - -Copyright \copyright{} 1995-1996 by Fred L. Drake, Jr., Reston, -Virginia, USA, and Virginia Polytechnic Institute and State -University, Blacksburg, Virginia, USA. Portions of the software -copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The -Netherlands. Copying is permitted under the terms associated with the -main Python distribution, with the additional restriction that this -additional notice be included and maintained on all distributed -copies. - -\begin{center} -All Rights Reserved -\end{center} - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Fred L. Drake, Jr. and -Virginia Polytechnic Institute and State University not be used in -advertising or publicity pertaining to distribution of the software -without specific, written prior permission. - -FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE -UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND -STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -\begin{abstract} - -\noindent -The \emph{Python Parser Module Reference} describes the interfaces -published by the optional \code{parser} module and gives examples of -how they may be used. It contains the same text as the chapter on the -\code{parser} module in the \emph{Python Library Reference}, but is -presented as a separate document. - -This manual assumes basic knowledge about the Python language. For an -informal introduction to Python, see the \emph{Python Tutorial}; the -\emph{Python Reference Manual} remains the highest authority on -syntactic and semantic questions. - -\end{abstract} - -\pagebreak -\pagenumbering{arabic} - -\chapter{Parser Module Reference} -\input{libparser} - -\end{document} diff --git a/Demo/parser/simple.py b/Demo/parser/simple.py deleted file mode 100644 index 184e2fe5d0..0000000000 --- a/Demo/parser/simple.py +++ /dev/null @@ -1 +0,0 @@ -def f(): "maybe a docstring" diff --git a/Demo/parser/source.py b/Demo/parser/source.py deleted file mode 100644 index b90062851f..0000000000 --- a/Demo/parser/source.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Exmaple file to be parsed for the parsermodule example. - -The classes and functions in this module exist only to exhibit the ability -of the handling information extraction from nested definitions using parse -trees. They shouldn't interest you otherwise! -""" - -class Simple: - "This class does very little." - - def method(self): - "This method does almost nothing." - return 1 - - class Nested: - "This is a nested class." - - def nested_method(self): - "Method of Nested class." - def nested_function(): - "Function in method of Nested class." - pass - return nested_function - -def function(): - "This function lives at the module level." - return 0 diff --git a/Demo/parser/test_parser.py b/Demo/parser/test_parser.py deleted file mode 100755 index 3f02a9643d..0000000000 --- a/Demo/parser/test_parser.py +++ /dev/null @@ -1,50 +0,0 @@ -#! /usr/bin/env python -# (Force the script to use the latest build.) -# -# test_parser.py - -import parser, traceback - -_numFailed = 0 - -def testChunk(t, fileName): - global _numFailed - print '----', fileName, - try: - ast = parser.suite(t) - tup = parser.ast2tuple(ast) - # this discards the first AST; a huge memory savings when running - # against a large source file like Tkinter.py. - ast = None - new = parser.tuple2ast(tup) - except parser.ParserError, err: - print - print 'parser module raised exception on input file', fileName + ':' - traceback.print_exc() - _numFailed = _numFailed + 1 - else: - if tup != parser.ast2tuple(new): - print - print 'parser module failed on input file', fileName - _numFailed = _numFailed + 1 - else: - print 'o.k.' - -def testFile(fileName): - t = open(fileName).read() - testChunk(t, fileName) - -def test(): - import sys - args = sys.argv[1:] - if not args: - import glob - args = glob.glob("*.py") - map(testFile, args) - sys.exit(_numFailed != 0) - -if __name__ == '__main__': - test() - -# -# end of file diff --git a/Demo/parser/texipre.dat b/Demo/parser/texipre.dat deleted file mode 100644 index 8ad03a6175..0000000000 --- a/Demo/parser/texipre.dat +++ /dev/null @@ -1,100 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename parser.info -@settitle Python Parser Module Reference -@setchapternewpage odd -@footnotestyle end -@c %**end of header - -@ifinfo -This file describes the interfaces -published by the optional @code{parser} module and gives examples of -how they may be used. It contains the same text as the chapter on the -@code{parser} module in the @cite{Python Library Reference}, but is -presented as a separate document. - -Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and -Virginia Polytechnic Institute and State University, Blacksburg, -Virginia, USA. Portions of the software copyright 1991-1995 by -Stichting Mathematisch Centrum, Amsterdam, The Netherlands. Copying is -permitted under the terms associated with the main Python distribution, -with the additional restriction that this additional notice be included -and maintained on all distributed copies. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Fred L. Drake, Jr. and -Virginia Polytechnic Institute and State University not be used in -advertising or publicity pertaining to distribution of the software -without specific, written prior permission. - -FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE -UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND -STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -@end ifinfo - -@titlepage -@title Python Parser Module Reference -@author Fred L. Drake, Jr. - -@c The following two commands start the copyright page. -@page -@vskip 0pt plus 1filll -Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and -Virginia Polytechnic Institute and State University, Blacksburg, -Virginia, USA. Portions of the software copyright 1991-1995 by -Stichting Mathematisch Centrum, Amsterdam, The Netherlands. Copying is -permitted under the terms associated with the main Python distribution, -with the additional restriction that this additional notice be included -and maintained on all distributed copies. - -@center All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Fred L. Drake, Jr. and -Virginia Polytechnic Institute and State University not be used in -advertising or publicity pertaining to distribution of the software -without specific, written prior permission. - -FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE -UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND -STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -@end titlepage - - -@node Top, Overview, (dir), (dir) -@top The Python Parser Module - -@ifinfo -This file describes the interfaces -published by the optional @code{parser} module and gives examples of -how they may be used. It contains the same text as the chapter on the -@code{parser} module in the @cite{Python Library Reference}, but is -presented as a separate document. - -This version corresponds to Python version 1.4 (1 Sept. 1996). - -@end ifinfo - -@c placeholder for the master menu -- patched by texinfo-all-menus-update -@menu -@end menu diff --git a/Demo/pdist/FSProxy.py b/Demo/pdist/FSProxy.py deleted file mode 100755 index 7510d1e6fd..0000000000 --- a/Demo/pdist/FSProxy.py +++ /dev/null @@ -1,322 +0,0 @@ -"""File System Proxy. - -Provide an OS-neutral view on a file system, locally or remotely. -The functionality is geared towards implementing some sort of -rdist-like utility between a Mac and a UNIX system. - -The module defines three classes: - -FSProxyLocal -- used for local access -FSProxyServer -- used on the server side of remote access -FSProxyClient -- used on the client side of remote access - -The remote classes are instantiated with an IP address and an optional -verbosity flag. -""" - -import server -import client -import md5 -import os -import fnmatch -from stat import * -import time -import fnmatch - -if os.name == 'mac': - import macfs - maxnamelen = 31 -else: - macfs = None - maxnamelen = 255 - -skipnames = (os.curdir, os.pardir) - - -class FSProxyLocal: - - def __init__(self): - self._dirstack = [] - self._ignore = ['*.pyc'] + self._readignore() - - def _close(self): - while self._dirstack: - self.back() - - def _readignore(self): - file = self._hide('ignore') - try: - f = open(file) - except IOError: - file = self._hide('synctree.ignorefiles') - try: - f = open(file) - except IOError: - return [] - ignore = [] - while 1: - line = f.readline() - if not line: break - if line[-1] == '\n': line = line[:-1] - ignore.append(line) - f.close() - return ignore - - def _hidden(self, name): - if os.name == 'mac': - return name[0] == '(' and name[-1] == ')' - else: - return name[0] == '.' - - def _hide(self, name): - if os.name == 'mac': - return '(%s)' % name - else: - return '.%s' % name - - def visible(self, name): - if len(name) > maxnamelen: return 0 - if name[-1] == '~': return 0 - if name in skipnames: return 0 - if self._hidden(name): return 0 - head, tail = os.path.split(name) - if head or not tail: return 0 - if macfs: - if os.path.exists(name) and not os.path.isdir(name): - try: - fs = macfs.FSSpec(name) - c, t = fs.GetCreatorType() - if t != 'TEXT': return 0 - except macfs.error, msg: - print "***", name, msg - return 0 - else: - if os.path.islink(name): return 0 - if '\0' in open(name, 'rb').read(512): return 0 - for ign in self._ignore: - if fnmatch.fnmatch(name, ign): return 0 - return 1 - - def check(self, name): - if not self.visible(name): - raise os.error, "protected name %s" % repr(name) - - def checkfile(self, name): - self.check(name) - if not os.path.isfile(name): - raise os.error, "not a plain file %s" % repr(name) - - def pwd(self): - return os.getcwd() - - def cd(self, name): - self.check(name) - save = os.getcwd(), self._ignore - os.chdir(name) - self._dirstack.append(save) - self._ignore = self._ignore + self._readignore() - - def back(self): - if not self._dirstack: - raise os.error, "empty directory stack" - dir, ignore = self._dirstack[-1] - os.chdir(dir) - del self._dirstack[-1] - self._ignore = ignore - - def _filter(self, files, pat = None): - if pat: - def keep(name, pat = pat): - return fnmatch.fnmatch(name, pat) - files = filter(keep, files) - files = filter(self.visible, files) - files.sort() - return files - - def list(self, pat = None): - files = os.listdir(os.curdir) - return self._filter(files, pat) - - def listfiles(self, pat = None): - files = os.listdir(os.curdir) - files = filter(os.path.isfile, files) - return self._filter(files, pat) - - def listsubdirs(self, pat = None): - files = os.listdir(os.curdir) - files = filter(os.path.isdir, files) - return self._filter(files, pat) - - def exists(self, name): - return self.visible(name) and os.path.exists(name) - - def isdir(self, name): - return self.visible(name) and os.path.isdir(name) - - def islink(self, name): - return self.visible(name) and os.path.islink(name) - - def isfile(self, name): - return self.visible(name) and os.path.isfile(name) - - def sum(self, name): - self.checkfile(name) - BUFFERSIZE = 1024*8 - f = open(name) - sum = md5.new() - while 1: - buffer = f.read(BUFFERSIZE) - if not buffer: - break - sum.update(buffer) - return sum.digest() - - def size(self, name): - self.checkfile(name) - return os.stat(name)[ST_SIZE] - - def mtime(self, name): - self.checkfile(name) - return time.localtime(os.stat(name)[ST_MTIME]) - - def stat(self, name): - self.checkfile(name) - size = os.stat(name)[ST_SIZE] - mtime = time.localtime(os.stat(name)[ST_MTIME]) - return size, mtime - - def info(self, name): - sum = self.sum(name) - size = os.stat(name)[ST_SIZE] - mtime = time.localtime(os.stat(name)[ST_MTIME]) - return sum, size, mtime - - def _list(self, function, list): - if list is None: - list = self.listfiles() - res = [] - for name in list: - try: - res.append((name, function(name))) - except (os.error, IOError): - res.append((name, None)) - return res - - def sumlist(self, list = None): - return self._list(self.sum, list) - - def statlist(self, list = None): - return self._list(self.stat, list) - - def mtimelist(self, list = None): - return self._list(self.mtime, list) - - def sizelist(self, list = None): - return self._list(self.size, list) - - def infolist(self, list = None): - return self._list(self.info, list) - - def _dict(self, function, list): - if list is None: - list = self.listfiles() - dict = {} - for name in list: - try: - dict[name] = function(name) - except (os.error, IOError): - pass - return dict - - def sumdict(self, list = None): - return self.dict(self.sum, list) - - def sizedict(self, list = None): - return self.dict(self.size, list) - - def mtimedict(self, list = None): - return self.dict(self.mtime, list) - - def statdict(self, list = None): - return self.dict(self.stat, list) - - def infodict(self, list = None): - return self._dict(self.info, list) - - def read(self, name, offset = 0, length = -1): - self.checkfile(name) - f = open(name) - f.seek(offset) - if length == 0: - data = '' - elif length < 0: - data = f.read() - else: - data = f.read(length) - f.close() - return data - - def create(self, name): - self.check(name) - if os.path.exists(name): - self.checkfile(name) - bname = name + '~' - try: - os.unlink(bname) - except os.error: - pass - os.rename(name, bname) - f = open(name, 'w') - f.close() - - def write(self, name, data, offset = 0): - self.checkfile(name) - f = open(name, 'r+') - f.seek(offset) - f.write(data) - f.close() - - def mkdir(self, name): - self.check(name) - os.mkdir(name, 0777) - - def rmdir(self, name): - self.check(name) - os.rmdir(name) - - -class FSProxyServer(FSProxyLocal, server.Server): - - def __init__(self, address, verbose = server.VERBOSE): - FSProxyLocal.__init__(self) - server.Server.__init__(self, address, verbose) - - def _close(self): - server.Server._close(self) - FSProxyLocal._close(self) - - def _serve(self): - server.Server._serve(self) - # Retreat into start directory - while self._dirstack: self.back() - - -class FSProxyClient(client.Client): - - def __init__(self, address, verbose = client.VERBOSE): - client.Client.__init__(self, address, verbose) - - -def test(): - import string - import sys - if sys.argv[1:]: - port = string.atoi(sys.argv[1]) - else: - port = 4127 - proxy = FSProxyServer(('', port)) - proxy._serverloop() - - -if __name__ == '__main__': - test() diff --git a/Demo/pdist/RCSProxy.py b/Demo/pdist/RCSProxy.py deleted file mode 100755 index 7212ca6224..0000000000 --- a/Demo/pdist/RCSProxy.py +++ /dev/null @@ -1,198 +0,0 @@ -#! /usr/bin/env python - -"""RCS Proxy. - -Provide a simplified interface on RCS files, locally or remotely. -The functionality is geared towards implementing some sort of -remote CVS like utility. It is modeled after the similar module -FSProxy. - -The module defines two classes: - -RCSProxyLocal -- used for local access -RCSProxyServer -- used on the server side of remote access - -The corresponding client class, RCSProxyClient, is defined in module -rcsclient. - -The remote classes are instantiated with an IP address and an optional -verbosity flag. -""" - -import server -import md5 -import os -import fnmatch -import string -import tempfile -import rcslib - - -class DirSupport: - - def __init__(self): - self._dirstack = [] - - def __del__(self): - self._close() - - def _close(self): - while self._dirstack: - self.back() - - def pwd(self): - return os.getcwd() - - def cd(self, name): - save = os.getcwd() - os.chdir(name) - self._dirstack.append(save) - - def back(self): - if not self._dirstack: - raise os.error, "empty directory stack" - dir = self._dirstack[-1] - os.chdir(dir) - del self._dirstack[-1] - - def listsubdirs(self, pat = None): - files = os.listdir(os.curdir) - files = filter(os.path.isdir, files) - return self._filter(files, pat) - - def isdir(self, name): - return os.path.isdir(name) - - def mkdir(self, name): - os.mkdir(name, 0777) - - def rmdir(self, name): - os.rmdir(name) - - -class RCSProxyLocal(rcslib.RCS, DirSupport): - - def __init__(self): - rcslib.RCS.__init__(self) - DirSupport.__init__(self) - - def __del__(self): - DirSupport.__del__(self) - rcslib.RCS.__del__(self) - - def sumlist(self, list = None): - return self._list(self.sum, list) - - def sumdict(self, list = None): - return self._dict(self.sum, list) - - def sum(self, name_rev): - f = self._open(name_rev) - BUFFERSIZE = 1024*8 - sum = md5.new() - while 1: - buffer = f.read(BUFFERSIZE) - if not buffer: - break - sum.update(buffer) - self._closepipe(f) - return sum.digest() - - def get(self, name_rev): - f = self._open(name_rev) - data = f.read() - self._closepipe(f) - return data - - def put(self, name_rev, data, message=None): - name, rev = self._unmangle(name_rev) - f = open(name, 'w') - f.write(data) - f.close() - self.checkin(name_rev, message) - self._remove(name) - - def _list(self, function, list = None): - """INTERNAL: apply FUNCTION to all files in LIST. - - Return a list of the results. - - The list defaults to all files in the directory if None. - - """ - if list is None: - list = self.listfiles() - res = [] - for name in list: - try: - res.append((name, function(name))) - except (os.error, IOError): - res.append((name, None)) - return res - - def _dict(self, function, list = None): - """INTERNAL: apply FUNCTION to all files in LIST. - - Return a dictionary mapping files to results. - - The list defaults to all files in the directory if None. - - """ - if list is None: - list = self.listfiles() - dict = {} - for name in list: - try: - dict[name] = function(name) - except (os.error, IOError): - pass - return dict - - -class RCSProxyServer(RCSProxyLocal, server.SecureServer): - - def __init__(self, address, verbose = server.VERBOSE): - RCSProxyLocal.__init__(self) - server.SecureServer.__init__(self, address, verbose) - - def _close(self): - server.SecureServer._close(self) - RCSProxyLocal._close(self) - - def _serve(self): - server.SecureServer._serve(self) - # Retreat into start directory - while self._dirstack: self.back() - - -def test_server(): - import string - import sys - if sys.argv[1:]: - port = string.atoi(sys.argv[1]) - else: - port = 4127 - proxy = RCSProxyServer(('', port)) - proxy._serverloop() - - -def test(): - import sys - if not sys.argv[1:] or sys.argv[1] and sys.argv[1][0] in '0123456789': - test_server() - sys.exit(0) - proxy = RCSProxyLocal() - what = sys.argv[1] - if hasattr(proxy, what): - attr = getattr(proxy, what) - if callable(attr): - print apply(attr, tuple(sys.argv[2:])) - else: - print `attr` - else: - print "%s: no such attribute" % what - sys.exit(2) - - -if __name__ == '__main__': - test() diff --git a/Demo/pdist/README b/Demo/pdist/README deleted file mode 100644 index b3fac24127..0000000000 --- a/Demo/pdist/README +++ /dev/null @@ -1,121 +0,0 @@ -Filesystem, RCS and CVS client and server classes -================================================= - -*** See the security warning at the end of this file! *** - -This directory contains various modules and classes that support -remote file system operations. - -CVS stuff ---------- - -rcvs Script to put in your bin directory -rcvs.py Remote CVS client command line interface - -cvslib.py CVS admin files classes (used by rrcs) -cvslock.py CVS locking algorithms - -RCS stuff ---------- - -rrcs Script to put in your bin directory -rrcs.py Remote RCS client command line interface - -rcsclient.py Return an RCSProxyClient instance - (has reasonable default server/port/directory) - -RCSProxy.py RCS proxy and server classes (on top of rcslib.py) - -rcslib.py Local-only RCS base class (affects stdout & - local work files) - -FSProxy stuff -------------- - -sumtree.py Old demo for FSProxy -cmptree.py First FSProxy client (used to sync from the Mac) -FSProxy.py Filesystem interface classes - -Generic client/server stuff ---------------------------- - -client.py Client class -server.py Server class - -security.py Security mix-in class (not very secure I think) - -Other generic stuff -------------------- - -cmdfw.py CommandFrameWork class - (used by rcvs, should be used by rrcs as well) - - -Client/Server operation ------------------------ - -The Client and Server classes implement a simple-minded RPC protocol, -using Python's pickle module to transfer arguments, return values and -exceptions with the most generality. The Server class is instantiated -with a port number on which it should listen for requests; the Client -class is instantiated with a host name and a port number where it -should connect to. Once a client is connected, a TCP connection is -maintained between client and server. - -The Server class currently handles only one connection at a time; -however it could be rewritten to allow various modes of operations, -using multiple threads or processes or the select() system call as -desired to serve multiple clients simultaneously (when using select(), -still handling one request at a time). This would not require -rewriting of the Client class. It may also be possible to adapt the -code to use UDP instead of TCP, but then both classes will have to be -rewritten (and unless extensive acknowlegements and request serial -numbers are used, the server should handle duplicate requests, so its -semantics should be idempotent -- shrudder). - -Even though the FSProxy and RCSProxy modules define client classes, -the client class is fully generic -- what methods it supports is -determined entirely by the server. The server class, however, must be -derived from. This is generally done as follows: - - from server import Server - from client import Client - - # Define a class that performs the operations locally - class MyClassLocal: - def __init__(self): ... - def _close(self): ... - - # Derive a server class using multiple inheritance - class MyClassServer(MyClassLocal, Server): - def __init__(self, address): - # Must initialize MyClassLocal as well as Server - MyClassLocal.__init__(self) - Server.__init__(self, address) - def _close(self): - Server._close() - MyClassLocal._close() - - # A dummy client class - class MyClassClient(Client): pass - -Note that because MyClassLocal isn't used in the definition of -MyClassClient, it would actually be better to place it in a separate -module so the definition of MyClassLocal isn't executed when we only -instantiate a client. - -The modules client and server should probably be renamed to Client and -Server in order to match the class names. - - -*** Security warning: this version requires that you have a file -$HOME/.python_keyfile at the server and client side containing two -comma- separated numbers. The security system at the moment makes no -guarantees of actuallng being secure -- however it requires that the -key file exists and contains the same numbers at both ends for this to -work. (You can specify an alternative keyfile in $PYTHON_KEYFILE). -Have a look at the Security class in security.py for details; -basically, if the key file contains (x, y), then the security server -class chooses a random number z (the challenge) in the range -10..100000 and the client must be able to produce pow(z, x, y) -(i.e. z**x mod y). diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py deleted file mode 100755 index 3e93f1ce8e..0000000000 --- a/Demo/pdist/client.py +++ /dev/null @@ -1,158 +0,0 @@ -"""RPC Client module.""" - -import sys -import socket -import pickle -import __builtin__ -import os - - -# Default verbosity (0 = silent, 1 = print connections, 2 = print requests too) -VERBOSE = 1 - - -class Client: - - """RPC Client class. No need to derive a class -- it's fully generic.""" - - def __init__(self, address, verbose = VERBOSE): - self._pre_init(address, verbose) - self._post_init() - - def _pre_init(self, address, verbose = VERBOSE): - if type(address) == type(0): - address = ('', address) - self._address = address - self._verbose = verbose - if self._verbose: print "Connecting to %s ..." % repr(address) - self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self._socket.connect(address) - if self._verbose: print "Connected." - self._lastid = 0 # Last id for which a reply has been received - self._nextid = 1 # Id of next request - self._replies = {} # Unprocessed replies - self._rf = self._socket.makefile('r') - self._wf = self._socket.makefile('w') - - def _post_init(self): - self._methods = self._call('.methods') - - def __del__(self): - self._close() - - def _close(self): - if self._rf: self._rf.close() - self._rf = None - if self._wf: self._wf.close() - self._wf = None - if self._socket: self._socket.close() - self._socket = None - - def __getattr__(self, name): - if name in self._methods: - method = _stub(self, name) - setattr(self, name, method) # XXX circular reference - return method - raise AttributeError, name - - def _setverbose(self, verbose): - self._verbose = verbose - - def _call(self, name, *args): - return self._vcall(name, args) - - def _vcall(self, name, args): - return self._recv(self._vsend(name, args)) - - def _send(self, name, *args): - return self._vsend(name, args) - - def _send_noreply(self, name, *args): - return self._vsend(name, args, 0) - - def _vsend_noreply(self, name, args): - return self._vsend(name, args, 0) - - def _vsend(self, name, args, wantreply = 1): - id = self._nextid - self._nextid = id+1 - if not wantreply: id = -id - request = (name, args, id) - if self._verbose > 1: print "sending request: %s" % repr(request) - wp = pickle.Pickler(self._wf) - wp.dump(request) - return id - - def _recv(self, id): - exception, value, rid = self._vrecv(id) - if rid != id: - raise RuntimeError, "request/reply id mismatch: %d/%d" % (id, rid) - if exception is None: - return value - x = exception - if hasattr(__builtin__, exception): - x = getattr(__builtin__, exception) - elif exception in ('posix.error', 'mac.error'): - x = os.error - if x == exception: - exception = x - raise exception, value - - def _vrecv(self, id): - self._flush() - if self._replies.has_key(id): - if self._verbose > 1: print "retrieving previous reply, id = %d" % id - reply = self._replies[id] - del self._replies[id] - return reply - aid = abs(id) - while 1: - if self._verbose > 1: print "waiting for reply, id = %d" % id - rp = pickle.Unpickler(self._rf) - reply = rp.load() - del rp - if self._verbose > 1: print "got reply: %s" % repr(reply) - rid = reply[2] - arid = abs(rid) - if arid == aid: - if self._verbose > 1: print "got it" - return reply - self._replies[rid] = reply - if arid > aid: - if self._verbose > 1: print "got higher id, assume all ok" - return (None, None, id) - - def _flush(self): - self._wf.flush() - - -from security import Security - - -class SecureClient(Client, Security): - - def __init__(self, *args): - import string - apply(self._pre_init, args) - Security.__init__(self) - self._wf.flush() - line = self._rf.readline() - challenge = string.atoi(string.strip(line)) - response = self._encode_challenge(challenge) - line = `long(response)` - if line[-1] in 'Ll': line = line[:-1] - self._wf.write(line + '\n') - self._wf.flush() - self._post_init() - -class _stub: - - """Helper class for Client -- each instance serves as a method of the client.""" - - def __init__(self, client, name): - self._client = client - self._name = name - - def __call__(self, *args): - return self._client._vcall(self._name, args) - diff --git a/Demo/pdist/cmdfw.py b/Demo/pdist/cmdfw.py deleted file mode 100755 index a0c6f5d8ec..0000000000 --- a/Demo/pdist/cmdfw.py +++ /dev/null @@ -1,144 +0,0 @@ -"Framework for command line interfaces like CVS. See class CmdFrameWork." - - -class CommandFrameWork: - - """Framework class for command line interfaces like CVS. - - The general command line structure is - - command [flags] subcommand [subflags] [argument] ... - - There's a class variable GlobalFlags which specifies the - global flags options. Subcommands are defined by defining - methods named do_. Flags for the subcommand are - defined by defining class or instance variables named - flags_. If there's no command, method default() - is called. The __doc__ strings for the do_ methods are used - for the usage message, printed after the general usage message - which is the class variable UsageMessage. The class variable - PostUsageMessage is printed after all the do_ methods' __doc__ - strings. The method's return value can be a suggested exit - status. [XXX Need to rewrite this to clarify it.] - - Common usage is to derive a class, instantiate it, and then call its - run() method; by default this takes its arguments from sys.argv[1:]. - """ - - UsageMessage = \ - "usage: (name)s [flags] subcommand [subflags] [argument] ..." - - PostUsageMessage = None - - GlobalFlags = '' - - def __init__(self): - """Constructor, present for completeness.""" - pass - - def run(self, args = None): - """Process flags, subcommand and options, then run it.""" - import getopt, sys - if args is None: args = sys.argv[1:] - try: - opts, args = getopt.getopt(args, self.GlobalFlags) - except getopt.error, msg: - return self.usage(msg) - self.options(opts) - if not args: - self.ready() - return self.default() - else: - cmd = args[0] - mname = 'do_' + cmd - fname = 'flags_' + cmd - try: - method = getattr(self, mname) - except AttributeError: - return self.usage("command %s unknown" % `cmd`) - try: - flags = getattr(self, fname) - except AttributeError: - flags = '' - try: - opts, args = getopt.getopt(args[1:], flags) - except getopt.error, msg: - return self.usage( - "subcommand %s: " % cmd + str(msg)) - self.ready() - return method(opts, args) - - def options(self, opts): - """Process the options retrieved by getopt. - Override this if you have any options.""" - if opts: - print "-"*40 - print "Options:" - for o, a in opts: - print 'option', o, 'value', `a` - print "-"*40 - - def ready(self): - """Called just before calling the subcommand.""" - pass - - def usage(self, msg = None): - """Print usage message. Return suitable exit code (2).""" - if msg: print msg - print self.UsageMessage % {'name': self.__class__.__name__} - docstrings = {} - c = self.__class__ - while 1: - for name in dir(c): - if name[:3] == 'do_': - if docstrings.has_key(name): - continue - try: - doc = getattr(c, name).__doc__ - except: - doc = None - if doc: - docstrings[name] = doc - if not c.__bases__: - break - c = c.__bases__[0] - if docstrings: - print "where subcommand can be:" - names = docstrings.keys() - names.sort() - for name in names: - print docstrings[name] - if self.PostUsageMessage: - print self.PostUsageMessage - return 2 - - def default(self): - """Default method, called when no subcommand is given. - You should always override this.""" - print "Nobody expects the Spanish Inquisition!" - - -def test(): - """Test script -- called when this module is run as a script.""" - import sys - class Hello(CommandFrameWork): - def do_hello(self, opts, args): - "hello -- print 'hello world', needs no arguments" - print "Hello, world" - x = Hello() - tests = [ - [], - ['hello'], - ['spam'], - ['-x'], - ['hello', '-x'], - None, - ] - for t in tests: - print '-'*10, t, '-'*10 - sts = x.run(t) - print "Exit status:", `sts` - - -if __name__ == '__main__': - test() diff --git a/Demo/pdist/cmptree.py b/Demo/pdist/cmptree.py deleted file mode 100755 index 7eaa6c3697..0000000000 --- a/Demo/pdist/cmptree.py +++ /dev/null @@ -1,208 +0,0 @@ -"""Compare local and remote dictionaries and transfer differing files -- like rdist.""" - -import sys -from repr import repr -import FSProxy -import time -import os - -def main(): - pwd = os.getcwd() - s = raw_input("chdir [%s] " % pwd) - if s: - os.chdir(s) - pwd = os.getcwd() - host = ask("host", 'voorn.cwi.nl') - port = 4127 - verbose = 1 - mode = '' - print """\ -Mode should be a string of characters, indicating what to do with differences. -r - read different files to local file system -w - write different files to remote file system -c - create new files, either remote or local -d - delete disappearing files, either remote or local -""" - s = raw_input("mode [%s] " % mode) - if s: mode = s - address = (host, port) - t1 = time.time() - local = FSProxy.FSProxyLocal() - remote = FSProxy.FSProxyClient(address, verbose) - compare(local, remote, mode) - remote._close() - local._close() - t2 = time.time() - dt = t2-t1 - mins, secs = divmod(dt, 60) - print mins, "minutes and", round(secs), "seconds" - raw_input("[Return to exit] ") - -def ask(prompt, default): - s = raw_input("%s [%s] " % (prompt, default)) - return s or default - -def askint(prompt, default): - s = raw_input("%s [%s] " % (prompt, str(default))) - if s: return string.atoi(s) - return default - -def compare(local, remote, mode): - print - print "PWD =", `os.getcwd()` - sums_id = remote._send('sumlist') - subdirs_id = remote._send('listsubdirs') - remote._flush() - print "calculating local sums ..." - lsumdict = {} - for name, info in local.sumlist(): - lsumdict[name] = info - print "getting remote sums ..." - sums = remote._recv(sums_id) - print "got", len(sums) - rsumdict = {} - for name, rsum in sums: - rsumdict[name] = rsum - if not lsumdict.has_key(name): - print `name`, "only remote" - if 'r' in mode and 'c' in mode: - recvfile(local, remote, name) - else: - lsum = lsumdict[name] - if lsum != rsum: - print `name`, - rmtime = remote.mtime(name) - lmtime = local.mtime(name) - if rmtime > lmtime: - print "remote newer", - if 'r' in mode: - recvfile(local, remote, name) - elif lmtime > rmtime: - print "local newer", - if 'w' in mode: - sendfile(local, remote, name) - else: - print "same mtime but different sum?!?!", - print - for name in lsumdict.keys(): - if not rsumdict.keys(): - print `name`, "only locally", - fl() - if 'w' in mode and 'c' in mode: - sendfile(local, remote, name) - elif 'r' in mode and 'd' in mode: - os.unlink(name) - print "removed." - print - print "gettin subdirs ..." - subdirs = remote._recv(subdirs_id) - common = [] - for name in subdirs: - if local.isdir(name): - print "Common subdirectory", repr(name) - common.append(name) - else: - print "Remote subdirectory", repr(name), "not found locally" - if 'r' in mode and 'c' in mode: - pr = "Create local subdirectory %s? [y] " % \ - repr(name) - if 'y' in mode: - ok = 'y' - else: - ok = ask(pr, "y") - if ok[:1] in ('y', 'Y'): - local.mkdir(name) - print "Subdirectory %s made" % \ - repr(name) - common.append(name) - lsubdirs = local.listsubdirs() - for name in lsubdirs: - if name not in subdirs: - print "Local subdirectory", repr(name), "not found remotely" - for name in common: - print "Entering subdirectory", repr(name) - local.cd(name) - remote.cd(name) - compare(local, remote, mode) - remote.back() - local.back() - -def sendfile(local, remote, name): - try: - remote.create(name) - except (IOError, os.error), msg: - print "cannot create:", msg - return - - print "sending ...", - fl() - - data = open(name).read() - - t1 = time.time() - - remote._send_noreply('write', name, data) - remote._flush() - - t2 = time.time() - - dt = t2-t1 - print len(data), "bytes in", round(dt), "seconds", - if dt: - print "i.e.", round(len(data)/dt), "bytes/sec", - print - -def recvfile(local, remote, name): - ok = 0 - try: - rv = recvfile_real(local, remote, name) - ok = 1 - return rv - finally: - if not ok: - print "*** recvfile of %s failed, deleting" % `name` - local.delete(name) - -def recvfile_real(local, remote, name): - try: - local.create(name) - except (IOError, os.error), msg: - print "cannot create:", msg - return - - print "receiving ...", - fl() - - f = open(name, 'w') - t1 = time.time() - - length = 4*1024 - offset = 0 - id = remote._send('read', name, offset, length) - remote._flush() - while 1: - newoffset = offset + length - newid = remote._send('read', name, newoffset, length) - data = remote._recv(id) - id = newid - if not data: break - f.seek(offset) - f.write(data) - offset = newoffset - size = f.tell() - - t2 = time.time() - f.close() - - dt = t2-t1 - print size, "bytes in", round(dt), "seconds", - if dt: - print "i.e.", int(size/dt), "bytes/sec", - print - remote._recv(id) # ignored - -def fl(): - sys.stdout.flush() - -if __name__ == '__main__': - main() diff --git a/Demo/pdist/cvslib.py b/Demo/pdist/cvslib.py deleted file mode 100755 index cf305c9798..0000000000 --- a/Demo/pdist/cvslib.py +++ /dev/null @@ -1,364 +0,0 @@ -"""Utilities for CVS administration.""" - -import string -import os -import time -import md5 -import fnmatch - -if not hasattr(time, 'timezone'): - time.timezone = 0 - -class File: - - """Represent a file's status. - - Instance variables: - - file -- the filename (no slashes), None if uninitialized - lseen -- true if the data for the local file is up to date - eseen -- true if the data from the CVS/Entries entry is up to date - (this implies that the entry must be written back) - rseen -- true if the data for the remote file is up to date - proxy -- RCSProxy instance used to contact the server, or None - - Note that lseen and rseen don't necessary mean that a local - or remote file *exists* -- they indicate that we've checked it. - However, eseen means that this instance corresponds to an - entry in the CVS/Entries file. - - If lseen is true: - - lsum -- checksum of the local file, None if no local file - lctime -- ctime of the local file, None if no local file - lmtime -- mtime of the local file, None if no local file - - If eseen is true: - - erev -- revision, None if this is a no revision (not '0') - enew -- true if this is an uncommitted added file - edeleted -- true if this is an uncommitted removed file - ectime -- ctime of last local file corresponding to erev - emtime -- mtime of last local file corresponding to erev - extra -- 5th string from CVS/Entries file - - If rseen is true: - - rrev -- revision of head, None if non-existent - rsum -- checksum of that revision, Non if non-existent - - If eseen and rseen are both true: - - esum -- checksum of revision erev, None if no revision - - Note - """ - - def __init__(self, file = None): - if file and '/' in file: - raise ValueError, "no slash allowed in file" - self.file = file - self.lseen = self.eseen = self.rseen = 0 - self.proxy = None - - def __cmp__(self, other): - return cmp(self.file, other.file) - - def getlocal(self): - try: - self.lmtime, self.lctime = os.stat(self.file)[-2:] - except os.error: - self.lmtime = self.lctime = self.lsum = None - else: - self.lsum = md5.md5(open(self.file).read()).digest() - self.lseen = 1 - - def getentry(self, line): - words = string.splitfields(line, '/') - if self.file and words[1] != self.file: - raise ValueError, "file name mismatch" - self.file = words[1] - self.erev = words[2] - self.edeleted = 0 - self.enew = 0 - self.ectime = self.emtime = None - if self.erev[:1] == '-': - self.edeleted = 1 - self.erev = self.erev[1:] - if self.erev == '0': - self.erev = None - self.enew = 1 - else: - dates = words[3] - self.ectime = unctime(dates[:24]) - self.emtime = unctime(dates[25:]) - self.extra = words[4] - if self.rseen: - self.getesum() - self.eseen = 1 - - def getremote(self, proxy = None): - if proxy: - self.proxy = proxy - try: - self.rrev = self.proxy.head(self.file) - except (os.error, IOError): - self.rrev = None - if self.rrev: - self.rsum = self.proxy.sum(self.file) - else: - self.rsum = None - if self.eseen: - self.getesum() - self.rseen = 1 - - def getesum(self): - if self.erev == self.rrev: - self.esum = self.rsum - elif self.erev: - name = (self.file, self.erev) - self.esum = self.proxy.sum(name) - else: - self.esum = None - - def putentry(self): - """Return a line suitable for inclusion in CVS/Entries. - - The returned line is terminated by a newline. - If no entry should be written for this file, - return "". - """ - if not self.eseen: - return "" - - rev = self.erev or '0' - if self.edeleted: - rev = '-' + rev - if self.enew: - dates = 'Initial ' + self.file - else: - dates = gmctime(self.ectime) + ' ' + \ - gmctime(self.emtime) - return "/%s/%s/%s/%s/\n" % ( - self.file, - rev, - dates, - self.extra) - - def report(self): - print '-'*50 - def r(key, repr=repr, self=self): - try: - value = repr(getattr(self, key)) - except AttributeError: - value = "?" - print "%-15s:" % key, value - r("file") - if self.lseen: - r("lsum", hexify) - r("lctime", gmctime) - r("lmtime", gmctime) - if self.eseen: - r("erev") - r("enew") - r("edeleted") - r("ectime", gmctime) - r("emtime", gmctime) - if self.rseen: - r("rrev") - r("rsum", hexify) - if self.eseen: - r("esum", hexify) - - -class CVS: - - """Represent the contents of a CVS admin file (and more). - - Class variables: - - FileClass -- the class to be instantiated for entries - (this should be derived from class File above) - IgnoreList -- shell patterns for local files to be ignored - - Instance variables: - - entries -- a dictionary containing File instances keyed by - their file name - proxy -- an RCSProxy instance, or None - """ - - FileClass = File - - IgnoreList = ['.*', '@*', ',*', '*~', '*.o', '*.a', '*.so', '*.pyc'] - - def __init__(self): - self.entries = {} - self.proxy = None - - def setproxy(self, proxy): - if proxy is self.proxy: - return - self.proxy = proxy - for e in self.entries.values(): - e.rseen = 0 - - def getentries(self): - """Read the contents of CVS/Entries""" - self.entries = {} - f = self.cvsopen("Entries") - while 1: - line = f.readline() - if not line: break - e = self.FileClass() - e.getentry(line) - self.entries[e.file] = e - f.close() - - def putentries(self): - """Write CVS/Entries back""" - f = self.cvsopen("Entries", 'w') - for e in self.values(): - f.write(e.putentry()) - f.close() - - def getlocalfiles(self): - list = self.entries.keys() - addlist = os.listdir(os.curdir) - for name in addlist: - if name in list: - continue - if not self.ignored(name): - list.append(name) - list.sort() - for file in list: - try: - e = self.entries[file] - except KeyError: - e = self.entries[file] = self.FileClass(file) - e.getlocal() - - def getremotefiles(self, proxy = None): - if proxy: - self.proxy = proxy - if not self.proxy: - raise RuntimeError, "no RCS proxy" - addlist = self.proxy.listfiles() - for file in addlist: - try: - e = self.entries[file] - except KeyError: - e = self.entries[file] = self.FileClass(file) - e.getremote(self.proxy) - - def report(self): - for e in self.values(): - e.report() - print '-'*50 - - def keys(self): - keys = self.entries.keys() - keys.sort() - return keys - - def values(self): - def value(key, self=self): - return self.entries[key] - return map(value, self.keys()) - - def items(self): - def item(key, self=self): - return (key, self.entries[key]) - return map(item, self.keys()) - - def cvsexists(self, file): - file = os.path.join("CVS", file) - return os.path.exists(file) - - def cvsopen(self, file, mode = 'r'): - file = os.path.join("CVS", file) - if 'r' not in mode: - self.backup(file) - return open(file, mode) - - def backup(self, file): - if os.path.isfile(file): - bfile = file + '~' - try: os.unlink(bfile) - except os.error: pass - os.rename(file, bfile) - - def ignored(self, file): - if os.path.isdir(file): return 1 - for pat in self.IgnoreList: - if fnmatch.fnmatch(file, pat): return 1 - return 0 - - -# hexify and unhexify are useful to print MD5 checksums in hex format - -hexify_format = '%02x' * 16 -def hexify(sum): - "Return a hex representation of a 16-byte string (e.g. an MD5 digest)" - if sum is None: - return "None" - return hexify_format % tuple(map(ord, sum)) - -def unhexify(hexsum): - "Return the original from a hexified string" - if hexsum == "None": - return None - sum = '' - for i in range(0, len(hexsum), 2): - sum = sum + chr(string.atoi(hexsum[i:i+2], 16)) - return sum - - -unctime_monthmap = {} -def unctime(date): - if date == "None": return None - if not unctime_monthmap: - months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - i = 0 - for m in months: - i = i+1 - unctime_monthmap[m] = i - words = string.split(date) # Day Mon DD HH:MM:SS YEAR - year = string.atoi(words[4]) - month = unctime_monthmap[words[1]] - day = string.atoi(words[2]) - [hh, mm, ss] = map(string.atoi, string.splitfields(words[3], ':')) - ss = ss - time.timezone - return time.mktime((year, month, day, hh, mm, ss, 0, 0, 0)) - -def gmctime(t): - if t is None: return "None" - return time.asctime(time.gmtime(t)) - -def test_unctime(): - now = int(time.time()) - t = time.gmtime(now) - at = time.asctime(t) - print 'GMT', now, at - print 'timezone', time.timezone - print 'local', time.ctime(now) - u = unctime(at) - print 'unctime()', u - gu = time.gmtime(u) - print '->', gu - print time.asctime(gu) - -def test(): - x = CVS() - x.getentries() - x.getlocalfiles() -## x.report() - import rcsclient - proxy = rcsclient.openrcsclient() - x.getremotefiles(proxy) - x.report() - - -if __name__ == "__main__": - test() diff --git a/Demo/pdist/cvslock.py b/Demo/pdist/cvslock.py deleted file mode 100755 index a421e1a943..0000000000 --- a/Demo/pdist/cvslock.py +++ /dev/null @@ -1,280 +0,0 @@ -"""CVS locking algorithm. - -CVS locking strategy -==================== - -As reverse engineered from the CVS 1.3 sources (file lock.c): - -- Locking is done on a per repository basis (but a process can hold -write locks for multiple directories); all lock files are placed in -the repository and have names beginning with "#cvs.". - -- Before even attempting to lock, a file "#cvs.tfl." is created -(and removed again), to test that we can write the repository. [The -algorithm can still be fooled (1) if the repository's mode is changed -while attempting to lock; (2) if this file exists and is writable but -the directory is not.] - -- While creating the actual read/write lock files (which may exist for -a long time), a "meta-lock" is held. The meta-lock is a directory -named "#cvs.lock" in the repository. The meta-lock is also held while -a write lock is held. - -- To set a read lock: - - - acquire the meta-lock - - create the file "#cvs.rfl." - - release the meta-lock - -- To set a write lock: - - - acquire the meta-lock - - check that there are no files called "#cvs.rfl.*" - - if there are, release the meta-lock, sleep, try again - - create the file "#cvs.wfl." - -- To release a write lock: - - - remove the file "#cvs.wfl." - - rmdir the meta-lock - -- To release a read lock: - - - remove the file "#cvs.rfl." - - -Additional notes ----------------- - -- A process should read-lock at most one repository at a time. - -- A process may write-lock as many repositories as it wishes (to avoid -deadlocks, I presume it should always lock them top-down in the -directory hierarchy). - -- A process should make sure it removes all its lock files and -directories when it crashes. - -- Limitation: one user id should not be committing files into the same -repository at the same time. - - -Turn this into Python code --------------------------- - -rl = ReadLock(repository, waittime) - -wl = WriteLock(repository, waittime) - -list = MultipleWriteLock([repository1, repository2, ...], waittime) - -""" - - -import os -import time -import stat -import pwd - - -# Default wait time -DELAY = 10 - - -# XXX This should be the same on all Unix versions -EEXIST = 17 - - -# Files used for locking (must match cvs.h in the CVS sources) -CVSLCK = "#cvs.lck" -CVSRFL = "#cvs.rfl." -CVSWFL = "#cvs.wfl." - - -class Error: - - def __init__(self, msg): - self.msg = msg - - def __repr__(self): - return repr(self.msg) - - def __str__(self): - return str(self.msg) - - -class Locked(Error): - pass - - -class Lock: - - def __init__(self, repository = ".", delay = DELAY): - self.repository = repository - self.delay = delay - self.lockdir = None - self.lockfile = None - pid = `os.getpid()` - self.cvslck = self.join(CVSLCK) - self.cvsrfl = self.join(CVSRFL + pid) - self.cvswfl = self.join(CVSWFL + pid) - - def __del__(self): - print "__del__" - self.unlock() - - def setlockdir(self): - while 1: - try: - self.lockdir = self.cvslck - os.mkdir(self.cvslck, 0777) - return - except os.error, msg: - self.lockdir = None - if msg[0] == EEXIST: - try: - st = os.stat(self.cvslck) - except os.error: - continue - self.sleep(st) - continue - raise Error("failed to lock %s: %s" % ( - self.repository, msg)) - - def unlock(self): - self.unlockfile() - self.unlockdir() - - def unlockfile(self): - if self.lockfile: - print "unlink", self.lockfile - try: - os.unlink(self.lockfile) - except os.error: - pass - self.lockfile = None - - def unlockdir(self): - if self.lockdir: - print "rmdir", self.lockdir - try: - os.rmdir(self.lockdir) - except os.error: - pass - self.lockdir = None - - def sleep(self, st): - sleep(st, self.repository, self.delay) - - def join(self, name): - return os.path.join(self.repository, name) - - -def sleep(st, repository, delay): - if delay <= 0: - raise Locked(st) - uid = st[stat.ST_UID] - try: - pwent = pwd.getpwuid(uid) - user = pwent[0] - except KeyError: - user = "uid %d" % uid - print "[%s]" % time.ctime(time.time())[11:19], - print "Waiting for %s's lock in" % user, repository - time.sleep(delay) - - -class ReadLock(Lock): - - def __init__(self, repository, delay = DELAY): - Lock.__init__(self, repository, delay) - ok = 0 - try: - self.setlockdir() - self.lockfile = self.cvsrfl - fp = open(self.lockfile, 'w') - fp.close() - ok = 1 - finally: - if not ok: - self.unlockfile() - self.unlockdir() - - -class WriteLock(Lock): - - def __init__(self, repository, delay = DELAY): - Lock.__init__(self, repository, delay) - self.setlockdir() - while 1: - uid = self.readers_exist() - if not uid: - break - self.unlockdir() - self.sleep(uid) - self.lockfile = self.cvswfl - fp = open(self.lockfile, 'w') - fp.close() - - def readers_exist(self): - n = len(CVSRFL) - for name in os.listdir(self.repository): - if name[:n] == CVSRFL: - try: - st = os.stat(self.join(name)) - except os.error: - continue - return st - return None - - -def MultipleWriteLock(repositories, delay = DELAY): - while 1: - locks = [] - for r in repositories: - try: - locks.append(WriteLock(r, 0)) - except Locked, instance: - del locks - break - else: - break - sleep(instance.msg, r, delay) - return list - - -def test(): - import sys - if sys.argv[1:]: - repository = sys.argv[1] - else: - repository = "." - rl = None - wl = None - try: - print "attempting write lock ..." - wl = WriteLock(repository) - print "got it." - wl.unlock() - print "attempting read lock ..." - rl = ReadLock(repository) - print "got it." - rl.unlock() - finally: - print [1] - sys.exc_traceback = None - print [2] - if rl: - rl.unlock() - print [3] - if wl: - wl.unlock() - print [4] - rl = None - print [5] - wl = None - print [6] - - -if __name__ == '__main__': - test() diff --git a/Demo/pdist/mac.py b/Demo/pdist/mac.py deleted file mode 100755 index 516ee153e4..0000000000 --- a/Demo/pdist/mac.py +++ /dev/null @@ -1,19 +0,0 @@ -import sys -import string -import rcvs - -def main(): - while 1: - try: - line = raw_input('$ ') - except EOFError: - break - words = string.split(line) - if not words: - continue - if words[0] != 'rcvs': - words.insert(0, 'rcvs') - sys.argv = words - rcvs.main() - -main() diff --git a/Demo/pdist/makechangelog.py b/Demo/pdist/makechangelog.py deleted file mode 100755 index b26f30b3a0..0000000000 --- a/Demo/pdist/makechangelog.py +++ /dev/null @@ -1,109 +0,0 @@ -#! /usr/bin/env python - -"""Turn a pile of RCS log output into ChangeLog file entries. - -""" - -import sys -import string -import regex -import getopt -import time - -def main(): - args = sys.argv[1:] - opts, args = getopt.getopt(args, 'p:') - prefix = '' - for o, a in opts: - if p == '-p': prefix = a - - f = sys.stdin - allrevs = [] - while 1: - file = getnextfile(f) - if not file: break - revs = [] - while 1: - rev = getnextrev(f, file) - if not rev: - break - revs.append(rev) - if revs: - allrevs[len(allrevs):] = revs - allrevs.sort() - allrevs.reverse() - for rev in allrevs: - formatrev(rev, prefix) - -parsedateprog = regex.compile( - '^date: \([0-9]+\)/\([0-9]+\)/\([0-9]+\) ' + - '\([0-9]+\):\([0-9]+\):\([0-9]+\); author: \([^ ;]+\)') - -authormap = { - 'guido': 'Guido van Rossum ', - 'jack': 'Jack Jansen ', - 'sjoerd': 'Sjoerd Mullender ', - } - -def formatrev(rev, prefix): - dateline, file, revline, log = rev - if parsedateprog.match(dateline) >= 0: - fields = parsedateprog.group(1, 2, 3, 4, 5, 6) - author = parsedateprog.group(7) - if authormap.has_key(author): author = authormap[author] - tfields = map(string.atoi, fields) + [0, 0, 0] - tfields[5] = tfields[5] - time.timezone - t = time.mktime(tuple(tfields)) - print time.ctime(t), '', author - words = string.split(log) - words[:0] = ['*', prefix + file + ':'] - maxcol = 72-8 - col = maxcol - for word in words: - if col > 0 and col + len(word) >= maxcol: - print - print '\t' + word, - col = -1 - else: - print word, - col = col + 1 + len(word) - print - print - -startprog = regex.compile("^Working file: \(.*\)$") - -def getnextfile(f): - while 1: - line = f.readline() - if not line: return None - if startprog.match(line) >= 0: - file = startprog.group(1) - # Skip until first revision - while 1: - line = f.readline() - if not line: return None - if line[:10] == '='*10: return None - if line[:10] == '-'*10: break -## print "Skipped", line, - return file -## else: -## print "Ignored", line, - -def getnextrev(f, file): - # This is called when we are positioned just after a '---' separator - revline = f.readline() - dateline = f.readline() - log = '' - while 1: - line = f.readline() - if not line: break - if line[:10] == '='*10: - # Ignore the *last* log entry for each file since it - # is the revision since which we are logging. - return None - if line[:10] == '-'*10: break - log = log + line - return dateline, file, revline, log - -if __name__ == '__main__': - main() diff --git a/Demo/pdist/new b/Demo/pdist/new deleted file mode 100755 index 9daeafb986..0000000000 --- a/Demo/pdist/new +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/Demo/pdist/rcsbump b/Demo/pdist/rcsbump deleted file mode 100755 index e4e9ed558d..0000000000 --- a/Demo/pdist/rcsbump +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -# -*- python -*- -# -# guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp -# -# Python script for bumping up an RCS major revision number. - -import sys -import regex -import rcslib -import string - -WITHLOCK = 1 -majorrev_re = regex.compile('^[0-9]+') - -dir = rcslib.RCS() - -if sys.argv[1:]: - files = sys.argv[1:] -else: - files = dir.listfiles() - -for file in files: - # get the major revnumber of the file - headbranch = dir.info(file)['head'] - majorrev_re.match(headbranch) - majorrev = string.atoi(majorrev_re.group(0)) + 1 - - if not dir.islocked(file): - dir.checkout(file, WITHLOCK) - - msg = "Bumping major revision number (to %d)" % majorrev - dir.checkin((file, "%s.0" % majorrev), msg, "-f") diff --git a/Demo/pdist/rcsclient.py b/Demo/pdist/rcsclient.py deleted file mode 100755 index 5d88a57981..0000000000 --- a/Demo/pdist/rcsclient.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Customize this file to change the default client etc. - -(In general, it is probably be better to make local operation the -default and to require something like an RCSSERVER environment -variable to enable remote operation.) - -""" - -import string -import os - -# These defaults don't belong here -- they should be taken from the -# environment or from a hidden file in the current directory - -HOST = 'voorn.cwi.nl' -PORT = 4127 -VERBOSE = 1 -LOCAL = 0 - -import client - - -class RCSProxyClient(client.SecureClient): - - def __init__(self, address, verbose = client.VERBOSE): - client.SecureClient.__init__(self, address, verbose) - - -def openrcsclient(opts = []): - "open an RCSProxy client based on a list of options returned by getopt" - import RCSProxy - host = HOST - port = PORT - verbose = VERBOSE - local = LOCAL - directory = None - for o, a in opts: - if o == '-h': - host = a - if ':' in host: - i = string.find(host, ':') - host, p = host[:i], host[i+1:] - if p: - port = string.atoi(p) - if o == '-p': - port = string.atoi(a) - if o == '-d': - directory = a - if o == '-v': - verbose = verbose + 1 - if o == '-q': - verbose = 0 - if o == '-L': - local = 1 - if local: - import RCSProxy - x = RCSProxy.RCSProxyLocal() - else: - address = (host, port) - x = RCSProxyClient(address, verbose) - if not directory: - try: - directory = open(os.path.join("CVS", "Repository")).readline() - except IOError: - pass - else: - if directory[-1] == '\n': - directory = directory[:-1] - if directory: - x.cd(directory) - return x diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py deleted file mode 100755 index 5e79247cb3..0000000000 --- a/Demo/pdist/rcslib.py +++ /dev/null @@ -1,339 +0,0 @@ -"""RCS interface module. - -Defines the class RCS, which represents a directory with rcs version -files and (possibly) corresponding work files. - -""" - - -import fnmatch -import os -import regsub -import string -import tempfile - - -class RCS: - - """RCS interface class (local filesystem version). - - An instance of this class represents a directory with rcs version - files and (possible) corresponding work files. - - Methods provide access to most rcs operations such as - checkin/checkout, access to the rcs metadata (revisions, logs, - branches etc.) as well as some filesystem operations such as - listing all rcs version files. - - XXX BUGS / PROBLEMS - - - The instance always represents the current directory so it's not - very useful to have more than one instance around simultaneously - - """ - - # Characters allowed in work file names - okchars = string.letters + string.digits + '-_=+.' - - def __init__(self): - """Constructor.""" - pass - - def __del__(self): - """Destructor.""" - pass - - # --- Informational methods about a single file/revision --- - - def log(self, name_rev, otherflags = ''): - """Return the full log text for NAME_REV as a string. - - Optional OTHERFLAGS are passed to rlog. - - """ - f = self._open(name_rev, 'rlog ' + otherflags) - data = f.read() - status = self._closepipe(f) - if status: - data = data + "%s: %s" % status - elif data[-1] == '\n': - data = data[:-1] - return data - - def head(self, name_rev): - """Return the head revision for NAME_REV""" - dict = self.info(name_rev) - return dict['head'] - - def info(self, name_rev): - """Return a dictionary of info (from rlog -h) for NAME_REV - - The dictionary's keys are the keywords that rlog prints - (e.g. 'head' and its values are the corresponding data - (e.g. '1.3'). - - XXX symbolic names and locks are not returned - - """ - f = self._open(name_rev, 'rlog -h') - dict = {} - while 1: - line = f.readline() - if not line: break - if line[0] == '\t': - # XXX could be a lock or symbolic name - # Anything else? - continue - i = string.find(line, ':') - if i > 0: - key, value = line[:i], string.strip(line[i+1:]) - dict[key] = value - status = self._closepipe(f) - if status: - raise IOError, status - return dict - - # --- Methods that change files --- - - def lock(self, name_rev): - """Set an rcs lock on NAME_REV.""" - name, rev = self.checkfile(name_rev) - cmd = "rcs -l%s %s" % (rev, name) - return self._system(cmd) - - def unlock(self, name_rev): - """Clear an rcs lock on NAME_REV.""" - name, rev = self.checkfile(name_rev) - cmd = "rcs -u%s %s" % (rev, name) - return self._system(cmd) - - def checkout(self, name_rev, withlock=0, otherflags=""): - """Check out NAME_REV to its work file. - - If optional WITHLOCK is set, check out locked, else unlocked. - - The optional OTHERFLAGS is passed to co without - interpretation. - - Any output from co goes to directly to stdout. - - """ - name, rev = self.checkfile(name_rev) - if withlock: lockflag = "-l" - else: lockflag = "-u" - cmd = 'co %s%s %s %s' % (lockflag, rev, otherflags, name) - return self._system(cmd) - - def checkin(self, name_rev, message=None, otherflags=""): - """Check in NAME_REV from its work file. - - The optional MESSAGE argument becomes the checkin message - (default "" if None); or the file description if this is - a new file. - - The optional OTHERFLAGS argument is passed to ci without - interpretation. - - Any output from ci goes to directly to stdout. - - """ - name, rev = self._unmangle(name_rev) - new = not self.isvalid(name) - if not message: message = "" - if message and message[-1] != '\n': - message = message + '\n' - lockflag = "-u" - textfile = None - try: - if new: - textfile = tempfile.mktemp() - f = open(textfile, 'w') - f.write(message) - f.close() - cmd = 'ci %s%s -t%s %s %s' % \ - (lockflag, rev, textfile, otherflags, name) - else: - message = regsub.gsub('\([\\"$`]\)', '\\\\\\1', message) - cmd = 'ci %s%s -m"%s" %s %s' % \ - (lockflag, rev, message, otherflags, name) - return self._system(cmd) - finally: - if textfile: self._remove(textfile) - - # --- Exported support methods --- - - def listfiles(self, pat = None): - """Return a list of all version files matching optional PATTERN.""" - files = os.listdir(os.curdir) - files = filter(self._isrcs, files) - if os.path.isdir('RCS'): - files2 = os.listdir('RCS') - files2 = filter(self._isrcs, files2) - files = files + files2 - files = map(self.realname, files) - return self._filter(files, pat) - - def isvalid(self, name): - """Test whether NAME has a version file associated.""" - namev = self.rcsname(name) - return (os.path.isfile(namev) or - os.path.isfile(os.path.join('RCS', namev))) - - def rcsname(self, name): - """Return the pathname of the version file for NAME. - - The argument can be a work file name or a version file name. - If the version file does not exist, the name of the version - file that would be created by "ci" is returned. - - """ - if self._isrcs(name): namev = name - else: namev = name + ',v' - if os.path.isfile(namev): return namev - namev = os.path.join('RCS', os.path.basename(namev)) - if os.path.isfile(namev): return namev - if os.path.isdir('RCS'): - return os.path.join('RCS', namev) - else: - return namev - - def realname(self, namev): - """Return the pathname of the work file for NAME. - - The argument can be a work file name or a version file name. - If the work file does not exist, the name of the work file - that would be created by "co" is returned. - - """ - if self._isrcs(namev): name = namev[:-2] - else: name = namev - if os.path.isfile(name): return name - name = os.path.basename(name) - return name - - def islocked(self, name_rev): - """Test whether FILE (which must have a version file) is locked. - - XXX This does not tell you which revision number is locked and - ignores any revision you may pass in (by virtue of using rlog - -L -R). - - """ - f = self._open(name_rev, 'rlog -L -R') - line = f.readline() - status = self._closepipe(f) - if status: - raise IOError, status - if not line: return None - if line[-1] == '\n': - line = line[:-1] - return self.realname(name_rev) == self.realname(line) - - def checkfile(self, name_rev): - """Normalize NAME_REV into a (NAME, REV) tuple. - - Raise an exception if there is no corresponding version file. - - """ - name, rev = self._unmangle(name_rev) - if not self.isvalid(name): - raise os.error, 'not an rcs file %s' % `name` - return name, rev - - # --- Internal methods --- - - def _open(self, name_rev, cmd = 'co -p', rflag = '-r'): - """INTERNAL: open a read pipe to NAME_REV using optional COMMAND. - - Optional FLAG is used to indicate the revision (default -r). - - Default COMMAND is "co -p". - - Return a file object connected by a pipe to the command's - output. - - """ - name, rev = self.checkfile(name_rev) - namev = self.rcsname(name) - if rev: - cmd = cmd + ' ' + rflag + rev - return os.popen("%s %s" % (cmd, `namev`)) - - def _unmangle(self, name_rev): - """INTERNAL: Normalize NAME_REV argument to (NAME, REV) tuple. - - Raise an exception if NAME contains invalid characters. - - A NAME_REV argument is either NAME string (implying REV='') or - a tuple of the form (NAME, REV). - - """ - if type(name_rev) == type(''): - name_rev = name, rev = name_rev, '' - else: - name, rev = name_rev - for c in rev: - if c not in self.okchars: - raise ValueError, "bad char in rev" - return name_rev - - def _closepipe(self, f): - """INTERNAL: Close PIPE and print its exit status if nonzero.""" - sts = f.close() - if not sts: return None - detail, reason = divmod(sts, 256) - if reason == 0: return 'exit', detail # Exit status - signal = reason&0x7F - if signal == 0x7F: - code = 'stopped' - signal = detail - else: - code = 'killed' - if reason&0x80: - code = code + '(coredump)' - return code, signal - - def _system(self, cmd): - """INTERNAL: run COMMAND in a subshell. - - Standard input for the command is taken from /dev/null. - - Raise IOError when the exit status is not zero. - - Return whatever the calling method should return; normally - None. - - A derived class may override this method and redefine it to - capture stdout/stderr of the command and return it. - - """ - cmd = cmd + " > ") - sys.stderr.flush() - line = sys.stdin.readline() - if not line or line == '.\n': break - message = message + line - return message - -def remove(fn): - try: - os.unlink(fn) - except os.error: - pass - -commands = { - 'ci': ('', checkin), - 'put': ('', checkin), - 'co': ('', checkout), - 'get': ('', checkout), - 'info': ('', info), - 'head': ('', head), - 'list': ('', list), - 'lock': ('', lock), - 'unlock': ('', unlock), - 'log': ('bhLRtd:l:r:s:w:V:', log), - 'diff': ('c', diff), - } - -if __name__ == '__main__': - main() diff --git a/Demo/pdist/security.py b/Demo/pdist/security.py deleted file mode 100755 index 0ffd511a07..0000000000 --- a/Demo/pdist/security.py +++ /dev/null @@ -1,33 +0,0 @@ -class Security: - - def __init__(self): - import os - env = os.environ - if env.has_key('PYTHON_KEYFILE'): - keyfile = env['PYTHON_KEYFILE'] - else: - keyfile = '.python_keyfile' - if env.has_key('HOME'): - keyfile = os.path.join(env['HOME'], keyfile) - if not os.path.exists(keyfile): - import sys - for dir in sys.path: - kf = os.path.join(dir, keyfile) - if os.path.exists(kf): - keyfile = kf - break - try: - self._key = eval(open(keyfile).readline()) - except IOError: - raise IOError, "python keyfile %s: cannot open" % keyfile - - def _generate_challenge(self): - import random - return random.randint(100, 100000) - - def _compare_challenge_response(self, challenge, response): - return self._encode_challenge(challenge) == response - - def _encode_challenge(self, challenge): - p, m = self._key - return pow(long(challenge), p, m) diff --git a/Demo/pdist/server.py b/Demo/pdist/server.py deleted file mode 100755 index 423d583007..0000000000 --- a/Demo/pdist/server.py +++ /dev/null @@ -1,145 +0,0 @@ -"""RPC Server module.""" - -import sys -import socket -import pickle -from fnmatch import fnmatch -from repr import repr - - -# Default verbosity (0 = silent, 1 = print connections, 2 = print requests too) -VERBOSE = 1 - - -class Server: - - """RPC Server class. Derive a class to implement a particular service.""" - - def __init__(self, address, verbose = VERBOSE): - if type(address) == type(0): - address = ('', address) - self._address = address - self._verbose = verbose - self._socket = None - self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self._socket.bind(address) - self._socket.listen(1) - self._listening = 1 - - def _setverbose(self, verbose): - self._verbose = verbose - - def __del__(self): - self._close() - - def _close(self): - self._listening = 0 - if self._socket: - self._socket.close() - self._socket = None - - def _serverloop(self): - while self._listening: - self._serve() - - def _serve(self): - if self._verbose: print "Wait for connection ..." - conn, address = self._socket.accept() - if self._verbose: print "Accepted connection from %s" % repr(address) - if not self._verify(conn, address): - print "*** Connection from %s refused" % repr(address) - conn.close() - return - rf = conn.makefile('r') - wf = conn.makefile('w') - ok = 1 - while ok: - wf.flush() - if self._verbose > 1: print "Wait for next request ..." - ok = self._dorequest(rf, wf) - - _valid = ['192.16.201.*', '192.16.197.*', '132.151.1.*', '129.6.64.*'] - - def _verify(self, conn, address): - host, port = address - for pat in self._valid: - if fnmatch(host, pat): return 1 - return 0 - - def _dorequest(self, rf, wf): - rp = pickle.Unpickler(rf) - try: - request = rp.load() - except EOFError: - return 0 - if self._verbose > 1: print "Got request: %s" % repr(request) - try: - methodname, args, id = request - if '.' in methodname: - reply = (None, self._special(methodname, args), id) - elif methodname[0] == '_': - raise NameError, "illegal method name %s" % repr(methodname) - else: - method = getattr(self, methodname) - reply = (None, apply(method, args), id) - except: - reply = (sys.exc_type, sys.exc_value, id) - if id < 0 and reply[:2] == (None, None): - if self._verbose > 1: print "Suppress reply" - return 1 - if self._verbose > 1: print "Send reply: %s" % repr(reply) - wp = pickle.Pickler(wf) - wp.dump(reply) - return 1 - - def _special(self, methodname, args): - if methodname == '.methods': - if not hasattr(self, '_methods'): - self._methods = tuple(self._listmethods()) - return self._methods - raise NameError, "unrecognized special method name %s" % repr(methodname) - - def _listmethods(self, cl=None): - if not cl: cl = self.__class__ - names = cl.__dict__.keys() - names = filter(lambda x: x[0] != '_', names) - names.sort() - for base in cl.__bases__: - basenames = self._listmethods(base) - basenames = filter(lambda x, names=names: x not in names, basenames) - names[len(names):] = basenames - return names - - -from security import Security - - -class SecureServer(Server, Security): - - def __init__(self, *args): - apply(Server.__init__, (self,) + args) - Security.__init__(self) - - def _verify(self, conn, address): - import string - challenge = self._generate_challenge() - conn.send("%d\n" % challenge) - response = "" - while "\n" not in response and len(response) < 100: - data = conn.recv(100) - if not data: - break - response = response + data - try: - response = string.atol(string.strip(response)) - except string.atol_error: - if self._verbose > 0: - print "Invalid response syntax", `response` - return 0 - if not self._compare_challenge_response(challenge, response): - if self._verbose > 0: - print "Invalid response value", `response` - return 0 - if self._verbose > 1: - print "Response matches challenge. Go ahead!" - return 1 diff --git a/Demo/pdist/sumtree.py b/Demo/pdist/sumtree.py deleted file mode 100755 index 92c1fd0552..0000000000 --- a/Demo/pdist/sumtree.py +++ /dev/null @@ -1,24 +0,0 @@ -import time -import FSProxy - -def main(): - t1 = time.time() - #proxy = FSProxy.FSProxyClient(('voorn.cwi.nl', 4127)) - proxy = FSProxy.FSProxyLocal() - sumtree(proxy) - proxy._close() - t2 = time.time() - print t2-t1, "seconds" - raw_input("[Return to exit] ") - -def sumtree(proxy): - print "PWD =", proxy.pwd() - files = proxy.listfiles() - proxy.infolist(files) - subdirs = proxy.listsubdirs() - for name in subdirs: - proxy.cd(name) - sumtree(proxy) - proxy.back() - -main() diff --git a/Demo/pysvr/Makefile b/Demo/pysvr/Makefile deleted file mode 100644 index 073cda5b65..0000000000 --- a/Demo/pysvr/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Makefile for 'pysvr' application embedding Python. -# Tailored for Python 1.5a3 or later. -# Some details are specific for Solaris or CNRI. -# Also see ## comments for tailoring. - -# Which C compiler -CC=gcc -##PURIFY=/usr/local/pure/purify -LINKCC=$(PURIFY) $(CC) - -# Optimization preferences -OPT=-g - -# Where Python is installed, and which version -INST=/usr/local -VER=1.5 - -# Expressions using the above definitions -- no need to change -PYVER=python$(VER) -# Use these defs when compiling against installed Python -PYC=$(INST)/lib/$(PYVER)/config -PYINCL=-I$(INST)/include/$(PYVER) -I$(PYC) -PYLIBS=$(PYC)/lib$(PYVER).a -# Use these defs when compiling against built Python -##PYINCL=-I../../Include -I../../sparc -##PYLIBS=../../sparc/lib$(PYVER).a - -# Libraries to link with -- very installation dependent -# (See LIBS= in Modules/Makefile in build tree) -RLLIBS=-lreadline -ltermcap -OTHERLIBS=-lsocket -lnsl -lpthread -ldl -lm - -# Compilation and link flags -- no need to change normally -CFLAGS=$(PYINCL) $(OPT) -LIBS=$(PYLIBS) $(RLLIBS) $(OTHERLIBS) - -# Default port for the pysvr application -PORT=4000 - -# Default target -all: pysvr - -# Target to build pysvr -pysvr: pysvr.o $(PYOBJS) $(PYLIBS) - $(LINKCC) pysvr.o $(LIBS) -o pysvr - -# Target to build and run pysvr -run: pysvr - pysvr $(PORT) - -# Target to clean up the directory -clean: - -rm -f pysvr *.o *~ core diff --git a/Demo/pysvr/README b/Demo/pysvr/README deleted file mode 100644 index 5e64e38bb4..0000000000 --- a/Demo/pysvr/README +++ /dev/null @@ -1,9 +0,0 @@ -This is an example of a multi-threaded C application embedding a -Python interpreter. - -The particular application is a multi-threaded telnet-like server that -provides you with a Python prompt (instead of a shell prompt). - -The file pysvr.py is a prototype in Python. - -THIS APPLICATION IS NOT SECURE -- ONLY USE IT FOR TESTING! diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c deleted file mode 100644 index d7d755cb3c..0000000000 --- a/Demo/pysvr/pysvr.c +++ /dev/null @@ -1,372 +0,0 @@ -/* A multi-threaded telnet-like server that gives a Python prompt. - -Usage: pysvr [port] - -For security reasons, it only accepts requests from the current host. -This can still be insecure, but restricts violations from people who -can log in on your machine. Use with caution! - -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* XXX Umpfh. - Python.h defines a typedef destructor, which conflicts with pthread.h. - So Python.h must be included after pthread.h. */ - -#include - -extern int Py_VerboseFlag; - -#ifndef PORT -#define PORT 4000 -#endif - -extern int optind; -extern char *optarg; -extern int getopt(int, char **, char *); - -struct workorder { - int conn; - struct sockaddr_in addr; -}; - -/* Forward */ -static void init_python(void); -static void usage(void); -static void oprogname(void); -static void main_thread(int); -static void create_thread(int, struct sockaddr_in *); -static void *service_thread(struct workorder *); -static void run_interpreter(FILE *, FILE *); -static int run_command(char *, PyObject *); -static void ps(void); - -static char *progname = "pysvr"; - -static PyThreadState *gtstate; - -main(int argc, char **argv) -{ - int port = PORT; - int c; - - if (argc > 0 && argv[0] != NULL && argv[0][0] != '\0') - progname = argv[0]; - - while ((c = getopt(argc, argv, "v")) != EOF) { - switch (c) { - case 'v': - Py_VerboseFlag++; - break; - default: - usage(); - } - } - - if (optind < argc) { - if (optind+1 < argc) { - oprogname(); - fprintf(stderr, "too many arguments\n"); - usage(); - } - port = atoi(argv[optind]); - if (port <= 0) { - fprintf(stderr, "bad port (%s)\n", argv[optind]); - usage(); - } - } - - main_thread(port); - - fprintf(stderr, "Bye.\n"); - - exit(0); -} - -static char usage_line[] = "usage: %s [port]\n"; - -static void -usage(void) -{ - fprintf(stderr, usage_line, progname); - exit(2); -} - -static void -main_thread(int port) -{ - int sock, conn, size, i; - struct sockaddr_in addr, clientaddr; - - sock = socket(PF_INET, SOCK_STREAM, 0); - if (sock < 0) { - oprogname(); - perror("can't create socket"); - exit(1); - } - -#ifdef SO_REUSEADDR - i = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof i); -#endif - - memset((char *)&addr, '\0', sizeof addr); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - addr.sin_addr.s_addr = 0L; - if (bind(sock, (struct sockaddr *)&addr, sizeof addr) < 0) { - oprogname(); - perror("can't bind socket to address"); - exit(1); - } - - if (listen(sock, 5) < 0) { - oprogname(); - perror("can't listen on socket"); - exit(1); - } - - fprintf(stderr, "Listening on port %d...\n", port); - - for (i = 0; ; i++) { - size = sizeof clientaddr; - memset((char *) &clientaddr, '\0', size); - conn = accept(sock, (struct sockaddr *) &clientaddr, &size); - if (conn < 0) { - oprogname(); - perror("can't accept connection from socket"); - exit(1); - } - - size = sizeof addr; - memset((char *) &addr, '\0', size); - if (getsockname(conn, (struct sockaddr *)&addr, &size) < 0) { - oprogname(); - perror("can't get socket name of connection"); - exit(1); - } - if (clientaddr.sin_addr.s_addr != addr.sin_addr.s_addr) { - oprogname(); - perror("connection from non-local host refused"); - fprintf(stderr, "(addr=%lx, clientaddr=%lx)\n", - ntohl(addr.sin_addr.s_addr), - ntohl(clientaddr.sin_addr.s_addr)); - close(conn); - continue; - } - if (i == 4) { - close(conn); - break; - } - create_thread(conn, &clientaddr); - } - - close(sock); - - if (gtstate) { - PyEval_AcquireThread(gtstate); - gtstate = NULL; - Py_Finalize(); - /* And a second time, just because we can. */ - Py_Finalize(); /* This should be harmless. */ - } - exit(0); -} - -static void -create_thread(int conn, struct sockaddr_in *addr) -{ - struct workorder *work; - pthread_t tdata; - - work = malloc(sizeof(struct workorder)); - if (work == NULL) { - oprogname(); - fprintf(stderr, "out of memory for thread.\n"); - close(conn); - return; - } - work->conn = conn; - work->addr = *addr; - - init_python(); - - if (pthread_create(&tdata, NULL, (void *)service_thread, work) < 0) { - oprogname(); - perror("can't create new thread"); - close(conn); - return; - } - - if (pthread_detach(tdata) < 0) { - oprogname(); - perror("can't detach from thread"); - } -} - -static PyThreadState *the_tstate; -static PyInterpreterState *the_interp; -static PyObject *the_builtins; - -static void -init_python(void) -{ - if (gtstate) - return; - Py_Initialize(); /* Initialize the interpreter */ - PyEval_InitThreads(); /* Create (and acquire) the interpreter lock */ - gtstate = PyEval_SaveThread(); /* Release the thread state */ -} - -static void * -service_thread(struct workorder *work) -{ - FILE *input, *output; - - fprintf(stderr, "Start thread for connection %d.\n", work->conn); - - ps(); - - input = fdopen(work->conn, "r"); - if (input == NULL) { - oprogname(); - perror("can't create input stream"); - goto done; - } - - output = fdopen(work->conn, "w"); - if (output == NULL) { - oprogname(); - perror("can't create output stream"); - fclose(input); - goto done; - } - - setvbuf(input, NULL, _IONBF, 0); - setvbuf(output, NULL, _IONBF, 0); - - run_interpreter(input, output); - - fclose(input); - fclose(output); - - done: - fprintf(stderr, "End thread for connection %d.\n", work->conn); - close(work->conn); - free(work); -} - -static void -oprogname(void) -{ - int save = errno; - fprintf(stderr, "%s: ", progname); - errno = save; -} - -static void -run_interpreter(FILE *input, FILE *output) -{ - PyThreadState *tstate; - PyObject *new_stdin, *new_stdout; - PyObject *mainmod, *globals; - char buffer[1000]; - char *p, *q; - int n, end; - - PyEval_AcquireLock(); - tstate = Py_NewInterpreter(); - if (tstate == NULL) { - fprintf(output, "Sorry -- can't create an interpreter\n"); - return; - } - - mainmod = PyImport_AddModule("__main__"); - globals = PyModule_GetDict(mainmod); - Py_INCREF(globals); - - new_stdin = PyFile_FromFile(input, "", "r", NULL); - new_stdout = PyFile_FromFile(output, "", "w", NULL); - - PySys_SetObject("stdin", new_stdin); - PySys_SetObject("stdout", new_stdout); - PySys_SetObject("stderr", new_stdout); - - for (n = 1; !PyErr_Occurred(); n++) { - Py_BEGIN_ALLOW_THREADS - fprintf(output, "%d> ", n); - p = fgets(buffer, sizeof buffer, input); - Py_END_ALLOW_THREADS - - if (p == NULL) - break; - if (p[0] == '\377' && p[1] == '\354') - break; - - q = strrchr(p, '\r'); - if (q && q[1] == '\n' && q[2] == '\0') { - *q++ = '\n'; - *q++ = '\0'; - } - - while (*p && isspace(*p)) - p++; - if (p[0] == '#' || p[0] == '\0') - continue; - - end = run_command(buffer, globals); - if (end < 0) - PyErr_Print(); - - if (end) - break; - } - - Py_XDECREF(globals); - Py_XDECREF(new_stdin); - Py_XDECREF(new_stdout); - - Py_EndInterpreter(tstate); - PyEval_ReleaseLock(); - - fprintf(output, "Goodbye!\n"); -} - -static int -run_command(char *buffer, PyObject *globals) -{ - PyObject *m, *d, *v; - fprintf(stderr, "run_command: %s", buffer); - if (strchr(buffer, '\n') == NULL) - fprintf(stderr, "\n"); - v = PyRun_String(buffer, Py_single_input, globals, globals); - if (v == NULL) { - if (PyErr_Occurred() == PyExc_SystemExit) { - PyErr_Clear(); - return 1; - } - PyErr_Print(); - return 0; - } - Py_DECREF(v); - return 0; -} - -static void -ps(void) -{ - char buffer[100]; - sprintf(buffer, "ps -l -p %d 1: - raise getopt.error, "Too many arguments." - except getopt.error, msg: - usage(msg) - for o, a in opts: - pass - if args: - try: - port = string.atoi(args[0]) - except ValueError, msg: - usage(msg) - else: - port = PORT - main_thread(port) - -def usage(msg=None): - sys.stdout = sys.stderr - if msg: - print msg - print "\n", __doc__, - sys.exit(2) - -def main_thread(port): - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.bind(("", port)) - sock.listen(5) - print "Listening on port", port, "..." - while 1: - (conn, addr) = sock.accept() - if addr[0] != conn.getsockname()[0]: - conn.close() - print "Refusing connection from non-local host", addr[0], "." - continue - thread.start_new_thread(service_thread, (conn, addr)) - del conn, addr - -def service_thread(conn, addr): - (caddr, cport) = addr - print "Thread %s has connection from %s.\n" % (str(thread.get_ident()), - caddr), - stdin = conn.makefile("r") - stdout = conn.makefile("w", 0) - run_interpreter(stdin, stdout) - print "Thread %s is done.\n" % str(thread.get_ident()), - -def run_interpreter(stdin, stdout): - globals = {} - try: - str(sys.ps1) - except: - sys.ps1 = ">>> " - source = "" - while 1: - stdout.write(sys.ps1) - line = stdin.readline() - if line[:2] == '\377\354': - line = "" - if not line and not source: - break - if line[-2:] == '\r\n': - line = line[:-2] + '\n' - source = source + line - try: - code = compile_command(source) - except SyntaxError, err: - source = "" - traceback.print_exception(SyntaxError, err, None, file=stdout) - continue - if not code: - continue - source = "" - try: - run_command(code, stdin, stdout, globals) - except SystemExit, how: - if how: - try: - how = str(how) - except: - how = "" - stdout.write("Exit %s\n" % how) - break - stdout.write("\nGoodbye.\n") - -def run_command(code, stdin, stdout, globals): - save = sys.stdin, sys.stdout, sys.stderr - try: - sys.stdout = sys.stderr = stdout - sys.stdin = stdin - try: - exec code in globals - except SystemExit, how: - raise SystemExit, how, sys.exc_info()[2] - except: - type, value, tb = sys.exc_info() - if tb: tb = tb.tb_next - traceback.print_exception(type, value, tb) - del tb - finally: - sys.stdin, sys.stdout, sys.stderr = save - -from code import compile_command - -main() diff --git a/Demo/rpc/MANIFEST b/Demo/rpc/MANIFEST deleted file mode 100644 index e65f3ebee8..0000000000 --- a/Demo/rpc/MANIFEST +++ /dev/null @@ -1,10 +0,0 @@ - File Name Archive # Description ------------------------------------------------------------ - MANIFEST 1 This shipping list - README 1 - T.py 1 - mountclient.py 1 - nfsclient.py 1 - rpc.py 1 - test 1 - xdr.py 1 diff --git a/Demo/rpc/README b/Demo/rpc/README deleted file mode 100644 index 8165ce020d..0000000000 --- a/Demo/rpc/README +++ /dev/null @@ -1,25 +0,0 @@ -This is a Python interface to Sun RPC, designed and implemented mostly -by reading the Internet RFCs about the subject. - -*** NOTE: xdr.py has evolved into the standard module xdrlib.py *** - -There are two library modules, xdr.py and rpc.py, and several example -clients: mountclient.py, nfsclient.py, and rnusersclient.py, -implementing the NFS Mount protocol, (part of) the NFS protocol, and -the "rnusers" protocol (used by rusers(1)), respectively. The latter -demonstrates the use of broadcast via the Port mapper's CALLIT -procedure. - -There is also a way to create servers in Python. - -To test the nfs client, run it from the shell with something like this: - - python -c 'import nfsclient; nfsclient.test()' [hostname [filesystemname]] - -When called without a filesystemname, it lists the filesystems at the -host; default host is the local machine. - -Other clients are tested similarly. - -For hostname, use e.g. wuarchive.wustl.edu or gatekeeper.dec.com (two -hosts that are known to export NFS filesystems with little restrictions). diff --git a/Demo/rpc/T.py b/Demo/rpc/T.py deleted file mode 100644 index abf3a06d05..0000000000 --- a/Demo/rpc/T.py +++ /dev/null @@ -1,22 +0,0 @@ -# Simple interface to report execution times of program fragments. -# Call TSTART() to reset the timer, TSTOP(...) to report times. - -import sys, os, time - -def TSTART(): - global t0, t1 - u, s, cu, cs = os.times() - t0 = u+cu, s+cs, time.time() - -def TSTOP(*label): - global t0, t1 - u, s, cu, cs = os.times() - t1 = u+cu, s+cs, time.time() - tt = [] - for i in range(3): - tt.append(t1[i] - t0[i]) - [u, s, r] = tt - msg = '' - for x in label: msg = msg + (x + ' ') - msg = msg + `u` + ' user, ' + `s` + ' sys, ' + `r` + ' real\n' - sys.stderr.write(msg) diff --git a/Demo/rpc/mountclient.py b/Demo/rpc/mountclient.py deleted file mode 100644 index ff66b3d6cc..0000000000 --- a/Demo/rpc/mountclient.py +++ /dev/null @@ -1,201 +0,0 @@ -# Mount RPC client -- RFC 1094 (NFS), Appendix A - -# This module demonstrates how to write your own RPC client in Python. -# Since there is no RPC compiler for Python (yet), you must first -# create classes derived from Packer and Unpacker to handle the data -# types for the server you want to interface to. You then write the -# client class. If you want to support both the TCP and the UDP -# version of a protocol, use multiple inheritance as shown below. - - -import rpc -from rpc import Packer, Unpacker, TCPClient, UDPClient - - -# Program number and version for the mount protocol -MOUNTPROG = 100005 -MOUNTVERS = 1 - -# Size of the 'fhandle' opaque structure -FHSIZE = 32 - - -# Packer derived class for Mount protocol clients. -# The only thing we need to pack beyond basic types is an 'fhandle' - -class MountPacker(Packer): - - def pack_fhandle(self, fhandle): - self.pack_fopaque(FHSIZE, fhandle) - - -# Unpacker derived class for Mount protocol clients. -# The important types we need to unpack are fhandle, fhstatus, -# mountlist and exportlist; mountstruct, exportstruct and groups are -# used to unpack components of mountlist and exportlist and the -# corresponding functions are passed as function argument to the -# generic unpack_list function. - -class MountUnpacker(Unpacker): - - def unpack_fhandle(self): - return self.unpack_fopaque(FHSIZE) - - def unpack_fhstatus(self): - status = self.unpack_uint() - if status == 0: - fh = self.unpack_fhandle() - else: - fh = None - return status, fh - - def unpack_mountlist(self): - return self.unpack_list(self.unpack_mountstruct) - - def unpack_mountstruct(self): - hostname = self.unpack_string() - directory = self.unpack_string() - return (hostname, directory) - - def unpack_exportlist(self): - return self.unpack_list(self.unpack_exportstruct) - - def unpack_exportstruct(self): - filesys = self.unpack_string() - groups = self.unpack_groups() - return (filesys, groups) - - def unpack_groups(self): - return self.unpack_list(self.unpack_string) - - -# These are the procedures specific to the Mount client class. -# Think of this as a derived class of either TCPClient or UDPClient. - -class PartialMountClient: - - # This method is called by Client.__init__ to initialize - # self.packer and self.unpacker - def addpackers(self): - self.packer = MountPacker() - self.unpacker = MountUnpacker('') - - # This method is called by Client.__init__ to bind the socket - # to a particular network interface and port. We use the - # default network interface, but if we're running as root, - # we want to bind to a reserved port - def bindsocket(self): - import os - try: - uid = os.getuid() - except AttributeError: - uid = 1 - if uid == 0: - port = rpc.bindresvport(self.sock, '') - # 'port' is not used - else: - self.sock.bind(('', 0)) - - # This function is called to cough up a suitable - # authentication object for a call to procedure 'proc'. - def mkcred(self): - if self.cred == None: - self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default() - return self.cred - - # The methods Mnt, Dump etc. each implement one Remote - # Procedure Call. This is done by calling self.make_call() - # with as arguments: - # - # - the procedure number - # - the arguments (or None) - # - the "packer" function for the arguments (or None) - # - the "unpacker" function for the return value (or None) - # - # The packer and unpacker function, if not None, *must* be - # methods of self.packer and self.unpacker, respectively. - # A value of None means that there are no arguments or is no - # return value, respectively. - # - # The return value from make_call() is the return value from - # the remote procedure call, as unpacked by the "unpacker" - # function, or None if the unpacker function is None. - # - # (Even if you expect a result of None, you should still - # return the return value from make_call(), since this may be - # needed by a broadcasting version of the class.) - # - # If the call fails, make_call() raises an exception - # (this includes time-outs and invalid results). - # - # Note that (at least with the UDP protocol) there is no - # guarantee that a call is executed at most once. When you do - # get a reply, you know it has been executed at least once; - # when you don't get a reply, you know nothing. - - def Mnt(self, directory): - return self.make_call(1, directory, \ - self.packer.pack_string, \ - self.unpacker.unpack_fhstatus) - - def Dump(self): - return self.make_call(2, None, \ - None, self.unpacker.unpack_mountlist) - - def Umnt(self, directory): - return self.make_call(3, directory, \ - self.packer.pack_string, None) - - def Umntall(self): - return self.make_call(4, None, None, None) - - def Export(self): - return self.make_call(5, None, \ - None, self.unpacker.unpack_exportlist) - - -# We turn the partial Mount client into a full one for either protocol -# by use of multiple inheritance. (In general, when class C has base -# classes B1...Bn, if x is an instance of class C, methods of x are -# searched first in C, then in B1, then in B2, ..., finally in Bn.) - -class TCPMountClient(PartialMountClient, TCPClient): - - def __init__(self, host): - TCPClient.__init__(self, host, MOUNTPROG, MOUNTVERS) - - -class UDPMountClient(PartialMountClient, UDPClient): - - def __init__(self, host): - UDPClient.__init__(self, host, MOUNTPROG, MOUNTVERS) - - -# A little test program for the Mount client. This takes a host as -# command line argument (default the local machine), prints its export -# list, and attempts to mount and unmount each exported files system. -# An optional first argument of -t or -u specifies the protocol to use -# (TCP or UDP), default is UDP. - -def test(): - import sys - if sys.argv[1:] and sys.argv[1] == '-t': - C = TCPMountClient - del sys.argv[1] - elif sys.argv[1:] and sys.argv[1] == '-u': - C = UDPMountClient - del sys.argv[1] - else: - C = UDPMountClient - if sys.argv[1:]: host = sys.argv[1] - else: host = '' - mcl = C(host) - list = mcl.Export() - for item in list: - print item - try: - mcl.Mnt(item[0]) - except: - print 'Sorry' - continue - mcl.Umnt(item[0]) diff --git a/Demo/rpc/nfsclient.py b/Demo/rpc/nfsclient.py deleted file mode 100644 index 37ec46c047..0000000000 --- a/Demo/rpc/nfsclient.py +++ /dev/null @@ -1,201 +0,0 @@ -# NFS RPC client -- RFC 1094 - -# XXX This is not yet complete. -# XXX Only GETATTR, SETTTR, LOOKUP and READDIR are supported. - -# (See mountclient.py for some hints on how to write RPC clients in -# Python in general) - -import rpc -from rpc import UDPClient, TCPClient -from mountclient import FHSIZE, MountPacker, MountUnpacker - -NFS_PROGRAM = 100003 -NFS_VERSION = 2 - -# enum stat -NFS_OK = 0 -# (...many error values...) - -# enum ftype -NFNON = 0 -NFREG = 1 -NFDIR = 2 -NFBLK = 3 -NFCHR = 4 -NFLNK = 5 - - -class NFSPacker(MountPacker): - - def pack_sattrargs(self, sa): - file, attributes = sa - self.pack_fhandle(file) - self.pack_sattr(attributes) - - def pack_sattr(self, sa): - mode, uid, gid, size, atime, mtime = sa - self.pack_uint(mode) - self.pack_uint(uid) - self.pack_uint(gid) - self.pack_uint(size) - self.pack_timeval(atime) - self.pack_timeval(mtime) - - def pack_diropargs(self, da): - dir, name = da - self.pack_fhandle(dir) - self.pack_string(name) - - def pack_readdirargs(self, ra): - dir, cookie, count = ra - self.pack_fhandle(dir) - self.pack_uint(cookie) - self.pack_uint(count) - - def pack_timeval(self, tv): - secs, usecs = tv - self.pack_uint(secs) - self.pack_uint(usecs) - - -class NFSUnpacker(MountUnpacker): - - def unpack_readdirres(self): - status = self.unpack_enum() - if status == NFS_OK: - entries = self.unpack_list(self.unpack_entry) - eof = self.unpack_bool() - rest = (entries, eof) - else: - rest = None - return (status, rest) - - def unpack_entry(self): - fileid = self.unpack_uint() - name = self.unpack_string() - cookie = self.unpack_uint() - return (fileid, name, cookie) - - def unpack_diropres(self): - status = self.unpack_enum() - if status == NFS_OK: - fh = self.unpack_fhandle() - fa = self.unpack_fattr() - rest = (fh, fa) - else: - rest = None - return (status, rest) - - def unpack_attrstat(self): - status = self.unpack_enum() - if status == NFS_OK: - attributes = self.unpack_fattr() - else: - attributes = None - return status, attributes - - def unpack_fattr(self): - type = self.unpack_enum() - mode = self.unpack_uint() - nlink = self.unpack_uint() - uid = self.unpack_uint() - gid = self.unpack_uint() - size = self.unpack_uint() - blocksize = self.unpack_uint() - rdev = self.unpack_uint() - blocks = self.unpack_uint() - fsid = self.unpack_uint() - fileid = self.unpack_uint() - atime = self.unpack_timeval() - mtime = self.unpack_timeval() - ctime = self.unpack_timeval() - return (type, mode, nlink, uid, gid, size, blocksize, \ - rdev, blocks, fsid, fileid, atime, mtime, ctime) - - def unpack_timeval(self): - secs = self.unpack_uint() - usecs = self.unpack_uint() - return (secs, usecs) - - -class NFSClient(UDPClient): - - def __init__(self, host): - UDPClient.__init__(self, host, NFS_PROGRAM, NFS_VERSION) - - def addpackers(self): - self.packer = NFSPacker() - self.unpacker = NFSUnpacker('') - - def mkcred(self): - if self.cred == None: - self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default() - return self.cred - - def Getattr(self, fh): - return self.make_call(1, fh, \ - self.packer.pack_fhandle, \ - self.unpacker.unpack_attrstat) - - def Setattr(self, sa): - return self.make_call(2, sa, \ - self.packer.pack_sattrargs, \ - self.unpacker.unpack_attrstat) - - # Root() is obsolete - - def Lookup(self, da): - return self.make_call(4, da, \ - self.packer.pack_diropargs, \ - self.unpacker.unpack_diropres) - - # ... - - def Readdir(self, ra): - return self.make_call(16, ra, \ - self.packer.pack_readdirargs, \ - self.unpacker.unpack_readdirres) - - # Shorthand to get the entire contents of a directory - def Listdir(self, dir): - list = [] - ra = (dir, 0, 2000) - while 1: - (status, rest) = self.Readdir(ra) - if status <> NFS_OK: - break - entries, eof = rest - last_cookie = None - for fileid, name, cookie in entries: - list.append((fileid, name)) - last_cookie = cookie - if eof or last_cookie == None: - break - ra = (ra[0], last_cookie, ra[2]) - return list - - -def test(): - import sys - if sys.argv[1:]: host = sys.argv[1] - else: host = '' - if sys.argv[2:]: filesys = sys.argv[2] - else: filesys = None - from mountclient import UDPMountClient, TCPMountClient - mcl = TCPMountClient(host) - if filesys == None: - list = mcl.Export() - for item in list: - print item - return - sf = mcl.Mnt(filesys) - print sf - fh = sf[1] - if fh: - ncl = NFSClient(host) - as = ncl.Getattr(fh) - print as - list = ncl.Listdir(fh) - for item in list: print item - mcl.Umnt(filesys) diff --git a/Demo/rpc/rnusersclient.py b/Demo/rpc/rnusersclient.py deleted file mode 100644 index e9cad620fd..0000000000 --- a/Demo/rpc/rnusersclient.py +++ /dev/null @@ -1,98 +0,0 @@ -# Remote nusers client interface - -import rpc -from rpc import Packer, Unpacker, UDPClient, BroadcastUDPClient - - -class RnusersPacker(Packer): - def pack_utmp(self, ui): - ut_line, ut_name, ut_host, ut_time = utmp - self.pack_string(ut_line) - self.pack_string(ut_name) - self.pack_string(ut_host) - self.pack_int(ut_time) - def pack_utmpidle(self, ui): - ui_itmp, ui_idle = ui - self.pack_utmp(ui_utmp) - self.pack_uint(ui_idle) - def pack_utmpidlearr(self, list): - self.pack_array(list, self.pack_itmpidle) - - -class RnusersUnpacker(Unpacker): - def unpack_utmp(self): - ut_line = self.unpack_string() - ut_name = self.unpack_string() - ut_host = self.unpack_string() - ut_time = self.unpack_int() - return ut_line, ut_name, ut_host, ut_time - def unpack_utmpidle(self): - ui_utmp = self.unpack_utmp() - ui_idle = self.unpack_uint() - return ui_utmp, ui_idle - def unpack_utmpidlearr(self): - return self.unpack_array(self.unpack_utmpidle) - - -class PartialRnusersClient: - - def addpackers(self): - self.packer = RnusersPacker() - self.unpacker = RnusersUnpacker('') - - def Num(self): - return self.make_call(1, None, None, self.unpacker.unpack_int) - - def Names(self): - return self.make_call(2, None, \ - None, self.unpacker.unpack_utmpidlearr) - - def Allnames(self): - return self.make_call(3, None, \ - None, self.unpacker.unpack_utmpidlearr) - - -class RnusersClient(PartialRnusersClient, UDPClient): - - def __init__(self, host): - UDPClient.__init__(self, host, 100002, 2) - - -class BroadcastRnusersClient(PartialRnusersClient, BroadcastUDPClient): - - def __init__(self, bcastaddr): - BroadcastUDPClient.__init__(self, bcastaddr, 100002, 2) - - -def test(): - import sys - if not sys.argv[1:]: - testbcast() - return - else: - host = sys.argv[1] - c = RnusersClient(host) - list = c.Names() - for (line, name, host, time), idle in list: - line = strip0(line) - name = strip0(name) - host = strip0(host) - print `name`, `host`, `line`, time, idle - -def testbcast(): - c = BroadcastRnusersClient('') - def listit(list, fromaddr): - host, port = fromaddr - print host + '\t:', - for (line, name, host, time), idle in list: - print strip0(name), - print - c.set_reply_handler(listit) - all = c.Names() - print 'Total Count:', len(all) - -def strip0(s): - while s and s[-1] == '\0': s = s[:-1] - return s - -test() diff --git a/Demo/rpc/rpc.py b/Demo/rpc/rpc.py deleted file mode 100644 index f44b3e4426..0000000000 --- a/Demo/rpc/rpc.py +++ /dev/null @@ -1,891 +0,0 @@ -# Sun RPC version 2 -- RFC1057. - -# XXX There should be separate exceptions for the various reasons why -# XXX an RPC can fail, rather than using RuntimeError for everything - -# XXX The UDP version of the protocol resends requests when it does -# XXX not receive a timely reply -- use only for idempotent calls! - -# XXX There is no provision for call timeout on TCP connections - -import xdr -import socket -import os - -RPCVERSION = 2 - -CALL = 0 -REPLY = 1 - -AUTH_NULL = 0 -AUTH_UNIX = 1 -AUTH_SHORT = 2 -AUTH_DES = 3 - -MSG_ACCEPTED = 0 -MSG_DENIED = 1 - -SUCCESS = 0 # RPC executed successfully -PROG_UNAVAIL = 1 # remote hasn't exported program -PROG_MISMATCH = 2 # remote can't support version # -PROC_UNAVAIL = 3 # program can't support procedure -GARBAGE_ARGS = 4 # procedure can't decode params - -RPC_MISMATCH = 0 # RPC version number != 2 -AUTH_ERROR = 1 # remote can't authenticate caller - -AUTH_BADCRED = 1 # bad credentials (seal broken) -AUTH_REJECTEDCRED = 2 # client must begin new session -AUTH_BADVERF = 3 # bad verifier (seal broken) -AUTH_REJECTEDVERF = 4 # verifier expired or replayed -AUTH_TOOWEAK = 5 # rejected for security reasons - - -class Packer(xdr.Packer): - - def pack_auth(self, auth): - flavor, stuff = auth - self.pack_enum(flavor) - self.pack_opaque(stuff) - - def pack_auth_unix(self, stamp, machinename, uid, gid, gids): - self.pack_uint(stamp) - self.pack_string(machinename) - self.pack_uint(uid) - self.pack_uint(gid) - self.pack_uint(len(gids)) - for i in gids: - self.pack_uint(i) - - def pack_callheader(self, xid, prog, vers, proc, cred, verf): - self.pack_uint(xid) - self.pack_enum(CALL) - self.pack_uint(RPCVERSION) - self.pack_uint(prog) - self.pack_uint(vers) - self.pack_uint(proc) - self.pack_auth(cred) - self.pack_auth(verf) - # Caller must add procedure-specific part of call - - def pack_replyheader(self, xid, verf): - self.pack_uint(xid) - self.pack_enum(REPLY) - self.pack_uint(MSG_ACCEPTED) - self.pack_auth(verf) - self.pack_enum(SUCCESS) - # Caller must add procedure-specific part of reply - - -# Exceptions -BadRPCFormat = 'rpc.BadRPCFormat' -BadRPCVersion = 'rpc.BadRPCVersion' -GarbageArgs = 'rpc.GarbageArgs' - -class Unpacker(xdr.Unpacker): - - def unpack_auth(self): - flavor = self.unpack_enum() - stuff = self.unpack_opaque() - return (flavor, stuff) - - def unpack_callheader(self): - xid = self.unpack_uint(xid) - temp = self.unpack_enum() - if temp <> CALL: - raise BadRPCFormat, 'no CALL but ' + `temp` - temp = self.unpack_uint() - if temp <> RPCVERSION: - raise BadRPCVerspion, 'bad RPC version ' + `temp` - prog = self.unpack_uint() - vers = self.unpack_uint() - proc = self.unpack_uint() - cred = self.unpack_auth() - verf = self.unpack_auth() - return xid, prog, vers, proc, cred, verf - # Caller must add procedure-specific part of call - - def unpack_replyheader(self): - xid = self.unpack_uint() - mtype = self.unpack_enum() - if mtype <> REPLY: - raise RuntimeError, 'no REPLY but ' + `mtype` - stat = self.unpack_enum() - if stat == MSG_DENIED: - stat = self.unpack_enum() - if stat == RPC_MISMATCH: - low = self.unpack_uint() - high = self.unpack_uint() - raise RuntimeError, \ - 'MSG_DENIED: RPC_MISMATCH: ' + `low, high` - if stat == AUTH_ERROR: - stat = self.unpack_uint() - raise RuntimeError, \ - 'MSG_DENIED: AUTH_ERROR: ' + `stat` - raise RuntimeError, 'MSG_DENIED: ' + `stat` - if stat <> MSG_ACCEPTED: - raise RuntimeError, \ - 'Neither MSG_DENIED nor MSG_ACCEPTED: ' + `stat` - verf = self.unpack_auth() - stat = self.unpack_enum() - if stat == PROG_UNAVAIL: - raise RuntimeError, 'call failed: PROG_UNAVAIL' - if stat == PROG_MISMATCH: - low = self.unpack_uint() - high = self.unpack_uint() - raise RuntimeError, \ - 'call failed: PROG_MISMATCH: ' + `low, high` - if stat == PROC_UNAVAIL: - raise RuntimeError, 'call failed: PROC_UNAVAIL' - if stat == GARBAGE_ARGS: - raise RuntimeError, 'call failed: GARBAGE_ARGS' - if stat <> SUCCESS: - raise RuntimeError, 'call failed: ' + `stat` - return xid, verf - # Caller must get procedure-specific part of reply - - -# Subroutines to create opaque authentication objects - -def make_auth_null(): - return '' - -def make_auth_unix(seed, host, uid, gid, groups): - p = Packer() - p.pack_auth_unix(seed, host, uid, gid, groups) - return p.get_buf() - -def make_auth_unix_default(): - try: - from os import getuid, getgid - uid = getuid() - gid = getgid() - except ImportError: - uid = gid = 0 - import time - return make_auth_unix(int(time.time()-unix_epoch()), \ - socket.gethostname(), uid, gid, []) - -_unix_epoch = -1 -def unix_epoch(): - """Very painful calculation of when the Unix Epoch is. - - This is defined as the return value of time.time() on Jan 1st, - 1970, 00:00:00 GMT. - - On a Unix system, this should always return 0.0. On a Mac, the - calculations are needed -- and hard because of integer overflow - and other limitations. - - """ - global _unix_epoch - if _unix_epoch >= 0: return _unix_epoch - import time - now = time.time() - localt = time.localtime(now) # (y, m, d, hh, mm, ss, ..., ..., ...) - gmt = time.gmtime(now) - offset = time.mktime(localt) - time.mktime(gmt) - y, m, d, hh, mm, ss = 1970, 1, 1, 0, 0, 0 - offset, ss = divmod(ss + offset, 60) - offset, mm = divmod(mm + offset, 60) - offset, hh = divmod(hh + offset, 24) - d = d + offset - _unix_epoch = time.mktime((y, m, d, hh, mm, ss, 0, 0, 0)) - print "Unix epoch:", time.ctime(_unix_epoch) - return _unix_epoch - - -# Common base class for clients - -class Client: - - def __init__(self, host, prog, vers, port): - self.host = host - self.prog = prog - self.vers = vers - self.port = port - self.makesocket() # Assigns to self.sock - self.bindsocket() - self.connsocket() - self.lastxid = 0 # XXX should be more random? - self.addpackers() - self.cred = None - self.verf = None - - def close(self): - self.sock.close() - - def makesocket(self): - # This MUST be overridden - raise RuntimeError, 'makesocket not defined' - - def connsocket(self): - # Override this if you don't want/need a connection - self.sock.connect((self.host, self.port)) - - def bindsocket(self): - # Override this to bind to a different port (e.g. reserved) - self.sock.bind(('', 0)) - - def addpackers(self): - # Override this to use derived classes from Packer/Unpacker - self.packer = Packer() - self.unpacker = Unpacker('') - - def make_call(self, proc, args, pack_func, unpack_func): - # Don't normally override this (but see Broadcast) - if pack_func is None and args is not None: - raise TypeError, 'non-null args with null pack_func' - self.start_call(proc) - if pack_func: - pack_func(args) - self.do_call() - if unpack_func: - result = unpack_func() - else: - result = None - self.unpacker.done() - return result - - def start_call(self, proc): - # Don't override this - self.lastxid = xid = self.lastxid + 1 - cred = self.mkcred() - verf = self.mkverf() - p = self.packer - p.reset() - p.pack_callheader(xid, self.prog, self.vers, proc, cred, verf) - - def do_call(self): - # This MUST be overridden - raise RuntimeError, 'do_call not defined' - - def mkcred(self): - # Override this to use more powerful credentials - if self.cred == None: - self.cred = (AUTH_NULL, make_auth_null()) - return self.cred - - def mkverf(self): - # Override this to use a more powerful verifier - if self.verf == None: - self.verf = (AUTH_NULL, make_auth_null()) - return self.verf - - def call_0(self): # Procedure 0 is always like this - return self.make_call(0, None, None, None) - - -# Record-Marking standard support - -def sendfrag(sock, last, frag): - x = len(frag) - if last: x = x | 0x80000000L - header = (chr(int(x>>24 & 0xff)) + chr(int(x>>16 & 0xff)) + \ - chr(int(x>>8 & 0xff)) + chr(int(x & 0xff))) - sock.send(header + frag) - -def sendrecord(sock, record): - sendfrag(sock, 1, record) - -def recvfrag(sock): - header = sock.recv(4) - if len(header) < 4: - raise EOFError - x = long(ord(header[0]))<<24 | ord(header[1])<<16 | \ - ord(header[2])<<8 | ord(header[3]) - last = ((x & 0x80000000) != 0) - n = int(x & 0x7fffffff) - frag = '' - while n > 0: - buf = sock.recv(n) - if not buf: raise EOFError - n = n - len(buf) - frag = frag + buf - return last, frag - -def recvrecord(sock): - record = '' - last = 0 - while not last: - last, frag = recvfrag(sock) - record = record + frag - return record - - -# Try to bind to a reserved port (must be root) - -last_resv_port_tried = None -def bindresvport(sock, host): - global last_resv_port_tried - FIRST, LAST = 600, 1024 # Range of ports to try - if last_resv_port_tried == None: - import os - last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST) - for i in range(last_resv_port_tried, LAST) + \ - range(FIRST, last_resv_port_tried): - last_resv_port_tried = i - try: - sock.bind((host, i)) - return last_resv_port_tried - except socket.error, (errno, msg): - if errno <> 114: - raise socket.error, (errno, msg) - raise RuntimeError, 'can\'t assign reserved port' - - -# Client using TCP to a specific port - -class RawTCPClient(Client): - - def makesocket(self): - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - - def do_call(self): - call = self.packer.get_buf() - sendrecord(self.sock, call) - reply = recvrecord(self.sock) - u = self.unpacker - u.reset(reply) - xid, verf = u.unpack_replyheader() - if xid <> self.lastxid: - # Can't really happen since this is TCP... - raise RuntimeError, 'wrong xid in reply ' + `xid` + \ - ' instead of ' + `self.lastxid` - - -# Client using UDP to a specific port - -class RawUDPClient(Client): - - def makesocket(self): - self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - - def do_call(self): - call = self.packer.get_buf() - self.sock.send(call) - try: - from select import select - except ImportError: - print 'WARNING: select not found, RPC may hang' - select = None - BUFSIZE = 8192 # Max UDP buffer size - timeout = 1 - count = 5 - while 1: - r, w, x = [self.sock], [], [] - if select: - r, w, x = select(r, w, x, timeout) - if self.sock not in r: - count = count - 1 - if count < 0: raise RuntimeError, 'timeout' - if timeout < 25: timeout = timeout *2 -## print 'RESEND', timeout, count - self.sock.send(call) - continue - reply = self.sock.recv(BUFSIZE) - u = self.unpacker - u.reset(reply) - xid, verf = u.unpack_replyheader() - if xid <> self.lastxid: -## print 'BAD xid' - continue - break - - -# Client using UDP broadcast to a specific port - -class RawBroadcastUDPClient(RawUDPClient): - - def __init__(self, bcastaddr, prog, vers, port): - RawUDPClient.__init__(self, bcastaddr, prog, vers, port) - self.reply_handler = None - self.timeout = 30 - - def connsocket(self): - # Don't connect -- use sendto - self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - - def set_reply_handler(self, reply_handler): - self.reply_handler = reply_handler - - def set_timeout(self, timeout): - self.timeout = timeout # Use None for infinite timeout - - def make_call(self, proc, args, pack_func, unpack_func): - if pack_func is None and args is not None: - raise TypeError, 'non-null args with null pack_func' - self.start_call(proc) - if pack_func: - pack_func(args) - call = self.packer.get_buf() - self.sock.sendto(call, (self.host, self.port)) - try: - from select import select - except ImportError: - print 'WARNING: select not found, broadcast will hang' - select = None - BUFSIZE = 8192 # Max UDP buffer size (for reply) - replies = [] - if unpack_func is None: - def dummy(): pass - unpack_func = dummy - while 1: - r, w, x = [self.sock], [], [] - if select: - if self.timeout is None: - r, w, x = select(r, w, x) - else: - r, w, x = select(r, w, x, self.timeout) - if self.sock not in r: - break - reply, fromaddr = self.sock.recvfrom(BUFSIZE) - u = self.unpacker - u.reset(reply) - xid, verf = u.unpack_replyheader() - if xid <> self.lastxid: -## print 'BAD xid' - continue - reply = unpack_func() - self.unpacker.done() - replies.append((reply, fromaddr)) - if self.reply_handler: - self.reply_handler(reply, fromaddr) - return replies - - -# Port mapper interface - -# Program number, version and (fixed!) port number -PMAP_PROG = 100000 -PMAP_VERS = 2 -PMAP_PORT = 111 - -# Procedure numbers -PMAPPROC_NULL = 0 # (void) -> void -PMAPPROC_SET = 1 # (mapping) -> bool -PMAPPROC_UNSET = 2 # (mapping) -> bool -PMAPPROC_GETPORT = 3 # (mapping) -> unsigned int -PMAPPROC_DUMP = 4 # (void) -> pmaplist -PMAPPROC_CALLIT = 5 # (call_args) -> call_result - -# A mapping is (prog, vers, prot, port) and prot is one of: - -IPPROTO_TCP = 6 -IPPROTO_UDP = 17 - -# A pmaplist is a variable-length list of mappings, as follows: -# either (1, mapping, pmaplist) or (0). - -# A call_args is (prog, vers, proc, args) where args is opaque; -# a call_result is (port, res) where res is opaque. - - -class PortMapperPacker(Packer): - - def pack_mapping(self, mapping): - prog, vers, prot, port = mapping - self.pack_uint(prog) - self.pack_uint(vers) - self.pack_uint(prot) - self.pack_uint(port) - - def pack_pmaplist(self, list): - self.pack_list(list, self.pack_mapping) - - def pack_call_args(self, ca): - prog, vers, proc, args = ca - self.pack_uint(prog) - self.pack_uint(vers) - self.pack_uint(proc) - self.pack_opaque(args) - - -class PortMapperUnpacker(Unpacker): - - def unpack_mapping(self): - prog = self.unpack_uint() - vers = self.unpack_uint() - prot = self.unpack_uint() - port = self.unpack_uint() - return prog, vers, prot, port - - def unpack_pmaplist(self): - return self.unpack_list(self.unpack_mapping) - - def unpack_call_result(self): - port = self.unpack_uint() - res = self.unpack_opaque() - return port, res - - -class PartialPortMapperClient: - - def addpackers(self): - self.packer = PortMapperPacker() - self.unpacker = PortMapperUnpacker('') - - def Set(self, mapping): - return self.make_call(PMAPPROC_SET, mapping, \ - self.packer.pack_mapping, \ - self.unpacker.unpack_uint) - - def Unset(self, mapping): - return self.make_call(PMAPPROC_UNSET, mapping, \ - self.packer.pack_mapping, \ - self.unpacker.unpack_uint) - - def Getport(self, mapping): - return self.make_call(PMAPPROC_GETPORT, mapping, \ - self.packer.pack_mapping, \ - self.unpacker.unpack_uint) - - def Dump(self): - return self.make_call(PMAPPROC_DUMP, None, \ - None, \ - self.unpacker.unpack_pmaplist) - - def Callit(self, ca): - return self.make_call(PMAPPROC_CALLIT, ca, \ - self.packer.pack_call_args, \ - self.unpacker.unpack_call_result) - - -class TCPPortMapperClient(PartialPortMapperClient, RawTCPClient): - - def __init__(self, host): - RawTCPClient.__init__(self, \ - host, PMAP_PROG, PMAP_VERS, PMAP_PORT) - - -class UDPPortMapperClient(PartialPortMapperClient, RawUDPClient): - - def __init__(self, host): - RawUDPClient.__init__(self, \ - host, PMAP_PROG, PMAP_VERS, PMAP_PORT) - - -class BroadcastUDPPortMapperClient(PartialPortMapperClient, \ - RawBroadcastUDPClient): - - def __init__(self, bcastaddr): - RawBroadcastUDPClient.__init__(self, \ - bcastaddr, PMAP_PROG, PMAP_VERS, PMAP_PORT) - - -# Generic clients that find their server through the Port mapper - -class TCPClient(RawTCPClient): - - def __init__(self, host, prog, vers): - pmap = TCPPortMapperClient(host) - port = pmap.Getport((prog, vers, IPPROTO_TCP, 0)) - pmap.close() - if port == 0: - raise RuntimeError, 'program not registered' - RawTCPClient.__init__(self, host, prog, vers, port) - - -class UDPClient(RawUDPClient): - - def __init__(self, host, prog, vers): - pmap = UDPPortMapperClient(host) - port = pmap.Getport((prog, vers, IPPROTO_UDP, 0)) - pmap.close() - if port == 0: - raise RuntimeError, 'program not registered' - RawUDPClient.__init__(self, host, prog, vers, port) - - -class BroadcastUDPClient(Client): - - def __init__(self, bcastaddr, prog, vers): - self.pmap = BroadcastUDPPortMapperClient(bcastaddr) - self.pmap.set_reply_handler(self.my_reply_handler) - self.prog = prog - self.vers = vers - self.user_reply_handler = None - self.addpackers() - - def close(self): - self.pmap.close() - - def set_reply_handler(self, reply_handler): - self.user_reply_handler = reply_handler - - def set_timeout(self, timeout): - self.pmap.set_timeout(timeout) - - def my_reply_handler(self, reply, fromaddr): - port, res = reply - self.unpacker.reset(res) - result = self.unpack_func() - self.unpacker.done() - self.replies.append((result, fromaddr)) - if self.user_reply_handler is not None: - self.user_reply_handler(result, fromaddr) - - def make_call(self, proc, args, pack_func, unpack_func): - self.packer.reset() - if pack_func: - pack_func(args) - if unpack_func is None: - def dummy(): pass - self.unpack_func = dummy - else: - self.unpack_func = unpack_func - self.replies = [] - packed_args = self.packer.get_buf() - dummy_replies = self.pmap.Callit( \ - (self.prog, self.vers, proc, packed_args)) - return self.replies - - -# Server classes - -# These are not symmetric to the Client classes -# XXX No attempt is made to provide authorization hooks yet - -class Server: - - def __init__(self, host, prog, vers, port): - self.host = host # Should normally be '' for default interface - self.prog = prog - self.vers = vers - self.port = port # Should normally be 0 for random port - self.makesocket() # Assigns to self.sock and self.prot - self.bindsocket() - self.host, self.port = self.sock.getsockname() - self.addpackers() - - def register(self): - mapping = self.prog, self.vers, self.prot, self.port - p = TCPPortMapperClient(self.host) - if not p.Set(mapping): - raise RuntimeError, 'register failed' - - def unregister(self): - mapping = self.prog, self.vers, self.prot, self.port - p = TCPPortMapperClient(self.host) - if not p.Unset(mapping): - raise RuntimeError, 'unregister failed' - - def handle(self, call): - # Don't use unpack_header but parse the header piecewise - # XXX I have no idea if I am using the right error responses! - self.unpacker.reset(call) - self.packer.reset() - xid = self.unpacker.unpack_uint() - self.packer.pack_uint(xid) - temp = self.unpacker.unpack_enum() - if temp <> CALL: - return None # Not worthy of a reply - self.packer.pack_uint(REPLY) - temp = self.unpacker.unpack_uint() - if temp <> RPCVERSION: - self.packer.pack_uint(MSG_DENIED) - self.packer.pack_uint(RPC_MISMATCH) - self.packer.pack_uint(RPCVERSION) - self.packer.pack_uint(RPCVERSION) - return self.packer.get_buf() - self.packer.pack_uint(MSG_ACCEPTED) - self.packer.pack_auth((AUTH_NULL, make_auth_null())) - prog = self.unpacker.unpack_uint() - if prog <> self.prog: - self.packer.pack_uint(PROG_UNAVAIL) - return self.packer.get_buf() - vers = self.unpacker.unpack_uint() - if vers <> self.vers: - self.packer.pack_uint(PROG_MISMATCH) - self.packer.pack_uint(self.vers) - self.packer.pack_uint(self.vers) - return self.packer.get_buf() - proc = self.unpacker.unpack_uint() - methname = 'handle_' + `proc` - try: - meth = getattr(self, methname) - except AttributeError: - self.packer.pack_uint(PROC_UNAVAIL) - return self.packer.get_buf() - cred = self.unpacker.unpack_auth() - verf = self.unpacker.unpack_auth() - try: - meth() # Unpack args, call turn_around(), pack reply - except (EOFError, GarbageArgs): - # Too few or too many arguments - self.packer.reset() - self.packer.pack_uint(xid) - self.packer.pack_uint(REPLY) - self.packer.pack_uint(MSG_ACCEPTED) - self.packer.pack_auth((AUTH_NULL, make_auth_null())) - self.packer.pack_uint(GARBAGE_ARGS) - return self.packer.get_buf() - - def turn_around(self): - try: - self.unpacker.done() - except RuntimeError: - raise GarbageArgs - self.packer.pack_uint(SUCCESS) - - def handle_0(self): # Handle NULL message - self.turn_around() - - def makesocket(self): - # This MUST be overridden - raise RuntimeError, 'makesocket not defined' - - def bindsocket(self): - # Override this to bind to a different port (e.g. reserved) - self.sock.bind((self.host, self.port)) - - def addpackers(self): - # Override this to use derived classes from Packer/Unpacker - self.packer = Packer() - self.unpacker = Unpacker('') - - -class TCPServer(Server): - - def makesocket(self): - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.prot = IPPROTO_TCP - - def loop(self): - self.sock.listen(0) - while 1: - self.session(self.sock.accept()) - - def session(self, connection): - sock, (host, port) = connection - while 1: - try: - call = recvrecord(sock) - except EOFError: - break - except socket.error, msg: - print 'socket error:', msg - break - reply = self.handle(call) - if reply is not None: - sendrecord(sock, reply) - - def forkingloop(self): - # Like loop but uses forksession() - self.sock.listen(0) - while 1: - self.forksession(self.sock.accept()) - - def forksession(self, connection): - # Like session but forks off a subprocess - import os - # Wait for deceased children - try: - while 1: - pid, sts = os.waitpid(0, 1) - except os.error: - pass - pid = None - try: - pid = os.fork() - if pid: # Parent - connection[0].close() - return - # Child - self.session(connection) - finally: - # Make sure we don't fall through in the parent - if pid == 0: - os._exit(0) - - -class UDPServer(Server): - - def makesocket(self): - self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - self.prot = IPPROTO_UDP - - def loop(self): - while 1: - self.session() - - def session(self): - call, host_port = self.sock.recvfrom(8192) - reply = self.handle(call) - if reply <> None: - self.sock.sendto(reply, host_port) - - -# Simple test program -- dump local portmapper status - -def test(): - pmap = UDPPortMapperClient('') - list = pmap.Dump() - list.sort() - for prog, vers, prot, port in list: - print prog, vers, - if prot == IPPROTO_TCP: print 'tcp', - elif prot == IPPROTO_UDP: print 'udp', - else: print prot, - print port - - -# Test program for broadcast operation -- dump everybody's portmapper status - -def testbcast(): - import sys - if sys.argv[1:]: - bcastaddr = sys.argv[1] - else: - bcastaddr = '' - def rh(reply, fromaddr): - host, port = fromaddr - print host + '\t' + `reply` - pmap = BroadcastUDPPortMapperClient(bcastaddr) - pmap.set_reply_handler(rh) - pmap.set_timeout(5) - replies = pmap.Getport((100002, 1, IPPROTO_UDP, 0)) - - -# Test program for server, with corresponding client -# On machine A: python -c 'import rpc; rpc.testsvr()' -# On machine B: python -c 'import rpc; rpc.testclt()' A -# (A may be == B) - -def testsvr(): - # Simple test class -- proc 1 doubles its string argument as reply - class S(UDPServer): - def handle_1(self): - arg = self.unpacker.unpack_string() - self.turn_around() - print 'RPC function 1 called, arg', `arg` - self.packer.pack_string(arg + arg) - # - s = S('', 0x20000000, 1, 0) - try: - s.unregister() - except RuntimeError, msg: - print 'RuntimeError:', msg, '(ignored)' - s.register() - print 'Service started...' - try: - s.loop() - finally: - s.unregister() - print 'Service interrupted.' - - -def testclt(): - import sys - if sys.argv[1:]: host = sys.argv[1] - else: host = '' - # Client for above server - class C(UDPClient): - def call_1(self, arg): - return self.make_call(1, arg, \ - self.packer.pack_string, \ - self.unpacker.unpack_string) - c = C(host, 0x20000000, 1) - print 'making call...' - reply = c.call_1('hello, world, ') - print 'call returned', `reply` diff --git a/Demo/rpc/test b/Demo/rpc/test deleted file mode 100755 index ba220f24a2..0000000000 --- a/Demo/rpc/test +++ /dev/null @@ -1,24 +0,0 @@ -: ${PYTHON=python} -: ${SERVER=charon.cwi.nl} - -set -xe - -$PYTHON -c 'from rpc import test; test()' -$PYTHON -c 'from rpc import test; test()' ${SERVER} - -$PYTHON -c 'from rpc import testsvr; testsvr()' & -PID=$! -sleep 2 -$PYTHON -c 'from rpc import testclt; testclt()' -kill -2 $PID - -$PYTHON -c 'from mountclient import test; test()' -$PYTHON -c 'from mountclient import test; test()' gatekeeper.dec.com - -$PYTHON -c 'from nfsclient import test; test()' -$PYTHON -c 'from nfsclient import test; test()' gatekeeper.dec.com -$PYTHON -c 'from nfsclient import test; test()' gatekeeper.dec.com /archive - -$PYTHON -c 'from rnusersclient import test; test()' '' - -$PYTHON -c 'from rpc import testbcast; testbcast()' diff --git a/Demo/rpc/xdr.py b/Demo/rpc/xdr.py deleted file mode 100644 index 41c970ae91..0000000000 --- a/Demo/rpc/xdr.py +++ /dev/null @@ -1,201 +0,0 @@ -# Implement (a subset of) Sun XDR -- RFC1014. - - -try: - import struct -except ImportError: - struct = None - - -Long = type(0L) - - -class Packer: - - def __init__(self): - self.reset() - - def reset(self): - self.buf = '' - - def get_buf(self): - return self.buf - - def pack_uint(self, x): - self.buf = self.buf + \ - (chr(int(x>>24 & 0xff)) + chr(int(x>>16 & 0xff)) + \ - chr(int(x>>8 & 0xff)) + chr(int(x & 0xff))) - if struct and struct.pack('l', 1) == '\0\0\0\1': - def pack_uint(self, x): - if type(x) == Long: - x = int((x + 0x80000000L) % 0x100000000L \ - - 0x80000000L) - self.buf = self.buf + struct.pack('l', x) - - pack_int = pack_uint - - pack_enum = pack_int - - def pack_bool(self, x): - if x: self.buf = self.buf + '\0\0\0\1' - else: self.buf = self.buf + '\0\0\0\0' - - def pack_uhyper(self, x): - self.pack_uint(int(x>>32 & 0xffffffff)) - self.pack_uint(int(x & 0xffffffff)) - - pack_hyper = pack_uhyper - - def pack_float(self, x): - # XXX - self.buf = self.buf + struct.pack('f', x) - - def pack_double(self, x): - # XXX - self.buf = self.buf + struct.pack('d', x) - - def pack_fstring(self, n, s): - if n < 0: - raise ValueError, 'fstring size must be nonnegative' - n = ((n+3)/4)*4 - data = s[:n] - data = data + (n - len(data)) * '\0' - self.buf = self.buf + data - - pack_fopaque = pack_fstring - - def pack_string(self, s): - n = len(s) - self.pack_uint(n) - self.pack_fstring(n, s) - - pack_opaque = pack_string - - def pack_list(self, list, pack_item): - for item in list: - self.pack_uint(1) - pack_item(item) - self.pack_uint(0) - - def pack_farray(self, n, list, pack_item): - if len(list) <> n: - raise ValueError, 'wrong array size' - for item in list: - pack_item(item) - - def pack_array(self, list, pack_item): - n = len(list) - self.pack_uint(n) - self.pack_farray(n, list, pack_item) - - -class Unpacker: - - def __init__(self, data): - self.reset(data) - - def reset(self, data): - self.buf = data - self.pos = 0 - - def done(self): - if self.pos < len(self.buf): - raise RuntimeError, 'unextracted data remains' - - def unpack_uint(self): - i = self.pos - self.pos = j = i+4 - data = self.buf[i:j] - if len(data) < 4: - raise EOFError - x = long(ord(data[0]))<<24 | ord(data[1])<<16 | \ - ord(data[2])<<8 | ord(data[3]) - # Return a Python long only if the value is not representable - # as a nonnegative Python int - if x < 0x80000000L: x = int(x) - return x - if struct and struct.unpack('l', '\0\0\0\1') == 1: - def unpack_uint(self): - i = self.pos - self.pos = j = i+4 - data = self.buf[i:j] - if len(data) < 4: - raise EOFError - return struct.unpack('l', data) - - def unpack_int(self): - x = self.unpack_uint() - if x >= 0x80000000L: x = x - 0x100000000L - return int(x) - - unpack_enum = unpack_int - - unpack_bool = unpack_int - - def unpack_uhyper(self): - hi = self.unpack_uint() - lo = self.unpack_uint() - return long(hi)<<32 | lo - - def unpack_hyper(self): - x = self.unpack_uhyper() - if x >= 0x8000000000000000L: x = x - 0x10000000000000000L - return x - - def unpack_float(self): - # XXX - i = self.pos - self.pos = j = i+4 - data = self.buf[i:j] - if len(data) < 4: - raise EOFError - return struct.unpack('f', data)[0] - - def unpack_double(self): - # XXX - i = self.pos - self.pos = j = i+8 - data = self.buf[i:j] - if len(data) < 8: - raise EOFError - return struct.unpack('d', data)[0] - - def unpack_fstring(self, n): - if n < 0: - raise ValueError, 'fstring size must be nonnegative' - i = self.pos - j = i + (n+3)/4*4 - if j > len(self.buf): - raise EOFError - self.pos = j - return self.buf[i:i+n] - - unpack_fopaque = unpack_fstring - - def unpack_string(self): - n = self.unpack_uint() - return self.unpack_fstring(n) - - unpack_opaque = unpack_string - - def unpack_list(self, unpack_item): - list = [] - while 1: - x = self.unpack_uint() - if x == 0: break - if x <> 1: - raise RuntimeError, \ - '0 or 1 expected, got ' + `x` - item = unpack_item() - list.append(item) - return list - - def unpack_farray(self, n, unpack_item): - list = [] - for i in range(n): - list.append(unpack_item()) - return list - - def unpack_array(self, unpack_item): - n = self.unpack_uint() - return self.unpack_farray(n, unpack_item) diff --git a/Demo/scripts/README b/Demo/scripts/README deleted file mode 100644 index 6bc66b6eda..0000000000 --- a/Demo/scripts/README +++ /dev/null @@ -1,18 +0,0 @@ -This directory contains a collection of executable Python scripts. - -See also the Tools/scripts directory! - -fact.py Factorize numbers -from.py Summarize mailbox -ftpstats.py Summarize ftp daemon log file -lpwatch.py Watch BSD line printer queues -markov.py Markov chain simulation of words or characters -mboxconvvert.py Convert MH or MMDF mailboxes to unix mailbox format -morse.py Produce morse code (audible or on AIFF file) -mpzpi.py test mpz -- print digits of pi (compare pi.py) -pi.py Print all digits of pi -- given enough time and memory -pp.py Emulate some Perl command line options -primes.py Print prime numbers -script.py Equivalent to BSD script(1) -- by Steen Lumholt -unbirthday.py Print unbirthday count -update.py Update a bunch of files according to a script. diff --git a/Demo/scripts/beer.py b/Demo/scripts/beer.py deleted file mode 100644 index 1b9ac8bade..0000000000 --- a/Demo/scripts/beer.py +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env python -# By GvR, demystified after a version by Fredrik Lundh. -import sys -n = 100 -if sys.argv[1:]: n = int(sys.argv[1]) -def bottle(n): - if n == 0: return "no more bottles of beer" - if n == 1: return "one bottle of beer" - return str(n) + " bottles of beer" -for i in range(n): - print bottle(n-i), "on the wall," - print bottle(n-i) + "." - print "Take one down, pass it around," - print bottle(n-i-1), "on the wall." diff --git a/Demo/scripts/eqfix.py b/Demo/scripts/eqfix.py deleted file mode 100755 index 583d54e0e7..0000000000 --- a/Demo/scripts/eqfix.py +++ /dev/null @@ -1,199 +0,0 @@ -#! /usr/bin/env python - -# Fix Python source files to use the new equality test operator, i.e., -# if x = y: ... -# is changed to -# if x == y: ... -# The script correctly tokenizes the Python program to reliably -# distinguish between assignments and equality tests. -# -# Command line arguments are files or directories to be processed. -# Directories are searched recursively for files whose name looks -# like a python module. -# Symbolic links are always ignored (except as explicit directory -# arguments). Of course, the original file is kept as a back-up -# (with a "~" attached to its name). -# It complains about binaries (files containing null bytes) -# and about files that are ostensibly not Python files: if the first -# line starts with '#!' and does not contain the string 'python'. -# -# Changes made are reported to stdout in a diff-like format. -# -# Undoubtedly you can do this using find and sed or perl, but this is -# a nice example of Python code that recurses down a directory tree -# and uses regular expressions. Also note several subtleties like -# preserving the file's mode and avoiding to even write a temp file -# when no changes are needed for a file. -# -# NB: by changing only the function fixline() you can turn this -# into a program for a different change to Python programs... - -import sys -import regex -import os -from stat import * -import string - -err = sys.stderr.write -dbg = err -rep = sys.stdout.write - -def main(): - bad = 0 - if not sys.argv[1:]: # No arguments - err('usage: ' + sys.argv[0] + ' file-or-directory ...\n') - sys.exit(2) - for arg in sys.argv[1:]: - if os.path.isdir(arg): - if recursedown(arg): bad = 1 - elif os.path.islink(arg): - err(arg + ': will not process symbolic links\n') - bad = 1 - else: - if fix(arg): bad = 1 - sys.exit(bad) - -ispythonprog = regex.compile('^[a-zA-Z0-9_]+\.py$') -def ispython(name): - return ispythonprog.match(name) >= 0 - -def recursedown(dirname): - dbg('recursedown(' + `dirname` + ')\n') - bad = 0 - try: - names = os.listdir(dirname) - except os.error, msg: - err(dirname + ': cannot list directory: ' + `msg` + '\n') - return 1 - names.sort() - subdirs = [] - for name in names: - if name in (os.curdir, os.pardir): continue - fullname = os.path.join(dirname, name) - if os.path.islink(fullname): pass - elif os.path.isdir(fullname): - subdirs.append(fullname) - elif ispython(name): - if fix(fullname): bad = 1 - for fullname in subdirs: - if recursedown(fullname): bad = 1 - return bad - -def fix(filename): -## dbg('fix(' + `filename` + ')\n') - try: - f = open(filename, 'r') - except IOError, msg: - err(filename + ': cannot open: ' + `msg` + '\n') - return 1 - head, tail = os.path.split(filename) - tempname = os.path.join(head, '@' + tail) - g = None - # If we find a match, we rewind the file and start over but - # now copy everything to a temp file. - lineno = 0 - while 1: - line = f.readline() - if not line: break - lineno = lineno + 1 - if g is None and '\0' in line: - # Check for binary files - err(filename + ': contains null bytes; not fixed\n') - f.close() - return 1 - if lineno == 1 and g is None and line[:2] == '#!': - # Check for non-Python scripts - words = string.split(line[2:]) - if words and regex.search('[pP]ython', words[0]) < 0: - msg = filename + ': ' + words[0] - msg = msg + ' script; not fixed\n' - err(msg) - f.close() - return 1 - while line[-2:] == '\\\n': - nextline = f.readline() - if not nextline: break - line = line + nextline - lineno = lineno + 1 - newline = fixline(line) - if newline != line: - if g is None: - try: - g = open(tempname, 'w') - except IOError, msg: - f.close() - err(tempname+': cannot create: '+\ - `msg`+'\n') - return 1 - f.seek(0) - lineno = 0 - rep(filename + ':\n') - continue # restart from the beginning - rep(`lineno` + '\n') - rep('< ' + line) - rep('> ' + newline) - if g is not None: - g.write(newline) - - # End of file - f.close() - if not g: return 0 # No changes - - # Finishing touch -- move files - - # First copy the file's mode to the temp file - try: - statbuf = os.stat(filename) - os.chmod(tempname, statbuf[ST_MODE] & 07777) - except os.error, msg: - err(tempname + ': warning: chmod failed (' + `msg` + ')\n') - # Then make a backup of the original file as filename~ - try: - os.rename(filename, filename + '~') - except os.error, msg: - err(filename + ': warning: backup failed (' + `msg` + ')\n') - # Now move the temp file to the original file - try: - os.rename(tempname, filename) - except os.error, msg: - err(filename + ': rename failed (' + `msg` + ')\n') - return 1 - # Return succes - return 0 - - -from tokenize import tokenprog - -match = {'if':':', 'elif':':', 'while':':', 'return':'\n', \ - '(':')', '[':']', '{':'}', '`':'`'} - -def fixline(line): - # Quick check for easy case - if '=' not in line: return line - - i, n = 0, len(line) - stack = [] - while i < n: - j = tokenprog.match(line, i) - if j < 0: - # A bad token; forget about the rest of this line - print '(Syntax error:)' - print line, - return line - a, b = tokenprog.regs[3] # Location of the token proper - token = line[a:b] - i = i+j - if stack and token == stack[-1]: - del stack[-1] - elif match.has_key(token): - stack.append(match[token]) - elif token == '=' and stack: - line = line[:a] + '==' + line[b:] - i, n = a + len('=='), len(line) - elif token == '==' and not stack: - print '(Warning: \'==\' at top level:)' - print line, - return line - - -main() diff --git a/Demo/scripts/fact.py b/Demo/scripts/fact.py deleted file mode 100755 index 6cc389ea6f..0000000000 --- a/Demo/scripts/fact.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python - -# Factorize numbers. -# The algorithm is not efficient, but easy to understand. -# If there are large factors, it will take forever to find them, -# because we try all odd numbers between 3 and sqrt(n)... - -import sys -from math import sqrt - -error = 'fact.error' # exception - -def fact(n): - if n < 1: raise error # fact() argument should be >= 1 - if n == 1: return [] # special case - res = [] - # Treat even factors special, so we can use i = i+2 later - while n%2 == 0: - res.append(2) - n = n/2 - # Try odd numbers up to sqrt(n) - limit = sqrt(float(n+1)) - i = 3 - while i <= limit: - if n%i == 0: - res.append(i) - n = n/i - limit = sqrt(n+1) - else: - i = i+2 - if n != 1: - res.append(n) - return res - -def main(): - if len(sys.argv) > 1: - for arg in sys.argv[1:]: - n = eval(arg) - print n, fact(n) - else: - try: - while 1: - n = input() - print n, fact(n) - except EOFError: - pass - -main() diff --git a/Demo/scripts/freeze.py b/Demo/scripts/freeze.py deleted file mode 100755 index be6d263584..0000000000 --- a/Demo/scripts/freeze.py +++ /dev/null @@ -1,480 +0,0 @@ -#! /usr/local/bin/python - -# Given a Python script, create a binary that runs the script. -# The binary is 100% independent of Python libraries and binaries. -# It will not contain any Python source code -- only "compiled" Python -# (as initialized static variables containing marshalled code objects). -# It even does the right thing for dynamically loaded modules! -# The module search path of the binary is set to the current directory. -# -# Some problems remain: -# - It's highly non-portable, since it knows about paths and libraries -# (there's a customization section though, and it knows how to -# distinguish an SGI from a Sun SPARC system -- adding knowledge -# about more systems is left as an exercise for the reader). -# - You need to have the Python source tree lying around as well as -# the "libpython.a" used to generate the Python binary. -# - For scripts that use many modules it generates absurdly large -# files (frozen.c and config.o as well as the final binary), -# and is consequently rather slow. -# -# Caveats: -# - The search for modules sometimes finds modules that are never -# actually imported since the code importing them is never executed. -# - If an imported module isn't found, you get a warning but the -# process of freezing continues. The binary will fail if it -# actually tries to import one of these modules. -# - This often happens with the module 'mac', which module 'os' tries -# to import (to determine whether it is running on a Macintosh). -# You can ignore the warning about this. -# - If the program dynamically reads or generates Python code and -# executes it, this code may reference built-in or library modules -# that aren't present in the frozen binary, and this will fail. -# - Your program may be using external data files, e.g. compiled -# forms definitions (*.fd). These aren't incorporated. Since -# sys.path in the resulting binary only contains '.', if your -# program searches its data files along sys.path (as the 'flp' -# modules does to find its forms definitions), you may need to -# change the program to extend the search path or instruct its users -# to set the environment variable PYTHONPATH to point to your data -# files. -# -# Usage hints: -# - If you have a bunch of scripts that you want to freeze, instead -# of freezing each of them separately, you might consider writing -# a tiny main script that looks at sys.argv[0] and then imports -# the corresponding module. You can then make links to the -# frozen binary named after the various scripts you support. -# Pass the additional scripts as arguments after the main script. -# A minimal script to do this is the following. -# import sys, posixpath -# exec('import ' + posixpath.basename(sys.argv[0]) + '\n') - - -import os -import sys -import regex -import getopt -import regsub -import string -import marshal - -# Function to join two pathnames with a slash in between -j = os.path.join - -################################## -# START OF CONFIGURATION SECTION # -################################## - -# Attempt to guess machine architecture -if os.path.exists('/usr/lib/libgl_s'): ARCH = 'sgi' -elif os.path.exists('/etc/issue'): ARCH = 'sequent' -else: ARCH = 'sun4' - -# Site parametrizations (change to match your site) -CC = 'cc' # C compiler -TOP = '/ufs/guido/src' # Parent of all source trees -PYTHON = j(TOP, 'python') # Top of the Python source tree -SRC = j(PYTHON, 'src') # Python source directory -BLD = j(PYTHON, 'build.' + ARCH) # Python build directory -#BLD = SRC # Use this if you build in SRC - -LIBINST = '/ufs/guido/src/python/irix4/tmp/lib/python/lib' # installed libraries -INCLINST = '/ufs/guido/src/python/irix4/tmp/include/Py' # installed include files - -# Other packages (change to match your site) -DL = j(TOP, 'dl') # Top of the dl source tree -DL_DLD = j(TOP, 'dl-dld') # The dl-dld source directory -DLD = j(TOP, 'dld-3.2.3') # The dld source directory -FORMS = j(TOP, 'forms') # Top of the FORMS source tree -STDWIN = j(TOP, 'stdwin') # Top of the STDWIN source tree -READLINE = j(TOP, 'readline.' + ARCH) # Top of the GNU Readline source tree -SUN_X11 = '/usr/local/X11R5/lib/libX11.a' - -# File names (usually no need to change) -LIBP = [ # Main Python libraries - j(LIBINST, 'libPython.a'), - j(LIBINST, 'libParser.a'), - j(LIBINST, 'libObjects.a'), - j(LIBINST, 'libModules.a') - ] -CONFIG_IN = j(LIBINST, 'config.c.in') # Configuration source file -FMAIN = j(LIBINST, 'frozenmain.c') # Special main source file - -# Libraries needed when linking. First tuple item is built-in module -# for which it is needed (or '*' for always), rest are ld arguments. -# There is a separate list per architecture. -libdeps_sgi = [ \ - ('stdwin', j(STDWIN, 'Build/' + ARCH + '/x11/lib/lib.a')), \ - ('fl', j(FORMS, 'FORMS/libforms.a'), '-lfm_s'), \ - ('*', j(READLINE, 'libreadline.a'), '-ltermcap'), \ - ('al', '-laudio'), \ - ('sv', '-lsvideo', '-lXext'), \ - ('cd', '-lcdaudio', '-lds'), \ - ('cl', '-lcl'), \ - ('imgfile', '-limage', '-lgutil', '-lm'), \ - ('mpz', '/ufs/guido/src/gmp/libgmp.a'), \ - ('*', '-lsun'), \ - ('*', j(DL, 'libdl.a'), '-lmld'), \ - ('*', '-lmpc'), \ - ('fm', '-lfm_s'), \ - ('gl', '-lgl_s', '-lX11_s'), \ - ('stdwin', '-lX11_s'), \ - ('*', '-lm'), \ - ('*', '-lc_s'), \ - ] -libdeps_sun4 = [ \ - ('*', '-Bstatic'), \ - ('stdwin', j(STDWIN, 'Build/' + ARCH + '/x11/lib/lib.a')), \ - ('*', j(READLINE, 'libreadline.a')), \ - ('*', '-lm'), \ - ('*', j(DL_DLD,'libdl.a'), j(DLD,'libdld.a')), \ - ('*', SUN_X11), \ - ('*', '-ltermcap'), \ - ('*', '-lc'), \ - ] -libdeps_sequent = [ \ - ('*', j(LIBINST, 'libreadline.a'), '-ltermcap'), \ - ('*', '-lsocket'), \ - ('*', '-linet'), \ - ('*', '-lnsl'), \ - ('*', '-lm'), \ - ('*', '-lc'), \ - ] -libdeps = eval('libdeps_' + ARCH) - -################################ -# END OF CONFIGURATION SECTION # -################################ - -# Exception used when scanfile fails -NoSuchFile = 'NoSuchFile' - -# Global options -quiet = 0 # -q -verbose = 0 # -v -noexec = 0 # -n -nowrite = 0 # -N -ofile = 'a.out' # -o file - -# Main program -- argument parsing etc. -def main(): - global quiet, verbose, noexec, nowrite, ofile - try: - opts, args = getopt.getopt(sys.argv[1:], 'nNo:qv') - except getopt.error, msg: - usage(str(msg)) - sys.exit(2) - for o, a in opts: - if o == '-n': noexec = 1 - if o == '-N': nowrite = 1 - if o == '-o': ofile = a - if o == '-q': verbose = 0; quiet = 1 - if o == '-v': verbose = verbose + 1; quiet = 0 - if len(args) < 1: - usage('please pass at least one file argument') - sys.exit(2) - process(args[0], args[1:]) - -# Print usage message to stderr -def usage(*msgs): - sys.stdout = sys.stderr - for msg in msgs: print msg - print 'Usage: freeze [options] scriptfile [modulefile ...]' - print '-n : generate the files but don\'t compile and link' - print '-N : don\'t write frozen.c (do compile unless -n given)' - print '-o file : binary output file (default a.out)' - print '-q : quiet (no messages at all except errors)' - print '-v : verbose (lots of extra messages)' - -# Process the script file -def process(filename, addmodules): - global noexec - # - if not quiet: print 'Computing needed modules ...' - todo = {} - todo['__main__'] = filename - for name in addmodules: - mod = os.path.basename(name) - if mod[-3:] == '.py': mod = mod[:-3] - todo[mod] = name - try: - dict = closure(todo) - except NoSuchFile, filename: - sys.stderr.write('Can\'t open file %s\n' % filename) - sys.exit(1) - # - mods = dict.keys() - mods.sort() - # - if verbose: - print '%-15s %s' % ('Module', 'Filename') - for mod in mods: - print '%-15s %s' % (`mod`, dict[mod]) - # - if not quiet: print 'Looking for dynamically linked modules ...' - dlmodules = [] - objs = [] - libs = [] - for mod in mods: - if dict[mod][-2:] == '.o': - if verbose: print 'Found', mod, dict[mod] - dlmodules.append(mod) - objs.append(dict[mod]) - libsname = dict[mod][:-2] + '.libs' - try: - f = open(libsname, 'r') - except IOError: - f = None - if f: - libtext = f.read() - f.close() - for lib in string.split(libtext): - if lib in libs: libs.remove(lib) - libs.append(lib) - # - if not nowrite: - if not quiet: print 'Writing frozen.c ...' - writefrozen('frozen.c', dict) - else: - if not quiet: print 'NOT writing frozen.c ...' - # -## if not dlmodules: - if 0: - config = CONFIG - if not quiet: print 'Using existing', config, '...' - else: - config = 'tmpconfig.c' - if nowrite: - if not quiet: print 'NOT writing config.c ...' - else: - if not quiet: - print 'Writing config.c with dl modules ...' - f = open(CONFIG_IN, 'r') - g = open(config, 'w') - m1 = regex.compile('-- ADDMODULE MARKER 1 --') - m2 = regex.compile('-- ADDMODULE MARKER 2 --') - builtinmodules = [] - stdmodules = ('sys', '__main__', '__builtin__', - 'marshal') - todomodules = builtinmodules + dlmodules - for mod in dict.keys(): - if dict[mod] == '' and \ - mod not in stdmodules: - builtinmodules.append(mod) - while 1: - line = f.readline() - if not line: break - g.write(line) - if m1.search(line) >= 0: - if verbose: print 'Marker 1 ...' - for mod in todomodules: - g.write('extern void init' + \ - mod + '();\n') - if m2.search(line) >= 0: - if verbose: print 'Marker 2 ...' - for mod in todomodules: - g.write('{"' + mod + \ - '", init' + mod + '},\n') - g.close() - # - if not quiet: - if noexec: print 'Generating compilation commands ...' - else: print 'Starting compilation ...' - defs = ['-DNO_MAIN', '-DUSE_FROZEN', '-DPYTHONPATH=\'"."\''] - # - incs = ['-I.', '-I' + INCLINST] - if dict.has_key('stdwin'): - incs.append('-I' + j(STDWIN, 'H')) - # - srcs = [config, FMAIN] - # - if type(LIBP) == type(''): - libs.append(LIBP) - else: - for lib in LIBP: - libs.append(lib) - for item in libdeps: - m = item[0] - if m == '*' or dict.has_key(m): - for l in item[1:]: - if l in libs: libs.remove(l) - libs.append(l) - # - sts = 0 - # - cmd = CC + ' -c' - cmd = cmd + ' ' + string.join(defs) - cmd = cmd + ' ' + string.join(incs) - cmd = cmd + ' ' + string.join(srcs) - print cmd - # - if not noexec: - sts = os.system(cmd) - if sts: - print 'Exit status', sts, '-- turning on -n' - noexec = 1 - # - for s in srcs: - s = os.path.basename(s) - if s[-2:] == '.c': s = s[:-2] - o = s + '.o' - objs.insert(0, o) - # - cmd = CC - cmd = cmd + ' ' + string.join(objs) - cmd = cmd + ' ' + string.join(libs) - cmd = cmd + ' -o ' + ofile - print cmd - # - if not noexec: - sts = os.system(cmd) - if sts: - print 'Exit status', sts - else: - print 'Done.' - # - if not quiet and not noexec and sts == 0: - print 'Note: consider this:'; print '\tstrip', ofile - # - sys.exit(sts) - - -# Generate code for a given module -def makecode(filename): - if filename[-2:] == '.o': - return None - try: - f = open(filename, 'r') - except IOError: - return None - if verbose: print 'Making code from', filename, '...' - text = f.read() - code = compile(text, filename, 'exec') - f.close() - return marshal.dumps(code) - - -# Write the C source file containing the frozen Python code -def writefrozen(filename, dict): - f = open(filename, 'w') - codelist = [] - for mod in dict.keys(): - codestring = makecode(dict[mod]) - if codestring is not None: - codelist.append((mod, codestring)) - write = sys.stdout.write - save_stdout = sys.stdout - try: - sys.stdout = f - for mod, codestring in codelist: - if verbose: - write('Writing initializer for %s\n'%mod) - print 'static unsigned char M_' + mod + '[' + \ - str(len(codestring)) + '+1] = {' - for i in range(0, len(codestring), 16): - for c in codestring[i:i+16]: - print str(ord(c)) + ',', - print - print '};' - print 'struct frozen {' - print ' char *name;' - print ' unsigned char *code;' - print ' int size;' - print '} frozen_modules[] = {' - for mod, codestring in codelist: - print ' {"' + mod + '",', - print 'M_' + mod + ',', - print str(len(codestring)) + '},' - print ' {0, 0, 0} /* sentinel */' - print '};' - finally: - sys.stdout = save_stdout - f.close() - - -# Determine the names and filenames of the modules imported by the -# script, recursively. This is done by scanning for lines containing -# import statements. (The scanning has only superficial knowledge of -# Python syntax and no knowledge of semantics, so in theory the result -# may be incorrect -- however this is quite unlikely if you don't -# intentionally obscure your Python code.) - -# Compute the closure of scanfile() -- special first file because of script -def closure(todo): - done = {} - while todo: - newtodo = {} - for modname in todo.keys(): - if not done.has_key(modname): - filename = todo[modname] - if filename is None: - filename = findmodule(modname) - done[modname] = filename - if filename in ('', ''): - continue - modules = scanfile(filename) - for m in modules: - if not done.has_key(m): - newtodo[m] = None - todo = newtodo - return done - -# Scan a file looking for import statements -importstr = '\(^\|:\)[ \t]*import[ \t]+\([a-zA-Z0-9_, \t]+\)' -fromstr = '\(^\|:\)[ \t]*from[ \t]+\([a-zA-Z0-9_]+\)[ \t]+import[ \t]+' -isimport = regex.compile(importstr) -isfrom = regex.compile(fromstr) -def scanfile(filename): - allmodules = {} - try: - f = open(filename, 'r') - except IOError, msg: - raise NoSuchFile, filename - while 1: - line = f.readline() - if not line: break # EOF - while line[-2:] == '\\\n': # Continuation line - line = line[:-2] + ' ' - line = line + f.readline() - if isimport.search(line) >= 0: - rawmodules = isimport.group(2) - modules = string.splitfields(rawmodules, ',') - for i in range(len(modules)): - modules[i] = string.strip(modules[i]) - elif isfrom.search(line) >= 0: - modules = [isfrom.group(2)] - else: - continue - for mod in modules: - allmodules[mod] = None - f.close() - return allmodules.keys() - -# Find the file containing a module, given its name; None if not found -builtins = sys.builtin_module_names + ['sys'] -def findmodule(modname): - if modname in builtins: return '' - for dirname in sys.path: - dlfullname = os.path.join(dirname, modname + 'module.o') - try: - f = open(dlfullname, 'r') - except IOError: - f = None - if f: - f.close() - return dlfullname - fullname = os.path.join(dirname, modname + '.py') - try: - f = open(fullname, 'r') - except IOError: - continue - f.close() - return fullname - if not quiet: - sys.stderr.write('Warning: module %s not found\n' % modname) - return '' - - -# Call the main program -main() diff --git a/Demo/scripts/from.py b/Demo/scripts/from.py deleted file mode 100755 index 9f749aea60..0000000000 --- a/Demo/scripts/from.py +++ /dev/null @@ -1,35 +0,0 @@ -#! /usr/bin/env python - -# Print From and Subject of messages in $MAIL. -# Extension to multiple mailboxes and other bells & whistles are left -# as exercises for the reader. - -import sys, os - -# Open mailbox file. Exits with exception when this fails. - -try: - mailbox = os.environ['MAIL'] -except (AttributeError, KeyError): - sys.stderr.write('No environment variable $MAIL\n') - sys.exit(2) - -try: - mail = open(mailbox, 'r') -except IOError: - sys.stderr.write('Cannot open mailbox file: ' + mailbox + '\n') - sys.exit(2) - -while 1: - line = mail.readline() - if not line: break # EOF - if line[:5] == 'From ': - # Start of message found - print line[:-1], - while 1: - line = mail.readline() - if not line: break # EOF - if line == '\n': break # Blank line ends headers - if line[:8] == 'Subject:': - print `line[9:-1]`, - print diff --git a/Demo/scripts/ftpstats.py b/Demo/scripts/ftpstats.py deleted file mode 100755 index 28b1d8bdfd..0000000000 --- a/Demo/scripts/ftpstats.py +++ /dev/null @@ -1,144 +0,0 @@ -#! /usr/bin/env python - -# Extract statistics from ftp daemon log. - -# Usage: -# ftpstats [-m maxitems] [-s search] [file] -# -m maxitems: restrict number of items in "top-N" lists, default 25. -# -s string: restrict statistics to lines containing this string. -# Default file is /usr/adm/ftpd; a "-" means read stdandard input. - -# The script must be run on the host where the ftp daemon runs. -# (At CWI this is currently buizerd.) - -import os -import sys -import regex -import string -import getopt - -pat = '^\([a-zA-Z0-9 :]*\)!\(.*\)!\(.*\)!\([<>].*\)!\([0-9]+\)!\([0-9]+\)$' -prog = regex.compile(pat) - -def main(): - maxitems = 25 - search = None - try: - opts, args = getopt.getopt(sys.argv[1:], 'm:s:') - except getopt.error, msg: - print msg - print 'usage: ftpstats [-m maxitems] [file]' - sys.exit(2) - for o, a in opts: - if o == '-m': - maxitems = string.atoi(a) - if o == '-s': - search = a - file = '/usr/adm/ftpd' - if args: file = args[0] - if file == '-': - f = sys.stdin - else: - try: - f = open(file, 'r') - except IOError, msg: - print file, ':', msg - sys.exit(1) - bydate = {} - bytime = {} - byfile = {} - bydir = {} - byhost = {} - byuser = {} - bytype = {} - lineno = 0 - try: - while 1: - line = f.readline() - if not line: break - lineno = lineno + 1 - if search and string.find(line, search) < 0: - continue - if prog.match(line) < 0: - print 'Bad line', lineno, ':', `line` - continue - items = prog.group(1, 2, 3, 4, 5, 6) - (logtime, loguser, loghost, logfile, logbytes, - logxxx2) = items -## print logtime -## print '-->', loguser -## print '--> -->', loghost -## print '--> --> -->', logfile -## print '--> --> --> -->', logbytes -## print '--> --> --> --> -->', logxxx2 -## for i in logtime, loghost, logbytes, logxxx2: -## if '!' in i: print '???', i - add(bydate, logtime[-4:] + ' ' + logtime[:6], items) - add(bytime, logtime[7:9] + ':00-59', items) - direction, logfile = logfile[0], logfile[1:] - # The real path probably starts at the last //... - while 1: - i = string.find(logfile, '//') - if i < 0: break - logfile = logfile[i+1:] - add(byfile, logfile + ' ' + direction, items) - logdir = os.path.dirname(logfile) -## logdir = os.path.normpath(logdir) + '/.' - while 1: - add(bydir, logdir + ' ' + direction, items) - dirhead = os.path.dirname(logdir) - if dirhead == logdir: break - logdir = dirhead - add(byhost, loghost, items) - add(byuser, loguser, items) - add(bytype, direction, items) - except KeyboardInterrupt: - print 'Interrupted at line', lineno - show(bytype, 'by transfer direction', maxitems) - show(bydir, 'by directory', maxitems) - show(byfile, 'by file', maxitems) - show(byhost, 'by host', maxitems) - show(byuser, 'by user', maxitems) - showbar(bydate, 'by date') - showbar(bytime, 'by time of day') - -def showbar(dict, title): - n = len(title) - print '='*((70-n)/2), title, '='*((71-n)/2) - list = [] - keys = dict.keys() - keys.sort() - for key in keys: - n = len(str(key)) - list.append((len(dict[key]), key)) - maxkeylength = 0 - maxcount = 0 - for count, key in list: - maxkeylength = max(maxkeylength, len(key)) - maxcount = max(maxcount, count) - maxbarlength = 72 - maxkeylength - 7 - for count, key in list: - barlength = int(round(maxbarlength*float(count)/maxcount)) - bar = '*'*barlength - print '%5d %-*s %s' % (count, maxkeylength, key, bar) - -def show(dict, title, maxitems): - if len(dict) > maxitems: - title = title + ' (first %d)'%maxitems - n = len(title) - print '='*((70-n)/2), title, '='*((71-n)/2) - list = [] - keys = dict.keys() - for key in keys: - list.append((-len(dict[key]), key)) - list.sort() - for count, key in list[:maxitems]: - print '%5d %s' % (-count, key) - -def add(dict, key, item): - if dict.has_key(key): - dict[key].append(item) - else: - dict[key] = [item] - -main() diff --git a/Demo/scripts/lpwatch.py b/Demo/scripts/lpwatch.py deleted file mode 100755 index 9f051ebbf3..0000000000 --- a/Demo/scripts/lpwatch.py +++ /dev/null @@ -1,109 +0,0 @@ -#! /usr/bin/env python - -# Watch line printer queue(s). -# Intended for BSD 4.3 lpq. - -import posix -import sys -import time -import string - -DEF_PRINTER = 'psc' -DEF_DELAY = 10 - -def main(): - delay = DEF_DELAY # XXX Use getopt() later - try: - thisuser = posix.environ['LOGNAME'] - except: - thisuser = posix.environ['USER'] - printers = sys.argv[1:] - if printers: - # Strip '-P' from printer names just in case - # the user specified it... - for i in range(len(printers)): - if printers[i][:2] == '-P': - printers[i] = printers[i][2:] - else: - if posix.environ.has_key('PRINTER'): - printers = [posix.environ['PRINTER']] - else: - printers = [DEF_PRINTER] - # - clearhome = posix.popen('clear', 'r').read() - # - while 1: - text = clearhome - for name in printers: - text = text + makestatus(name, thisuser) + '\n' - print text - time.sleep(delay) - -def makestatus(name, thisuser): - pipe = posix.popen('lpq -P' + name + ' 2>&1', 'r') - lines = [] - users = {} - aheadbytes = 0 - aheadjobs = 0 - userseen = 0 - totalbytes = 0 - totaljobs = 0 - while 1: - line = pipe.readline() - if not line: break - fields = string.split(line) - n = len(fields) - if len(fields) >= 6 and fields[n-1] == 'bytes': - rank = fields[0] - user = fields[1] - job = fields[2] - files = fields[3:-2] - bytes = eval(fields[n-2]) - if user == thisuser: - userseen = 1 - elif not userseen: - aheadbytes = aheadbytes + bytes - aheadjobs = aheadjobs + 1 - totalbytes = totalbytes + bytes - totaljobs = totaljobs + 1 - if users.has_key(user): - ujobs, ubytes = users[user] - else: - ujobs, ubytes = 0, 0 - ujobs = ujobs + 1 - ubytes = ubytes + bytes - users[user] = ujobs, ubytes - else: - if fields and fields[0] <> 'Rank': - line = string.strip(line) - if line == 'no entries': - line = name + ': idle' - elif line[-22:] == ' is ready and printing': - line = name - lines.append(line) - # - if totaljobs: - line = `(totalbytes+1023)/1024` + ' K' - if totaljobs <> len(users): - line = line + ' (' + `totaljobs` + ' jobs)' - if len(users) == 1: - line = line + ' for ' + users.keys()[0] - else: - line = line + ' for ' + `len(users)` + ' users' - if userseen: - if aheadjobs == 0: - line = line + ' (' + thisuser + ' first)' - else: - line = line + ' (' + `(aheadbytes+1023)/1024` - line = line + ' K before ' + thisuser + ')' - lines.append(line) - # - sts = pipe.close() - if sts: - lines.append('lpq exit status ' + `sts`) - return string.joinfields(lines, ': ') - -try: - main() -except KeyboardInterrupt: - pass diff --git a/Demo/scripts/makedir.py b/Demo/scripts/makedir.py deleted file mode 100755 index 4c00d88809..0000000000 --- a/Demo/scripts/makedir.py +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env python - -# Like mkdir, but also make intermediate directories if necessary. -# It is not an error if the given directory already exists (as long -# as it is a directory). -# Errors are not treated specially -- you just get a Python exception. - -import sys, os - -def main(): - for p in sys.argv[1:]: - makedirs(p) - -def makedirs(p): - if p and not os.path.isdir(p): - head, tail = os.path.split(p) - makedirs(head) - os.mkdir(p, 0777) - -main() diff --git a/Demo/scripts/markov.py b/Demo/scripts/markov.py deleted file mode 100755 index e1649f1e9d..0000000000 --- a/Demo/scripts/markov.py +++ /dev/null @@ -1,116 +0,0 @@ -#! /usr/bin/env python - -class Markov: - def __init__(self, histsize, choice): - self.histsize = histsize - self.choice = choice - self.trans = {} - def add(self, state, next): - if not self.trans.has_key(state): - self.trans[state] = [next] - else: - self.trans[state].append(next) - def put(self, seq): - n = self.histsize - add = self.add - add(None, seq[:0]) - for i in range(len(seq)): - add(seq[max(0, i-n):i], seq[i:i+1]) - add(seq[len(seq)-n:], None) - def get(self): - choice = self.choice - trans = self.trans - n = self.histsize - seq = choice(trans[None]) - while 1: - subseq = seq[max(0, len(seq)-n):] - options = trans[subseq] - next = choice(options) - if not next: break - seq = seq + next - return seq - -def test(): - import sys, string, random, getopt - args = sys.argv[1:] - try: - opts, args = getopt.getopt(args, '0123456789cdw') - except getopt.error: - print 'Usage: markov [-#] [-cddqw] [file] ...' - print 'Options:' - print '-#: 1-digit history size (default 2)' - print '-c: characters (default)' - print '-w: words' - print '-d: more debugging output' - print '-q: no debugging output' - print 'Input files (default stdin) are split in paragraphs' - print 'separated blank lines and each paragraph is split' - print 'in words by whitespace, then reconcatenated with' - print 'exactly one space separating words.' - print 'Output consists of paragraphs separated by blank' - print 'lines, where lines are no longer than 72 characters.' - histsize = 2 - do_words = 0 - debug = 1 - for o, a in opts: - if '-0' <= o <= '-9': histsize = eval(o[1:]) - if o == '-c': do_words = 0 - if o == '-d': debug = debug + 1 - if o == '-q': debug = 0 - if o == '-w': do_words = 1 - if not args: args = ['-'] - m = Markov(histsize, random.choice) - try: - for filename in args: - if filename == '-': - f = sys.stdin - if f.isatty(): - print 'Sorry, need stdin from file' - continue - else: - f = open(filename, 'r') - if debug: print 'processing', filename, '...' - text = f.read() - f.close() - paralist = string.splitfields(text, '\n\n') - for para in paralist: - if debug > 1: print 'feeding ...' - words = string.split(para) - if words: - if do_words: data = tuple(words) - else: data = string.joinfields(words, ' ') - m.put(data) - except KeyboardInterrupt: - print 'Interrupted -- continue with data read so far' - if not m.trans: - print 'No valid input files' - return - if debug: print 'done.' - if debug > 1: - for key in m.trans.keys(): - if key is None or len(key) < histsize: - print `key`, m.trans[key] - if histsize == 0: print `''`, m.trans[''] - print - while 1: - data = m.get() - if do_words: words = data - else: words = string.split(data) - n = 0 - limit = 72 - for w in words: - if n + len(w) > limit: - print - n = 0 - print w, - n = n + len(w) + 1 - print - print - -def tuple(list): - if len(list) == 0: return () - if len(list) == 1: return (list[0],) - i = len(list)/2 - return tuple(list[:i]) + tuple(list[i:]) - -test() diff --git a/Demo/scripts/mboxconvert.py b/Demo/scripts/mboxconvert.py deleted file mode 100755 index 08e0d0cbe5..0000000000 --- a/Demo/scripts/mboxconvert.py +++ /dev/null @@ -1,123 +0,0 @@ -#! /usr/bin/env python - -# Convert MH directories (1 message per file) or MMDF mailboxes (4x^A -# delimited) to unix mailbox (From ... delimited) on stdout. -# If -f is given, files contain one message per file (e.g. MH messages) - -import rfc822 -import sys -import time -import os -import stat -import getopt -import regex - -def main(): - dofile = mmdf - try: - opts, args = getopt.getopt(sys.argv[1:], 'f') - except getopt.error, msg: - sys.stderr.write('%s\n' % msg) - sys.exit(2) - for o, a in opts: - if o == '-f': - dofile = message - if not args: - args = ['-'] - sts = 0 - for arg in args: - if arg == '-' or arg == '': - sts = dofile(sys.stdin) or sts - elif os.path.isdir(arg): - sts = mh(arg) or sts - elif os.path.isfile(arg): - try: - f = open(arg) - except IOError, msg: - sys.stderr.write('%s: %s\n' % (arg, msg)) - sts = 1 - continue - sts = dofile(f) or sts - f.close() - else: - sys.stderr.write('%s: not found\n' % arg) - sts = 1 - if sts: - sys.exit(sts) - -numeric = regex.compile('[1-9][0-9]*') - -def mh(dir): - sts = 0 - msgs = os.listdir(dir) - for msg in msgs: - if numeric.match(msg) != len(msg): - continue - fn = os.path.join(dir, msg) - try: - f = open(fn) - except IOError, msg: - sys.stderr.write('%s: %s\n' % (fn, msg)) - sts = 1 - continue - sts = message(f) or sts - return sts - -def mmdf(f): - sts = 0 - while 1: - line = f.readline() - if not line: - break - if line == '\1\1\1\1\n': - sts = message(f, line) or sts - else: - sys.stderr.write( - 'Bad line in MMFD mailbox: %s\n' % `line`) - return sts - -counter = 0 # for generating unique Message-ID headers - -def message(f, delimiter = ''): - sts = 0 - # Parse RFC822 header - m = rfc822.Message(f) - # Write unix header line - fullname, email = m.getaddr('From') - tt = m.getdate('Date') - if tt: - t = time.mktime(tt) - else: - sys.stderr.write( - 'Unparseable date: %s\n' % `m.getheader('Date')`) - t = os.fstat(f.fileno())[stat.ST_MTIME] - print 'From', email, time.ctime(t) - # Copy RFC822 header - for line in m.headers: - print line, - # Invent Message-ID header if none is present - if not m.has_key('message-id'): - global counter - counter = counter + 1 - msgid = "<%s.%d>" % (hex(t), counter) - sys.stderr.write("Adding Message-ID %s (From %s)\n" % - (msgid, email)) - print "Message-ID:", msgid - print - # Copy body - while 1: - line = f.readline() - if line == delimiter: - break - if not line: - sys.stderr.write('Unexpected EOF in message\n') - sts = 1 - break - if line[:5] == 'From ': - line = '>' + line - print line, - # Print trailing newline - print - return sts - -main() diff --git a/Demo/scripts/mkrcs.py b/Demo/scripts/mkrcs.py deleted file mode 100755 index 36a35eace2..0000000000 --- a/Demo/scripts/mkrcs.py +++ /dev/null @@ -1,60 +0,0 @@ -#! /usr/bin/env python - -# A rather specialized script to make sure that a symbolic link named -# RCS exists pointing to a real RCS directory in a parallel tree -# referenced as RCStree in an ancestor directory. -# (I use this because I like my RCS files to reside on a physically -# different machine). - -import os - -def main(): - rcstree = 'RCStree' - rcs = 'RCS' - if os.path.islink(rcs): - print `rcs`, 'is a symlink to', `os.readlink(rcs)` - return - if os.path.isdir(rcs): - print `rcs`, 'is an ordinary directory' - return - if os.path.exists(rcs): - print `rcs`, 'is a file?!?!' - return - # - p = os.getcwd() - up = '' - down = '' - # Invariants: - # (1) join(p, down) is the current directory - # (2) up is the same directory as p - # Ergo: - # (3) join(up, down) is the current directory - #print 'p =', `p` - while not os.path.isdir(os.path.join(p, rcstree)): - head, tail = os.path.split(p) - #print 'head =', `head`, '; tail =', `tail` - if not tail: - print 'Sorry, no ancestor dir contains', `rcstree` - return - p = head - up = os.path.join(os.pardir, up) - down = os.path.join(tail, down) - #print 'p =', `p`, '; up =', `up`, '; down =', `down` - there = os.path.join(up, rcstree) - there = os.path.join(there, down) - there = os.path.join(there, rcs) - if os.path.isdir(there): - print `there`, 'already exists' - else: - print 'making', `there` - makedirs(there) - print 'making symlink', `rcs`, '->', `there` - os.symlink(there, rcs) - -def makedirs(p): - if not os.path.isdir(p): - head, tail = os.path.split(p) - makedirs(head) - os.mkdir(p, 0777) - -main() diff --git a/Demo/scripts/morse.py b/Demo/scripts/morse.py deleted file mode 100755 index 2cea83e402..0000000000 --- a/Demo/scripts/morse.py +++ /dev/null @@ -1,149 +0,0 @@ -# DAH should be three DOTs. -# Space between DOTs and DAHs should be one DOT. -# Space between two letters should be one DAH. -# Space between two words should be DOT DAH DAH. - -import sys, math, audiodev - -DOT = 30 -DAH = 3 * DOT -OCTAVE = 2 # 1 == 441 Hz, 2 == 882 Hz, ... - -morsetab = { - 'A': '.-', 'a': '.-', - 'B': '-...', 'b': '-...', - 'C': '-.-.', 'c': '-.-.', - 'D': '-..', 'd': '-..', - 'E': '.', 'e': '.', - 'F': '..-.', 'f': '..-.', - 'G': '--.', 'g': '--.', - 'H': '....', 'h': '....', - 'I': '..', 'i': '..', - 'J': '.---', 'j': '.---', - 'K': '-.-', 'k': '-.-', - 'L': '.-..', 'l': '.-..', - 'M': '--', 'm': '--', - 'N': '-.', 'n': '-.', - 'O': '---', 'o': '---', - 'P': '.--.', 'p': '.--.', - 'Q': '--.-', 'q': '--.-', - 'R': '.-.', 'r': '.-.', - 'S': '...', 's': '...', - 'T': '-', 't': '-', - 'U': '..-', 'u': '..-', - 'V': '...-', 'v': '...-', - 'W': '.--', 'w': '.--', - 'X': '-..-', 'x': '-..-', - 'Y': '-.--', 'y': '-.--', - 'Z': '--..', 'z': '--..', - '0': '-----', - '1': '.----', - '2': '..---', - '3': '...--', - '4': '....-', - '5': '.....', - '6': '-....', - '7': '--...', - '8': '---..', - '9': '----.', - ',': '--..--', - '.': '.-.-.-', - '?': '..--..', - ';': '-.-.-.', - ':': '---...', - "'": '.----.', - '-': '-....-', - '/': '-..-.', - '(': '-.--.-', - ')': '-.--.-', - '_': '..--.-', - ' ': ' ' -} - -# If we play at 44.1 kHz (which we do), then if we produce one sine -# wave in 100 samples, we get a tone of 441 Hz. If we produce two -# sine waves in these 100 samples, we get a tone of 882 Hz. 882 Hz -# appears to be a nice one for playing morse code. -def mkwave(octave): - global sinewave, nowave - sinewave = '' - for i in range(100): - val = int(math.sin(math.pi * float(i) * octave / 50.0) * 30000) - sinewave = sinewave + chr((val >> 8) & 255) + chr(val & 255) - nowave = '\0' * 200 - -mkwave(OCTAVE) - -def main(): - import getopt, string - try: - opts, args = getopt.getopt(sys.argv[1:], 'o:p:') - except getopt.error: - sys.stderr.write('Usage ' + sys.argv[0] + - ' [ -o outfile ] [ args ] ...\n') - sys.exit(1) - dev = None - for o, a in opts: - if o == '-o': - import aifc - dev = aifc.open(a, 'w') - dev.setframerate(44100) - dev.setsampwidth(2) - dev.setnchannels(1) - if o == '-p': - mkwave(string.atoi(a)) - if not dev: - import audiodev - dev = audiodev.AudioDev() - dev.setoutrate(44100) - dev.setsampwidth(2) - dev.setnchannels(1) - dev.close = dev.stop - dev.writeframesraw = dev.writeframes - if args: - line = string.join(args) - else: - line = sys.stdin.readline() - while line: - mline = morse(line) - play(mline, dev) - if hasattr(dev, 'wait'): - dev.wait() - if not args: - line = sys.stdin.readline() - else: - line = '' - dev.close() - -# Convert a string to morse code with \001 between the characters in -# the string. -def morse(line): - res = '' - for c in line: - try: - res = res + morsetab[c] + '\001' - except KeyError: - pass - return res - -# Play a line of morse code. -def play(line, dev): - for c in line: - if c == '.': - sine(dev, DOT) - elif c == '-': - sine(dev, DAH) - else: # space - pause(dev, DAH + DOT) - pause(dev, DOT) - -def sine(dev, length): - for i in range(length): - dev.writeframesraw(sinewave) - -def pause(dev, length): - for i in range(length): - dev.writeframesraw(nowave) - -if __name__ == '__main__' or sys.argv[0] == __name__: - main() diff --git a/Demo/scripts/mpzpi.py b/Demo/scripts/mpzpi.py deleted file mode 100755 index 93c74aa398..0000000000 --- a/Demo/scripts/mpzpi.py +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/env python -# Print digits of pi forever. -# -# The algorithm, using Python's 'long' integers ("bignums"), works -# with continued fractions, and was conceived by Lambert Meertens. -# -# See also the ABC Programmer's Handbook, by Geurts, Meertens & Pemberton, -# published by Prentice-Hall (UK) Ltd., 1990. - -import sys -from mpz import mpz - -def main(): - mpzone, mpztwo, mpzten = mpz(1), mpz(2), mpz(10) - k, a, b, a1, b1 = mpz(2), mpz(4), mpz(1), mpz(12), mpz(4) - while 1: - # Next approximation - p, q, k = k*k, mpztwo*k+mpzone, k+mpzone - a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1 - # Print common digits - d, d1 = a/b, a1/b1 - while d == d1: - output(d) - a, a1 = mpzten*(a%b), mpzten*(a1%b1) - d, d1 = a/b, a1/b1 - -def output(d): - # Use write() to avoid spaces between the digits - # Use int(d) to avoid a trailing L after each digit - sys.stdout.write(`int(d)`) - # Flush so the output is seen immediately - sys.stdout.flush() - -main() diff --git a/Demo/scripts/newslist.doc b/Demo/scripts/newslist.doc deleted file mode 100755 index 87fd9ba27a..0000000000 --- a/Demo/scripts/newslist.doc +++ /dev/null @@ -1,59 +0,0 @@ - NEWSLIST - ======== - A program to assist HTTP browsing of newsgroups - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -WWW browsers such as NCSA Mosaic allow the user to read newsgroup -articles by specifying the group name in a URL eg 'news:comp.answers'. - -To browse through many groups, though, (and there are several thousand -of them) you really need a page or pages containing links to all the -groups. There are some good ones out there, for example, - - http://info.cern.ch/hypertext/DataSources/News/Groups/Overview.html - -is the standard one at CERN, but it only shows the groups available there, -which may be rather different from those available on your machine. - -Newslist is a program which creates a hierarchy of pages for you based -on the groups available from YOUR server. It is written in python - a -splendid interpreted object-oriented language which I suggest you get -right now from the directory /pub/python at ftp.cwi.nl, if you haven't -already got it. - -You should be able to see some sample output by looking at: - http://pelican.cl.cam.ac.uk/newspage/root.html - -Descriptions of newsgroups can be added from a file with one group -per line. eg: - - alt.foo Articles about foo - comp.bar Programming in 'bar' and related languages - -A suitable list detailing most groups can be found at ftp.uu.net in -/uunet-info/newsgroups.gz. - -Make sure you read the information at the beginning of the program source and -configure the variables before running. - -In addition to python, you need: - - An NNTP-based news feed. - A directory in which to put the pages. - -The programming is not very beautiful, but it works! It comes with no -warranty, express or implied, but with the hope that some others may -find it useful. - -Comments, improvements & suggestions welcomed. -Quentin Stafford-Fraser - - ---------------------------------------------------------------------- - Quentin Stafford-Fraser - http://pelican.cl.cam.ac.uk/people/qs101/me.html - - Cambridge University Computer Lab Rank Xerox Cambridge EuroPARC - qs101@cl.cam.ac.uk fraser@europarc.xerox.com - Tel: +44 223 334411 Tel: +44 223 341521 - Fax: +44 223 334679 Fax: +44 223 341510 - ---------------------------------------------------------------------- diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py deleted file mode 100755 index f78ca30271..0000000000 --- a/Demo/scripts/newslist.py +++ /dev/null @@ -1,366 +0,0 @@ -#! /usr/bin/env python -####################################################################### -# Newslist $Revision$ -# -# Syntax: -# newslist [ -a ] -# -# This is a program to create a directory full of HTML pages -# which between them contain links to all the newsgroups available -# on your server. -# -# The -a option causes a complete list of all groups to be read from -# the server rather than just the ones which have appeared since last -# execution. This recreates the local list from scratch. Use this on -# the first invocation of the program, and from time to time thereafter. -# When new groups are first created they may appear on your server as -# empty groups. By default, empty groups are ignored by the -a option. -# However, these new groups will not be created again, and so will not -# appear in the server's list of 'new groups' at a later date. Hence it -# won't appear until you do a '-a' after some articles have appeared. -# -# I should really keep a list of ignored empty groups and re-check them -# for articles on every run, but I haven't got around to it yet. -# -# This assumes an NNTP news feed. -# -# Feel free to copy, distribute and modify this code for -# non-commercial use. If you make any useful modifications, let me -# know! -# -# (c) Quentin Stafford-Fraser 1994 -# fraser@europarc.xerox.com qs101@cl.cam.ac.uk -# # -####################################################################### -import sys,nntplib, string, marshal, time, os, posix, string - -####################################################################### -# Check these variables before running! # - -# Top directory. -# Filenames which don't start with / are taken as being relative to this. -topdir='/anfs/qsbigdisc/web/html/newspage' - -# The name of your NNTP host -# eg. -# newshost = 'nntp-serv.cl.cam.ac.uk' -# or use following to get the name from the NNTPSERVER environment -# variable: -# newshost = posix.environ['NNTPSERVER'] -newshost = 'nntp-serv.cl.cam.ac.uk' - -# The filename for a local cache of the newsgroup list -treefile = 'grouptree' - -# The filename for descriptions of newsgroups -# I found a suitable one at ftp.uu.net in /uunet-info/newgroups.gz -# You can set this to '' if you don't wish to use one. -descfile = 'newsgroups' - -# The directory in which HTML pages should be created -# eg. -# pagedir = '/usr/local/lib/html/newspage' -# pagedir = 'pages' -pagedir = topdir - -# The html prefix which will refer to this directory -# eg. -# httppref = '/newspage/', -# or leave blank for relative links between pages: (Recommended) -# httppref = '' -httppref = '' - -# The name of the 'root' news page in this directory. -# A .html suffix will be added. -rootpage = 'root' - -# Set skipempty to 0 if you wish to see links to empty groups as well. -# Only affects the -a option. -skipempty = 1 - -# pagelinkicon can contain html to put an icon after links to -# further pages. This helps to make important links stand out. -# Set to '' if not wanted, or '...' is quite a good one. -pagelinkicon='... ' - -# --------------------------------------------------------------------- -# Less important personal preferences: - -# Sublistsize controls the maximum number of items the will appear as -# an indented sub-list before the whole thing is moved onto a different -# page. The smaller this is, the more pages you will have, but the -# shorter each will be. -sublistsize = 4 - -# That should be all. # -####################################################################### - -for dir in os.curdir, os.environ['HOME']: - rcfile = os.path.join(dir, '.newslistrc.py') - if os.path.exists(rcfile): - print rcfile - execfile(rcfile) - break - -from nntplib import NNTP -from stat import * - -rcsrev = '$Revision$' -rcsrev = string.join(filter(lambda s: '$' not in s, string.split(rcsrev))) -desc = {} - -# Make (possibly) relative filenames into absolute ones -treefile = os.path.join(topdir,treefile) -descfile = os.path.join(topdir,descfile) -page = os.path.join(topdir,pagedir) - -# First the bits for creating trees --------------------------- - -# Addtotree creates/augments a tree from a list of group names -def addtotree(tree, groups): - print 'Updating tree...' - for i in groups: - parts = string.splitfields(i,'.') - makeleaf(tree, parts) - -# Makeleaf makes a leaf and the branch leading to it if necessary -def makeleaf(tree,path): - j = path[0] - l = len(path) - - if not tree.has_key(j): - tree[j] = {} - if l == 1: - tree[j]['.'] = '.' - if l > 1: - makeleaf(tree[j],path[1:]) - -# Then the bits for outputting trees as pages ---------------- - -# Createpage creates an HTML file named .html containing links -# to those groups beginning with . - -def createpage(root, tree, p): - filename = os.path.join(pagedir,root+'.html') - if root == rootpage: - detail = '' - else: - detail = ' under ' + root - f = open(filename,'w') - # f.write('Content-Type: text/html\n') - f.write('Newsgroups available' + detail + '\n') - f.write('

Newsgroups available' + detail +'

\n') - f.write('Back to top level

\n') - printtree(f,tree,0,p) - f.write('This page automatically created by \'newslist\' v. '+rcsrev+'.') - f.write(time.ctime(time.time()) + '

') - f.close() - -# Printtree prints the groups as a bulleted list. Groups with -# more than subgroups will be put on a separate page. -# Other sets of subgroups are just indented. - -def printtree(f, tree, indent, p): - global desc - l = len(tree) - - if l > sublistsize and indent>0: - # Create a new page and a link to it - f.write('

  • ') - f.write(p[1:]+'.*') - f.write(''+pagelinkicon+'\n') - createpage(p[1:], tree, p) - return - - kl = tree.keys() - - if l > 1: - kl.sort() - if indent > 0: - # Create a sub-list - f.write('
  • '+p[1:]+'\n