mirror of
https://github.com/python/cpython.git
synced 2025-11-11 11:01:39 +00:00
Initial revision
This commit is contained in:
parent
7cc5735ef2
commit
cb5704e6a8
36 changed files with 8306 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
"Hold the option key to open a script instead of running it."
|
||||
|
||||
import W
|
||||
W.Message(__doc__)
|
||||
1
Mac/Contrib/PyIDE-src/Scripts/ separator ---
Normal file
1
Mac/Contrib/PyIDE-src/Scripts/ separator ---
Normal file
|
|
@ -0,0 +1 @@
|
|||
A separator ends with '---'
|
||||
20
Mac/Contrib/PyIDE-src/Scripts/Hack/Remove .pyc files
Normal file
20
Mac/Contrib/PyIDE-src/Scripts/Hack/Remove .pyc files
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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:] == '.pyc' and os.path.exists(path[:-1]):
|
||||
print "deleting:", path
|
||||
os.remove(path)
|
||||
elif path[-4:] == '.pyc':
|
||||
print "!!! ------ .pyc file without .py file:", path
|
||||
|
||||
fss, ok = macfs.GetDirectory('Select the starting folder:')
|
||||
if ok:
|
||||
walk(fss.as_pathname())
|
||||
53
Mac/Contrib/PyIDE-src/Scripts/Hack/Toolbox Assistant
Normal file
53
Mac/Contrib/PyIDE-src/Scripts/Hack/Toolbox Assistant
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
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 '
|
||||
|
||||
#aetools.keysubst(_arguments, self._argmap_OpenURL)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.has_key('errn'):
|
||||
raise MacOS.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
class ToolboxAssi:
|
||||
|
||||
def __init__(self):
|
||||
self.talker = Toolbox('ALTV')
|
||||
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):
|
||||
lookup = self.w.edit.get()
|
||||
try:
|
||||
self.talker.LookupTopic(lookup)
|
||||
except MacOS.Error, detail:
|
||||
if type(detail) == type(()):
|
||||
if detail[0] == -609:
|
||||
self.talker.start()
|
||||
try:
|
||||
self.talker.LookupTopic(lookup)
|
||||
return
|
||||
except MacOS.Error:
|
||||
pass
|
||||
W.Message("Requested topic not found.")
|
||||
|
||||
ToolboxAssi()
|
||||
0
Mac/Contrib/PyIDE-src/Scripts/Insert
Normal file
0
Mac/Contrib/PyIDE-src/Scripts/Insert
Normal file
6
Mac/Contrib/PyIDE-src/Scripts/Insert file name
Normal file
6
Mac/Contrib/PyIDE-src/Scripts/Insert file name
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import macfs
|
||||
|
||||
fss, ok = macfs.StandardGetFile()
|
||||
if ok:
|
||||
import W
|
||||
W.FrontWindowInsert('"%s"' % fss.as_pathname())
|
||||
6
Mac/Contrib/PyIDE-src/Scripts/Insert folder name
Normal file
6
Mac/Contrib/PyIDE-src/Scripts/Insert folder name
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import macfs
|
||||
|
||||
fss, ok = macfs.GetDirectory()
|
||||
if ok:
|
||||
import W
|
||||
W.FrontWindowInsert('"%s"' % fss.as_pathname())
|
||||
Loading…
Add table
Add a link
Reference in a new issue