mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Moved PythonScript to unsupported at Bill Bedford's request. It'll go
away completely next release, unless someone complains.
This commit is contained in:
parent
de3d060eb2
commit
f0a2ac9d5b
9 changed files with 0 additions and 0 deletions
44
Mac/Unsupported/PythonScript/testeudora.py
Normal file
44
Mac/Unsupported/PythonScript/testeudora.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
"""A test program that allows us to control Eudora"""
|
||||
|
||||
import sys
|
||||
import MacOS
|
||||
import PythonScript
|
||||
|
||||
# The Creator signature of eudora:
|
||||
SIGNATURE="CSOm"
|
||||
TIMEOUT = 10*60*60
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
PythonScript.PsScript(SIGNATURE, TIMEOUT)
|
||||
talker = PythonScript.PyScript
|
||||
ev = PythonScript.PsEvents
|
||||
pc = PythonScript.PsClass
|
||||
while 1:
|
||||
print 'get, put, name (of first folder), list (foldernames), quit (eudora) or exit (this program) ?'
|
||||
line = sys.stdin.readline()
|
||||
try:
|
||||
if line[0] == 'g':
|
||||
print 'check'
|
||||
print talker(ev.Activate)
|
||||
print talker(ev.Connect, Checking=1)
|
||||
elif line[0] == 'p':
|
||||
print talker(ev.Connect, Sending=1)
|
||||
elif line[0] == 'n':
|
||||
id = talker(ev.Get, pc.Mail_folder("").Mailbox(1).Name())
|
||||
print "It is called", id, "\n"
|
||||
elif line[0] == 'l':
|
||||
id = talker(ev.Count, pc.Mail_folder(""), Each='Mailbox')
|
||||
print "There are", id, "mailboxes"
|
||||
elif line[0] == 'q':
|
||||
print talker(ev.Quit)
|
||||
elif line[0] == 'e':
|
||||
break
|
||||
except MacOS.Error, arg:
|
||||
if arg[0] == -609:
|
||||
print 'Connection invalid, is eudora running?'
|
||||
else:
|
||||
print 'MacOS Error:', arg[1]
|
||||
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue