summaryrefslogtreecommitdiffstats
path: root/Mac/IDE scripts
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-06-08 14:52:47 (GMT)
committerThomas Wouters <thomas@python.org>2006-06-08 14:52:47 (GMT)
commit1ba5b3b425e970ec3e4a19165475aa68fa5ac893 (patch)
tree607d666a002704ccb6a8cc5d1739b729a64cc615 /Mac/IDE scripts
parent4d70c3d9dded0f0fa7a73c67217a71111d05df4d (diff)
downloadcpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.zip
cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.gz
cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.bz2
Merged revisions 46607-46608 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r46607 | neal.norwitz | 2006-06-03 06:49:00 +0200 (Sat, 03 Jun 2006) | 1 line Remove Mac OS 9 support (http://mail.python.org/pipermail/python-dev/2006-June/065538.html) ........ r46608 | martin.v.loewis | 2006-06-03 09:37:13 +0200 (Sat, 03 Jun 2006) | 2 lines Port to OpenBSD 3.9. Patch from Aldo Cortesi. ........
Diffstat (limited to 'Mac/IDE scripts')
-rw-r--r--Mac/IDE scripts/ separator ---1
-rw-r--r--Mac/IDE scripts/Hack/Debugger off4
-rw-r--r--Mac/IDE scripts/Hack/Debugger on5
-rw-r--r--Mac/IDE scripts/Hack/Remove .pyc files...22
-rw-r--r--Mac/IDE scripts/Hack/Toolbox Assistant...45
-rw-r--r--Mac/IDE scripts/Hold option to open a script...4
-rw-r--r--Mac/IDE scripts/Insert file name...6
-rw-r--r--Mac/IDE scripts/Insert folder name...6
-rw-r--r--Mac/IDE scripts/Search Python Documentation...4
-rw-r--r--Mac/IDE scripts/Widget demos/ActivateWindowDemo.py21
-rw-r--r--Mac/IDE scripts/Widget demos/KeyTester.py34
-rw-r--r--Mac/IDE scripts/Widget demos/ListWindow.py17
-rw-r--r--Mac/IDE scripts/Widget demos/ModalDialog.py10
-rw-r--r--Mac/IDE scripts/Widget demos/PaneDemo.py14
-rw-r--r--Mac/IDE scripts/Widget demos/PaneDemo2.py16
-rw-r--r--Mac/IDE scripts/Widget demos/ScrollbarWindow.py17
-rw-r--r--Mac/IDE scripts/Widget demos/TwoLists.py22
-rw-r--r--Mac/IDE scripts/Widget demos/WidgetTest.py85
-rw-r--r--Mac/IDE scripts/separator ---1
19 files changed, 0 insertions, 334 deletions
diff --git a/Mac/IDE scripts/ separator --- b/Mac/IDE scripts/ separator ---
deleted file mode 100644
index 74cd7fc..0000000
--- a/Mac/IDE scripts/ separator ---
+++ /dev/null
@@ -1 +0,0 @@
-A separator ends with '---' \ No newline at end of file
diff --git a/Mac/IDE scripts/Hack/Debugger off b/Mac/IDE scripts/Hack/Debugger off
deleted file mode 100644
index ba68b49..0000000
--- a/Mac/IDE scripts/Hack/Debugger off
+++ /dev/null
@@ -1,4 +0,0 @@
-"""Turn the debugger off."""
-
-import PyDebugger
-PyDebugger.cont()
diff --git a/Mac/IDE scripts/Hack/Debugger on b/Mac/IDE scripts/Hack/Debugger on
deleted file mode 100644
index 63eee83..0000000
--- a/Mac/IDE scripts/Hack/Debugger on
+++ /dev/null
@@ -1,5 +0,0 @@
-"""This script turns the Python debugger on globally, meaning that
-it will then stop at any breakpoint you might have defined."""
-
-import PyDebugger
-PyDebugger.startfrombottom()
diff --git a/Mac/IDE scripts/Hack/Remove .pyc files... b/Mac/IDE scripts/Hack/Remove .pyc files...
deleted file mode 100644
index 7d860a9..0000000
--- a/Mac/IDE scripts/Hack/Remove .pyc files...
+++ /dev/null
@@ -1,22 +0,0 @@
-import sys
-import os
-import macfs
-
-def walk(top):
- names = os.listdir(top)
- for name in names:
- path = os.path.join(top, name)
- if os.path.isdir(path):
- walk(path)
- else:
- if path[-4:] in ['.pyc', '.pyo'] and os.path.exists(path[:-1]):
- print "deleting:", path
- os.remove(path)
- elif path[-4:] == '.pyc':
- print "!!! ------ .pyc file without .py file:", path
- elif path[-4:] == '.pyo':
- print "!!! ------ .pyo file without .py file:", path
-
-fss, ok = macfs.GetDirectory('Select the starting folder:')
-if ok:
- walk(fss.as_pathname())
diff --git a/Mac/IDE scripts/Hack/Toolbox Assistant... b/Mac/IDE scripts/Hack/Toolbox Assistant...
deleted file mode 100644
index b47274a..0000000
--- a/Mac/IDE scripts/Hack/Toolbox Assistant...
+++ /dev/null
@@ -1,45 +0,0 @@
-import aetools
-import Standard_Suite
-import Required_Suite
-import MacOS
-import W
-
-
-class Toolbox(aetools.TalkTo, Standard_Suite.Standard_Suite):
-
- def LookupTopic(self, _object, _attributes={}, **_arguments):
- _code = 'DanR'
- _subcode = 'REF '
-
- _arguments['----'] = _object
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.has_key('errn'):
- raise MacOS.Error, aetools.decodeerror(_arguments)
-
-
-class ToolboxAssi:
-
- def __init__(self):
- self.talker = None
- self.w = W.Window((200, 100), "Toolbox Assistant")
- self.w.button = W.Button((-94, -32, 80, 16), "Lookup", self.lookup)
- self.w.prompt = W.TextBox((10, 8, -10, 15), "Enter topic:")
- self.w.edit = W.EditText((10, 24, -10, 20))
- self.w.setdefaultbutton(self.w.button)
- self.w.open()
-
- def lookup(self):
- if self.talker is None:
- try:
- self.talker = Toolbox('ALTV', start = 1)
- except:
- raise W.AlertError, "CanÕt find –Toolbox Assistant”"
- lookup = self.w.edit.get()
- try:
- self.talker.LookupTopic(lookup)
- except MacOS.Error, detail:
- W.Message("Requested topic not found.\r(%d)" % detail[0])
-
-t = ToolboxAssi()
diff --git a/Mac/IDE scripts/Hold option to open a script... b/Mac/IDE scripts/Hold option to open a script...
deleted file mode 100644
index 062c64c..0000000
--- a/Mac/IDE scripts/Hold option to open a script...
+++ /dev/null
@@ -1,4 +0,0 @@
-"Hold the option key to open a script instead of running it."
-
-import W
-W.Message(__doc__)
diff --git a/Mac/IDE scripts/Insert file name... b/Mac/IDE scripts/Insert file name...
deleted file mode 100644
index 7632f8e..0000000
--- a/Mac/IDE scripts/Insert file name...
+++ /dev/null
@@ -1,6 +0,0 @@
-import macfs
-
-fss, ok = macfs.StandardGetFile()
-if ok:
- import W
- W.FrontWindowInsert('"%s"' % fss.as_pathname())
diff --git a/Mac/IDE scripts/Insert folder name... b/Mac/IDE scripts/Insert folder name...
deleted file mode 100644
index 1a9e06b..0000000
--- a/Mac/IDE scripts/Insert folder name...
+++ /dev/null
@@ -1,6 +0,0 @@
-import macfs
-
-fss, ok = macfs.GetDirectory()
-if ok:
- import W
- W.FrontWindowInsert('"%s"' % fss.as_pathname())
diff --git a/Mac/IDE scripts/Search Python Documentation... b/Mac/IDE scripts/Search Python Documentation...
deleted file mode 100644
index 2156b95..0000000
--- a/Mac/IDE scripts/Search Python Documentation...
+++ /dev/null
@@ -1,4 +0,0 @@
-import PyDocSearch
-# set the creator of the browser. 'MSIE' = Exploser, 'MOSS' = Netscape
-PyDocSearch.SIGNATURE = 'MOSS'
-pds = PyDocSearch.PyDocSearch()
diff --git a/Mac/IDE scripts/Widget demos/ActivateWindowDemo.py b/Mac/IDE scripts/Widget demos/ActivateWindowDemo.py
deleted file mode 100644
index d8fc946..0000000
--- a/Mac/IDE scripts/Widget demos/ActivateWindowDemo.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import W
-
-# this demoscript illustrates how to tie a callback to activating or clicking away of the window.
-# evb 22 4 99
-
-class ActivateDemo:
-
- def __init__(self):
- self.w = W.Window((200, 200), 'Activate demo')
- self.w.bind("<activate>", self.my_activate_callback)
- self.w.open()
-
- def my_activate_callback(self, onoff):
- '''the callback gets 1 parameter which indicates whether the window
- has been activated (1) or clicked to the back (0)'''
- if onoff == 1:
- print "I'm in the front now!"
- else:
- print "I've been clicked away, Oh No!"
-
-ad = ActivateDemo()
diff --git a/Mac/IDE scripts/Widget demos/KeyTester.py b/Mac/IDE scripts/Widget demos/KeyTester.py
deleted file mode 100644
index ae47550..0000000
--- a/Mac/IDE scripts/Widget demos/KeyTester.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""Simple W demo -- shows how to make a window, and bind a function to a "key" event."""
-
-import W
-
-# key callback function
-def tester(char, event):
- text = "%r\r%d\r%s\r%s" % (char, ord(char), hex(ord(chart)), oct(ord(char)))
- window.keys.set(text)
-
-# close callback
-def close():
- window.close()
-
-# new window
-window = W.Dialog((180, 100), "Type a character")
-
-# make a frame (a simple rectangle)
-window.frame = W.Frame((5, 5, -5, -33))
-
-# some labels, static text
-window.captions = W.TextBox((10, 9, 43, -36), "char:\rdecimal:\rhex:\roctal:")
-
-# another static text box
-window.keys = W.TextBox((60, 9, 40, -36))
-
-# a button
-window.button = W.Button((-69, -24, 60, 16), "Done", close)
-
-# bind the callbacks
-window.bind("<key>", tester)
-window.bind("cmdw", window.button.push)
-
-# open the window
-window.open()
diff --git a/Mac/IDE scripts/Widget demos/ListWindow.py b/Mac/IDE scripts/Widget demos/ListWindow.py
deleted file mode 100644
index f78b4b8..0000000
--- a/Mac/IDE scripts/Widget demos/ListWindow.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import W
-
-def listhit(isdbl):
- if isdbl:
- print "double-click in list!"
- else:
- print "click in list."
-
-window = W.Window((200, 400), "Window with List", minsize = (150, 200))
-
-window.list = W.List((-1, 20, 1, -14), [], listhit)
-
-# or (equivalent):
-# window.list = W.List((-1, 20, 1, -14), callback = listhit)
-
-window.list.set(range(13213, 13350))
-window.open()
diff --git a/Mac/IDE scripts/Widget demos/ModalDialog.py b/Mac/IDE scripts/Widget demos/ModalDialog.py
deleted file mode 100644
index 801dfd4..0000000
--- a/Mac/IDE scripts/Widget demos/ModalDialog.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import W
-from Carbon import Windows
-
-
-w = W.ModalDialog((100, 100))
-
-w.ed = W.EditText((10, 10, 80, 50))
-w.ok = W.Button((10, 70, 80, 16), "Ok", w.close)
-w.setdefaultbutton(w.ok)
-w.open()
diff --git a/Mac/IDE scripts/Widget demos/PaneDemo.py b/Mac/IDE scripts/Widget demos/PaneDemo.py
deleted file mode 100644
index 5d991b0..0000000
--- a/Mac/IDE scripts/Widget demos/PaneDemo.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import W
-
-w = W.Window((600, 400), "Ha!", minsize = (240, 200))
-
-w.panes = W.HorizontalPanes((8, 8, -30, -8), (0.3, 0.3, 0.4))
-w.panes.blah1 = W.EditText(None, "eehhh...")
-w.panes.blah2 = W.EditText((8, 8, -8, -8), "xxx nou...")
-w.panes.panes = W.VerticalPanes(None, (0.3, 0.4, 0.3))
-w.panes.panes.blah1 = W.EditText(None, "eehhh...")
-w.panes.panes.blah2 = W.Frame(None)
-w.panes.panes.blah2.t = W.EditText((0, 0, 0, 0), "nou...")
-w.panes.panes.blah3 = W.List(None, ["eehhh...", 'abc', 'def'])
-
-w.open()
diff --git a/Mac/IDE scripts/Widget demos/PaneDemo2.py b/Mac/IDE scripts/Widget demos/PaneDemo2.py
deleted file mode 100644
index 7ed06de..0000000
--- a/Mac/IDE scripts/Widget demos/PaneDemo2.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import W
-
-w = W.Window((600, 400), "Ha!", minsize = (240, 200))
-
-w.panes = W.HorizontalPanes((8, 8, -8, -20), (0.6, 0.4))
-
-w.panes.panes = W.VerticalPanes(None, (0.3, 0.4, 0.3))
-w.panes.panes.blah1 = W.EditText(None, "eehhh...")
-w.panes.panes.blah2 = W.EditText(None, "nou...")
-w.panes.panes.blah3 = W.List(None, ["eehhh...", 'abc', 'def'])
-
-w.panes.group = W.Group(None)
-w.panes.group.mytext = W.EditText((0, 24, 0, 0), "eehhh...")
-w.panes.group.button1 = W.Button((0, 0, 80, 16), "A Button")
-
-w.open()
diff --git a/Mac/IDE scripts/Widget demos/ScrollbarWindow.py b/Mac/IDE scripts/Widget demos/ScrollbarWindow.py
deleted file mode 100644
index 5fc1b96..0000000
--- a/Mac/IDE scripts/Widget demos/ScrollbarWindow.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import W
-
-# make a non-sizable window
-#window = W.Window((200, 200), "Fixed Size")
-
-# make a sizable window
-window = W.Window((200, 300), "Variable Size!", minsize = (200, 200))
-
-# make some edit text widgets
-# a scrollbar
-window.hbar = W.Scrollbar((-1, -15, -14, 16), max = 100)
-window.vbar = W.Scrollbar((-15, -1, 16, -14), max = 100)
-#window.vbar = W.Scrollbar((-15, -1, 1, -14), max = 100)
-
-
-# open the window
-window.open()
diff --git a/Mac/IDE scripts/Widget demos/TwoLists.py b/Mac/IDE scripts/Widget demos/TwoLists.py
deleted file mode 100644
index f1b58f2..0000000
--- a/Mac/IDE scripts/Widget demos/TwoLists.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import W
-
-def twothird(width, height):
- return (8, 8, width - 8, 2*height/3 - 4)
-
-def onethird(width, height):
- return (8, 2*height/3 + 4, width - 8, height - 22)
-
-def halfbounds1(width, height):
- return (0, 0, width/2 - 4, height)
-
-def halfbounds2(width, height):
- return (width/2 + 4, 0, width, height)
-
-window = W.Window((400, 400), "Sizable window with two lists", minsize = (200, 200))
-
-window.listgroup = W.Group(twothird)
-window.listgroup.list1 = W.List(halfbounds1, range(13213, 13310))
-window.listgroup.list2 = W.List(halfbounds2, range(800, 830))
-window.et = W.EditText(onethird, "Wat nu weer?")
-
-window.open()
diff --git a/Mac/IDE scripts/Widget demos/WidgetTest.py b/Mac/IDE scripts/Widget demos/WidgetTest.py
deleted file mode 100644
index a2e8d08..0000000
--- a/Mac/IDE scripts/Widget demos/WidgetTest.py
+++ /dev/null
@@ -1,85 +0,0 @@
-import W
-
-# define some callbacks
-def callback():
- window.close()
-
-def checkcallback(value):
- print "hit the checkbox", value
-
-def radiocallback(value):
- print "hit radiobutton #3", value
-
-def scrollcallback(value):
- widget = window.hbar
- if value == "+":
- widget.set(widget.get() - 1)
- elif value == "-":
- widget.set(widget.get() + 1)
- elif value == "++":
- widget.set(widget.get() - 10)
- elif value == "--":
- widget.set(widget.get() + 10)
- else: # in thumb
- widget.set(value)
- print "scroll...", widget.get()
-
-def textcallback():
- window.et3.set(window.et1.get())
-
-def cancel():
- import EasyDialogs
- EasyDialogs.Message("Cancel!")
-
-# make a non-sizable window
-#window = W.Window((200, 300), "Fixed Size")
-
-# make a sizable window
-window = W.Window((200, 300), "Variable Size!", minsize = (200, 300))
-
-# make some edit text widgets
-window.et1 = W.EditText((10, 10, 110, 110), "Hallo!", textcallback)
-window.et2 = W.EditText((130, 40, 60, 30), "one!")
-window.et3 = W.EditText((130, 80, -10, 40), "two?")
-
-# a button
-window.button = W.Button((-70, 10, 60, 16), "Close", callback)
-
-# a checkbox
-window.ch = W.CheckBox((10, 130, 160, 16), "Check (command \xa4)", checkcallback)
-
-# set of radio buttons (should become easier/nicer)
-thebuttons = []
-window.r1 = W.RadioButton((10, 150, 180, 16), "Radio 1 (cmd 1)", thebuttons)
-window.r2 = W.RadioButton((10, 170, 180, 16), "Radio 2 (cmd 2)", thebuttons)
-window.r3 = W.RadioButton((10, 190, 180, 16), "Radio 3 (cmd 3)", thebuttons, radiocallback)
-window.r1.set(1)
-
-# a normal button
-window.cancelbutton = W.Button((10, 220, 60, 16), "Cancel", cancel)
-
-# a scrollbar
-window.hbar = W.Scrollbar((-1, -15, -14, 16), scrollcallback, max = 100)
-
-# some static text
-window.static = W.TextBox((10, 260, 110, 16), "Schtatic")
-
-# bind some keystrokes to functions
-window.bind('cmd\xa4', window.ch.push)
-window.bind('cmd1', window.r1.push)
-window.bind('cmd2', window.r2.push)
-window.bind('cmd3', window.r3.push)
-window.bind('cmdw', window.button.push)
-window.bind('cmd.', window.cancelbutton.push)
-
-window.setdefaultbutton(window.button)
-# open the window
-window.open()
-
-if 0:
- import time
- for i in range(20):
- window.et2.set(repr(i))
- #window.et2.SetPort()
- #window.et2.draw()
- time.sleep(0.1)
diff --git a/Mac/IDE scripts/separator --- b/Mac/IDE scripts/separator ---
deleted file mode 100644
index 74cd7fc..0000000
--- a/Mac/IDE scripts/separator ---
+++ /dev/null
@@ -1 +0,0 @@
-A separator ends with '---' \ No newline at end of file