Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5968badb
Kaydet (Commit)
5968badb
authored
Tem 29, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- Use new names
- Use AEInteractWithUser
üst
39fe80b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
echo.py
Mac/Lib/test/echo.py
+13
-6
No files found.
Mac/Lib/test/echo.py
Dosyayı görüntüle @
5968badb
...
...
@@ -33,6 +33,11 @@ import EasyDialogs
kHighLevelEvent
=
23
# Not defined anywhere for Python yet?
def
mymessage
(
str
):
err
=
AE
.
AEInteractWithUser
(
kAEDefaultTimeout
)
if
err
:
print
str
EasyDialogs
.
Message
(
str
)
def
main
():
echo
=
EchoServer
()
...
...
@@ -46,18 +51,20 @@ def main():
class
EchoServer
:
suites
=
[
'aevt'
,
'core'
]
#suites = ['aevt', 'core', 'reqd']
suites
=
[
'****'
]
def
__init__
(
self
):
self
.
active
=
0
for
suite
in
self
.
suites
:
AE
.
AEInstallEventHandler
(
suite
,
typeWildCard
,
self
.
aehandler
)
print
(
suite
,
typeWildCard
,
self
.
aehandler
)
self
.
active
=
1
self
.
appleid
=
1
Menu
.
ClearMenuBar
()
self
.
applemenu
=
applemenu
=
Menu
.
NewMenu
(
self
.
appleid
,
"
\024
"
)
applemenu
.
AppendMenu
(
"All about echo...;(-"
)
applemenu
.
A
d
dResMenu
(
'DRVR'
)
applemenu
.
A
ppen
dResMenu
(
'DRVR'
)
applemenu
.
InsertMenu
(
0
)
Menu
.
DrawMenuBar
()
...
...
@@ -88,10 +95,10 @@ class EchoServer:
try
:
AE
.
AEProcessAppleEvent
(
event
)
except
AE
.
Error
,
err
:
EasyDialogs
.
M
essage
(
msg
+
"
\015
AEProcessAppleEvent error:
%
s"
%
str
(
err
))
mym
essage
(
msg
+
"
\015
AEProcessAppleEvent error:
%
s"
%
str
(
err
))
traceback
.
print_exc
()
else
:
EasyDialogs
.
M
essage
(
msg
+
"
\015
OK!"
)
mym
essage
(
msg
+
"
\015
OK!"
)
elif
what
==
keyDown
:
c
=
chr
(
message
&
charCodeMask
)
if
c
==
'.'
and
modifiers
&
cmdKey
:
...
...
@@ -105,7 +112,7 @@ class EchoServer:
item
=
result
&
0xffff
# Lo word
if
id
==
self
.
appleid
:
if
item
==
1
:
EasyDialogs
.
M
essage
(
"Echo -- echo AppleEvents"
)
mym
essage
(
"Echo -- echo AppleEvents"
)
elif
item
>
1
:
name
=
self
.
applemenu
.
GetItem
(
item
)
Qd
.
OpenDeskAcc
(
name
)
...
...
@@ -114,7 +121,7 @@ class EchoServer:
## MacOS.HandleEvent(event)
def
aehandler
(
self
,
request
,
reply
):
print
"Apple Event
"
,
print
"Apple Event
!"
parameters
,
attributes
=
aetools
.
unpackevent
(
request
)
print
"class ="
,
`attributes['evcl'].type`
,
print
"id ="
,
`attributes['evid'].type`
...
...
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