Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3f81424f
Commit
3f81424f
authored
Aug 03, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
These stopped working a long time ago, and they're not worth fixing.
parent
6ddd7366
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
132 deletions
+0
-132
Mac/Lib/test/tae.py
Mac/Lib/test/tae.py
+0
-112
Mac/Lib/test/tctl.py
Mac/Lib/test/tctl.py
+0
-20
No files found.
Mac/Lib/test/tae.py
deleted
100644 → 0
View file @
6ddd7366
# The oldest AppleEvent test program.
# Its function has been overtaken by echo.py and tell.py.
import
AE
from
AppleEvents
import
*
import
Evt
from
Events
import
*
import
struct
import
aetools
import
macfs
import
sys
import
MacOS
MacOS
.
SchedParams
(
1
,
0
)
def
aehandler
(
request
,
reply
):
tosend
=
[]
print
'request:'
,
aetools
.
unpackevent
(
request
)
param
=
request
.
AEGetParamDesc
(
keyDirectObject
,
typeWildCard
)
if
param
.
type
==
typeAEList
:
n
=
param
.
AECountItems
()
print
'List has'
,
n
,
'items'
for
i
in
range
(
1
,
1
+
n
):
type
,
item
=
param
.
AEGetNthDesc
(
i
,
typeFSS
)
data
=
item
.
data
print
'item'
,
i
,
':'
,
type
,
item
.
type
,
len
(
data
),
'bytes'
vol
,
dir
,
fnlen
=
struct
.
unpack
(
'hlb'
,
data
[:
7
])
filename
=
data
[
7
:
7
+
fnlen
]
print
'vol:'
,
vol
,
'; dir:'
,
dir
,
'; filename:'
,
`filename`
print
'full path:'
,
macfs
.
FSSpec
((
vol
,
dir
,
filename
)).
as_pathname
()
tosend
.
append
(
item
)
else
:
pass
print
'param:'
,
(
param
.
type
,
param
.
data
[:
20
]),
param
.
data
[
20
:]
and
'...'
if
tosend
:
passtothink
(
tosend
)
def
passtothink
(
list
):
target
=
AE
.
AECreateDesc
(
typeApplSignature
,
'KAHL'
)
event
=
AE
.
AECreateAppleEvent
(
kCoreEventClass
,
kAEOpenDocuments
,
target
,
kAutoGenerateReturnID
,
kAnyTransactionID
)
aetools
.
packevent
(
event
,
{
keyDirectObject
:
list
})
reply
=
event
.
AESend
(
kAENoReply
|
kAEAlwaysInteract
|
kAECanSwitchLayer
,
kAENormalPriority
,
kAEDefaultTimeout
)
#print "Reply:", aetools.unpackevent(reply)
return
event
=
AE
.
AECreateAppleEvent
(
kCoreEventClass
,
kAEOpenApplication
,
target
,
kAutoGenerateReturnID
,
kAnyTransactionID
)
reply
=
event
.
AESend
(
kAENoReply
|
kAEAlwaysInteract
|
kAECanSwitchLayer
,
kAENormalPriority
,
kAEDefaultTimeout
)
def
unihandler
(
req
,
rep
):
print
'unihandler'
aehandler
(
req
,
rep
)
quit
=
0
def
quithandler
(
req
,
rep
):
global
quit
quit
=
1
def
corehandler
(
req
,
rep
):
print
'core event!'
parameters
,
attributes
=
aetools
.
unpackevent
(
req
)
print
"event class ="
,
attributes
[
'evcl'
]
print
"event id ="
,
attributes
[
'evid'
]
print
'parameters:'
,
parameters
# echo the arguments, to see how Script Editor formats them
aetools
.
packevent
(
rep
,
parameters
)
def
wildhandler
(
req
,
rep
):
print
'wildcard event!'
parameters
,
attributes
=
aetools
.
unpackevent
(
req
)
print
"event class ="
,
attributes
[
'evcl'
]
print
"event id ="
,
attributes
[
'evid'
]
print
'parameters:'
,
parameters
AE
.
AEInstallEventHandler
(
typeAppleEvent
,
kAEOpenApplication
,
aehandler
)
AE
.
AEInstallEventHandler
(
typeAppleEvent
,
kAEOpenDocuments
,
aehandler
)
AE
.
AEInstallEventHandler
(
typeAppleEvent
,
kAEPrintDocuments
,
aehandler
)
AE
.
AEInstallEventHandler
(
typeAppleEvent
,
kAEQuitApplication
,
quithandler
)
AE
.
AEInstallEventHandler
(
typeAppleEvent
,
typeWildCard
,
unihandler
)
AE
.
AEInstallEventHandler
(
'core'
,
typeWildCard
,
corehandler
)
#AE.AEInstallEventHandler(typeWildCard, typeWildCard, wildhandler)
def
main
():
global
quit
quit
=
0
while
not
quit
:
ok
,
e
=
Evt
.
WaitNextEvent
(
-
1
,
60
)
if
ok
:
print
'Event:'
,
e
if
e
[
0
]
==
23
:
# kHighLevelEvent
AE
.
AEProcessAppleEvent
(
e
)
elif
e
[
0
]
==
keyDown
and
chr
(
e
[
1
]
&
0xff
)
==
'.'
and
e
[
4
]
&
cmdKey
:
raise
KeyboardInterrupt
,
"Command-Period"
else
:
MacOS
.
HandleEvent
(
e
)
if
__name__
==
'__main__'
:
main
()
print
"This module is obsolete -- use echo.py or tell.py ..."
Mac/Lib/test/tctl.py
deleted
100644 → 0
View file @
6ddd7366
# play with controls
from
Dlg
import
*
from
Ctl
import
*
from
Win
import
*
from
Evt
import
*
import
time
import
sys
def
main
():
r
=
(
40
,
40
,
400
,
300
)
w
=
NewWindow
(
r
,
"The Spanish Inquisition"
,
1
,
0
,
-
1
,
1
,
0x55555555
)
w
.
DrawGrowIcon
()
r
=
(
40
,
40
,
100
,
60
)
c
=
NewControl
(
w
,
r
,
"SPAM!"
,
1
,
0
,
0
,
1
,
0
,
0
)
print
'Ok, try it...'
sys
.
exit
(
1
)
# So we can see what happens...
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment