summaryrefslogtreecommitdiffstats
path: root/Mac/IDE scripts/Hack
diff options
context:
space:
mode:
authorJust van Rossum <just@lettererror.com>1999-09-26 12:25:06 (GMT)
committerJust van Rossum <just@lettererror.com>1999-09-26 12:25:06 (GMT)
commita840fca15590f2369bb5381be86d13ce12563f73 (patch)
tree799bb9ec5ffb6efb132ffd8c8256eb8b8710818e /Mac/IDE scripts/Hack
parentb7ad821f022a62656677b03f1d081e1e284047ea (diff)
downloadcpython-a840fca15590f2369bb5381be86d13ce12563f73.zip
cpython-a840fca15590f2369bb5381be86d13ce12563f73.tar.gz
cpython-a840fca15590f2369bb5381be86d13ce12563f73.tar.bz2
Initial checkin of IDE scripts. (jvr)
Diffstat (limited to 'Mac/IDE scripts/Hack')
-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
4 files changed, 76 insertions, 0 deletions
diff --git a/Mac/IDE scripts/Hack/Debugger off b/Mac/IDE scripts/Hack/Debugger off
new file mode 100644
index 0000000..ba68b49
--- /dev/null
+++ b/Mac/IDE scripts/Hack/Debugger off
@@ -0,0 +1,4 @@
+"""Turn the debugger off."""
+
+import PyDebugger
+PyDebugger.cont()
diff --git a/Mac/IDE scripts/Hack/Debugger on b/Mac/IDE scripts/Hack/Debugger on
new file mode 100644
index 0000000..63eee83
--- /dev/null
+++ b/Mac/IDE scripts/Hack/Debugger on
@@ -0,0 +1,5 @@
+"""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...
new file mode 100644
index 0000000..7d860a9
--- /dev/null
+++ b/Mac/IDE scripts/Hack/Remove .pyc files...
@@ -0,0 +1,22 @@
+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...
new file mode 100644
index 0000000..afd7846
--- /dev/null
+++ b/Mac/IDE scripts/Hack/Toolbox Assistant...
@@ -0,0 +1,45 @@
+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()