1995-11-14 11:35:17 +00:00
|
|
|
"""A test program that allows us to control Eudora"""
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import aetools
|
|
|
|
import Eudora_Suite
|
|
|
|
import Required_Suite
|
1997-08-27 14:07:37 +00:00
|
|
|
import Standard_Suite
|
1995-11-14 11:35:17 +00:00
|
|
|
import MacOS
|
|
|
|
|
1997-08-27 14:07:37 +00:00
|
|
|
class Eudora(Eudora_Suite.Eudora_Suite, Required_Suite.Required_Suite, \
|
|
|
|
Standard_Suite.Standard_Suite, aetools.TalkTo):
|
1995-11-14 11:35:17 +00:00
|
|
|
"""A class that can talk to Eudora"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
# The Creator signature of eudora:
|
1996-09-20 15:22:47 +00:00
|
|
|
SIGNATURE="CSOm"
|
1995-11-14 11:35:17 +00:00
|
|
|
|
|
|
|
def main():
|
1996-09-20 15:22:47 +00:00
|
|
|
talker = Eudora(SIGNATURE, start=1)
|
1995-11-14 11:35:17 +00:00
|
|
|
while 1:
|
1997-08-27 14:07:37 +00:00
|
|
|
print 'get, put, name (of first folder), list (foldernames), quit (eudora) or exit (this program) ?'
|
1995-11-14 11:35:17 +00:00
|
|
|
line = sys.stdin.readline()
|
|
|
|
try:
|
|
|
|
if line[0] == 'g':
|
|
|
|
talker.connect(checking=1)
|
|
|
|
elif line[0] == 'p':
|
|
|
|
talker.connect(sending=1)
|
1997-08-27 14:07:37 +00:00
|
|
|
elif line[0] == 'n':
|
|
|
|
id = Eudora_Suite.mailbox(1).name
|
|
|
|
name = talker._get(id, as='text')
|
|
|
|
print "It is called", name
|
|
|
|
elif line[0] == 'l':
|
|
|
|
pass
|
1995-11-14 11:35:17 +00:00
|
|
|
elif line[0] == 'q':
|
|
|
|
talker.quit()
|
|
|
|
elif line[0] == 'e':
|
|
|
|
break
|
|
|
|
except MacOS.Error, arg:
|
|
|
|
if arg[0] == -609:
|
|
|
|
print 'Connection invalid, is eudora running?'
|
|
|
|
else:
|
1996-11-20 15:40:42 +00:00
|
|
|
print 'MacOS Error:', arg[1]
|
|
|
|
except aetools.Error, arg:
|
|
|
|
print 'Eudora returned error:', arg
|
1995-11-14 11:35:17 +00:00
|
|
|
|
|
|
|
main()
|