mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Modified for new scripting support
This commit is contained in:
parent
21b5d605d8
commit
9ffa432972
2 changed files with 266 additions and 70 deletions
|
|
@ -10,41 +10,6 @@ import MacOS
|
||||||
|
|
||||||
_code = 'CSOm'
|
_code = 'CSOm'
|
||||||
|
|
||||||
_Enum_eSta = {
|
|
||||||
'unread' : 'euS\001', # has not been read
|
|
||||||
'already_read' : 'euS\002', # has been read
|
|
||||||
'replied' : 'euS\003', # has been replied to
|
|
||||||
'forwarded' : 'euS\010', # has been forwarded
|
|
||||||
'redirected' : 'euS\004', # has been redirected
|
|
||||||
'not_sendable' : 'euS\005', # cannot be sent
|
|
||||||
'sendable' : 'euS\006', # can be sent
|
|
||||||
'queued' : 'euS\007', # queued for delivery
|
|
||||||
'sent' : 'euS\011', # has been sent
|
|
||||||
'never_sent' : 'euS\012', # never was sent
|
|
||||||
}
|
|
||||||
|
|
||||||
_Enum_eSig = {
|
|
||||||
'none' : 'sig\000', # no signature
|
|
||||||
'standard' : 'sig\001', # standard signature file
|
|
||||||
'alternate' : 'sig\002', # alternate signature file
|
|
||||||
}
|
|
||||||
|
|
||||||
_Enum_eAty = {
|
|
||||||
'AppleDouble' : 'atc\000', # AppleDouble format
|
|
||||||
'AppleSingle' : 'atc\001', # AppleSingle format
|
|
||||||
'BinHex' : 'atc\002', # BinHex format
|
|
||||||
'uuencode' : 'atc\003', # uuencode format
|
|
||||||
}
|
|
||||||
|
|
||||||
_Enum_eNot = {
|
|
||||||
'mail_arrives' : 'wArv', # mail arrival
|
|
||||||
'mail_sent' : 'wSnt', # mail has been sent
|
|
||||||
'will_connect' : 'wWCn', # eudora is about to connect to a mail server
|
|
||||||
'has_connected' : 'wHCn', # eudora has finished talking to a mail server
|
|
||||||
'has_manually_filtered' : 'mFil', # eudora has finished manually filtering messages
|
|
||||||
'opens_filters' : 'wFil', # user has requested Eudora open the filter window
|
|
||||||
}
|
|
||||||
|
|
||||||
class Eudora_Suite:
|
class Eudora_Suite:
|
||||||
|
|
||||||
_argmap_connect = {
|
_argmap_connect = {
|
||||||
|
|
@ -316,43 +281,267 @@ class Eudora_Suite:
|
||||||
return _arguments['----']
|
return _arguments['----']
|
||||||
|
|
||||||
|
|
||||||
# Class 'mail folder' ('euMF') -- 'A folder containing mailboxes or other mail folders.'
|
class mail_folder(aetools.ComponentItem):
|
||||||
# property 'name' ('pnam') 'itxt' -- 'the name' []
|
"""mail folder - A folder containing mailboxes or other mail folders."""
|
||||||
|
want = 'euMF'
|
||||||
|
class name(aetools.NProperty):
|
||||||
|
"""name - the name"""
|
||||||
|
which = 'pnam'
|
||||||
|
want = 'itxt'
|
||||||
# element 'euMB' as ['indx', 'name']
|
# element 'euMB' as ['indx', 'name']
|
||||||
# element 'euMF' as ['indx', 'name']
|
# element 'euMF' as ['indx', 'name']
|
||||||
|
|
||||||
# Class 'mailbox' ('euMB') -- 'A mailbox.'
|
class mailbox(aetools.ComponentItem):
|
||||||
# property 'name' ('pnam') 'itxt' -- 'the name of the mail folder' []
|
"""mailbox - A mailbox."""
|
||||||
# property 'space wasted' ('euWS') 'long' -- 'the amount of waste space in the mailbox' []
|
want = 'euMB'
|
||||||
# property 'space required' ('euNS') 'long' -- 'the minimum amount of space required to hold the mailbox' []
|
# repeated property name the name of the mail folder
|
||||||
# property 'location' ('euFS') 'fss ' -- 'the file the mailbox is stored in' []
|
class space_wasted(aetools.NProperty):
|
||||||
# property 'toc location' ('eTFS') 'fss ' -- 'the file the table of contents is stored in' []
|
"""space wasted - the amount of waste space in the mailbox"""
|
||||||
|
which = 'euWS'
|
||||||
|
want = 'long'
|
||||||
|
class space_required(aetools.NProperty):
|
||||||
|
"""space required - the minimum amount of space required to hold the mailbox"""
|
||||||
|
which = 'euNS'
|
||||||
|
want = 'long'
|
||||||
|
class location(aetools.NProperty):
|
||||||
|
"""location - the file the mailbox is stored in"""
|
||||||
|
which = 'euFS'
|
||||||
|
want = 'fss '
|
||||||
|
class toc_location(aetools.NProperty):
|
||||||
|
"""toc location - the file the table of contents is stored in"""
|
||||||
|
which = 'eTFS'
|
||||||
|
want = 'fss '
|
||||||
# element 'euMS' as ['indx']
|
# element 'euMS' as ['indx']
|
||||||
|
|
||||||
# Class 'message' ('euMS') -- 'A message'
|
class message(aetools.ComponentItem):
|
||||||
# property 'body' ('eBod') 'TEXT' -- 'the body of the message' [mutable]
|
"""message - A message"""
|
||||||
# property 'priority' ('euPY') 'long' -- 'the priority' [mutable]
|
want = 'euMS'
|
||||||
# property 'label' ('eLbl') 'long' -- 'the index of the label' [mutable]
|
class body(aetools.NProperty):
|
||||||
# property 'status' ('euST') 'eSta' -- 'the message status' [mutable enum]
|
"""body - the body of the message"""
|
||||||
# property 'sender' ('euSe') 'itxt' -- 'the sender as appearing in the message summary' [mutable]
|
which = 'eBod'
|
||||||
# property 'date' ('euDa') 'itxt' -- 'the date as appearing in the message summary' []
|
want = 'TEXT'
|
||||||
# property 'subject' ('euSu') 'itxt' -- 'the subject as appearing in the message summary' [mutable]
|
class priority(aetools.NProperty):
|
||||||
# property 'size' ('euSi') 'long' -- 'the size of the message' []
|
"""priority - the priority"""
|
||||||
# property 'outgoing' ('euOu') 'bool' -- 'is the message is outgoing?' []
|
which = 'euPY'
|
||||||
# property 'signature' ('eSig') 'eSig' -- 'which signature the message should have' [mutable enum]
|
want = 'long'
|
||||||
# property 'QP' ('eMQP') 'bool' -- 'is Eudora allowed to encode text?' [mutable]
|
class label(aetools.NProperty):
|
||||||
# property 'return receipt' ('eRRR') 'bool' -- 'is a return receipt is requested?' [mutable]
|
"""label - the index of the label"""
|
||||||
# property 'wrap' ('eWrp') 'bool' -- 'should the text be wrapped when sent?' [mutable]
|
which = 'eLbl'
|
||||||
# property 'tab expansion' ('eTab') 'bool' -- 'should tabs get expanded to spaces?' [mutable]
|
want = 'long'
|
||||||
# property 'keep copy' ('eCpy') 'bool' -- 'should a copy should be kept after message is sent?' [mutable]
|
class status(aetools.NProperty):
|
||||||
# property 'preserve macintosh info' ('eXTX') 'bool' -- 'should Macintosh information always be sent with attachments?' [mutable]
|
"""status - the message status"""
|
||||||
# property 'attachment encoding' ('eATy') 'eAty' -- 'the type of encoding to use for attachments' [mutable enum]
|
which = 'euST'
|
||||||
# property 'show all headers' ('eBla') 'bool' -- 'should all headers be visible?' [mutable]
|
want = 'eSta'
|
||||||
# property 'transliteration table' ('eTbl') 'long' -- 'the resource id of the transliteration table' [mutable]
|
class sender(aetools.NProperty):
|
||||||
# property 'will be fetched' ('eWFh') 'bool' -- 'will the message be [re]fetched on next check?' [mutable]
|
"""sender - the sender as appearing in the message summary"""
|
||||||
# property 'will be deleted' ('eWDl') 'bool' -- 'will the message be deleted from server on next check?' [mutable]
|
which = 'euSe'
|
||||||
|
want = 'itxt'
|
||||||
|
class date(aetools.NProperty):
|
||||||
|
"""date - the date as appearing in the message summary"""
|
||||||
|
which = 'euDa'
|
||||||
|
want = 'itxt'
|
||||||
|
class subject(aetools.NProperty):
|
||||||
|
"""subject - the subject as appearing in the message summary"""
|
||||||
|
which = 'euSu'
|
||||||
|
want = 'itxt'
|
||||||
|
class size(aetools.NProperty):
|
||||||
|
"""size - the size of the message"""
|
||||||
|
which = 'euSi'
|
||||||
|
want = 'long'
|
||||||
|
class outgoing(aetools.NProperty):
|
||||||
|
"""outgoing - is the message is outgoing?"""
|
||||||
|
which = 'euOu'
|
||||||
|
want = 'bool'
|
||||||
|
class signature(aetools.NProperty):
|
||||||
|
"""signature - which signature the message should have"""
|
||||||
|
which = 'eSig'
|
||||||
|
want = 'eSig'
|
||||||
|
class QP(aetools.NProperty):
|
||||||
|
"""QP - is Eudora allowed to encode text?"""
|
||||||
|
which = 'eMQP'
|
||||||
|
want = 'bool'
|
||||||
|
class return_receipt(aetools.NProperty):
|
||||||
|
"""return receipt - is a return receipt is requested?"""
|
||||||
|
which = 'eRRR'
|
||||||
|
want = 'bool'
|
||||||
|
class wrap(aetools.NProperty):
|
||||||
|
"""wrap - should the text be wrapped when sent?"""
|
||||||
|
which = 'eWrp'
|
||||||
|
want = 'bool'
|
||||||
|
class tab_expansion(aetools.NProperty):
|
||||||
|
"""tab expansion - should tabs get expanded to spaces?"""
|
||||||
|
which = 'eTab'
|
||||||
|
want = 'bool'
|
||||||
|
class keep_copy(aetools.NProperty):
|
||||||
|
"""keep copy - should a copy should be kept after message is sent?"""
|
||||||
|
which = 'eCpy'
|
||||||
|
want = 'bool'
|
||||||
|
class preserve_macintosh_info(aetools.NProperty):
|
||||||
|
"""preserve macintosh info - should Macintosh information always be sent with attachments?"""
|
||||||
|
which = 'eXTX'
|
||||||
|
want = 'bool'
|
||||||
|
class attachment_encoding(aetools.NProperty):
|
||||||
|
"""attachment encoding - the type of encoding to use for attachments"""
|
||||||
|
which = 'eATy'
|
||||||
|
want = 'eAty'
|
||||||
|
class show_all_headers(aetools.NProperty):
|
||||||
|
"""show all headers - should all headers be visible?"""
|
||||||
|
which = 'eBla'
|
||||||
|
want = 'bool'
|
||||||
|
class transliteration_table(aetools.NProperty):
|
||||||
|
"""transliteration table - the resource id of the transliteration table"""
|
||||||
|
which = 'eTbl'
|
||||||
|
want = 'long'
|
||||||
|
class will_be_fetched(aetools.NProperty):
|
||||||
|
"""will be fetched - will the message be [re]fetched on next check?"""
|
||||||
|
which = 'eWFh'
|
||||||
|
want = 'bool'
|
||||||
|
class will_be_deleted(aetools.NProperty):
|
||||||
|
"""will be deleted - will the message be deleted from server on next check?"""
|
||||||
|
which = 'eWDl'
|
||||||
|
want = 'bool'
|
||||||
# element 'euFd' as ['name']
|
# element 'euFd' as ['name']
|
||||||
|
|
||||||
# Class 'field' ('euFd') -- 'An RFC 822 header field in a message (field named "" is the body)'
|
class field(aetools.ComponentItem):
|
||||||
|
"""field - An RFC 822 header field in a message (field named "" is the body)"""
|
||||||
|
want = 'euFd'
|
||||||
|
|
||||||
# Class 'setting' ('ePrf') -- "Eudora's settings"
|
class setting(aetools.ComponentItem):
|
||||||
|
"""setting - Eudora's settings"""
|
||||||
|
want = 'ePrf'
|
||||||
|
mail_folder._propdict = {
|
||||||
|
'name' : name,
|
||||||
|
}
|
||||||
|
mail_folder._elemdict = {
|
||||||
|
'mailbox' : mailbox,
|
||||||
|
'mail_folder' : mail_folder,
|
||||||
|
}
|
||||||
|
mailbox._propdict = {
|
||||||
|
'name' : name,
|
||||||
|
'space_wasted' : space_wasted,
|
||||||
|
'space_required' : space_required,
|
||||||
|
'location' : location,
|
||||||
|
'toc_location' : toc_location,
|
||||||
|
}
|
||||||
|
mailbox._elemdict = {
|
||||||
|
'message' : message,
|
||||||
|
}
|
||||||
|
message._propdict = {
|
||||||
|
'body' : body,
|
||||||
|
'priority' : priority,
|
||||||
|
'label' : label,
|
||||||
|
'status' : status,
|
||||||
|
'sender' : sender,
|
||||||
|
'date' : date,
|
||||||
|
'subject' : subject,
|
||||||
|
'size' : size,
|
||||||
|
'outgoing' : outgoing,
|
||||||
|
'signature' : signature,
|
||||||
|
'QP' : QP,
|
||||||
|
'return_receipt' : return_receipt,
|
||||||
|
'wrap' : wrap,
|
||||||
|
'tab_expansion' : tab_expansion,
|
||||||
|
'keep_copy' : keep_copy,
|
||||||
|
'preserve_macintosh_info' : preserve_macintosh_info,
|
||||||
|
'attachment_encoding' : attachment_encoding,
|
||||||
|
'show_all_headers' : show_all_headers,
|
||||||
|
'transliteration_table' : transliteration_table,
|
||||||
|
'will_be_fetched' : will_be_fetched,
|
||||||
|
'will_be_deleted' : will_be_deleted,
|
||||||
|
}
|
||||||
|
message._elemdict = {
|
||||||
|
'field' : field,
|
||||||
|
}
|
||||||
|
field._propdict = {
|
||||||
|
}
|
||||||
|
field._elemdict = {
|
||||||
|
}
|
||||||
|
setting._propdict = {
|
||||||
|
}
|
||||||
|
setting._elemdict = {
|
||||||
|
}
|
||||||
|
_Enum_eSta = {
|
||||||
|
'unread' : 'euS\001', # has not been read
|
||||||
|
'already_read' : 'euS\002', # has been read
|
||||||
|
'replied' : 'euS\003', # has been replied to
|
||||||
|
'forwarded' : 'euS\010', # has been forwarded
|
||||||
|
'redirected' : 'euS\004', # has been redirected
|
||||||
|
'not_sendable' : 'euS\005', # cannot be sent
|
||||||
|
'sendable' : 'euS\006', # can be sent
|
||||||
|
'queued' : 'euS\007', # queued for delivery
|
||||||
|
'sent' : 'euS\011', # has been sent
|
||||||
|
'never_sent' : 'euS\012', # never was sent
|
||||||
|
}
|
||||||
|
|
||||||
|
_Enum_eSig = {
|
||||||
|
'none' : 'sig\000', # no signature
|
||||||
|
'standard' : 'sig\001', # standard signature file
|
||||||
|
'alternate' : 'sig\002', # alternate signature file
|
||||||
|
}
|
||||||
|
|
||||||
|
_Enum_eAty = {
|
||||||
|
'AppleDouble' : 'atc\000', # AppleDouble format
|
||||||
|
'AppleSingle' : 'atc\001', # AppleSingle format
|
||||||
|
'BinHex' : 'atc\002', # BinHex format
|
||||||
|
'uuencode' : 'atc\003', # uuencode format
|
||||||
|
}
|
||||||
|
|
||||||
|
_Enum_eNot = {
|
||||||
|
'mail_arrives' : 'wArv', # mail arrival
|
||||||
|
'mail_sent' : 'wSnt', # mail has been sent
|
||||||
|
'will_connect' : 'wWCn', # eudora is about to connect to a mail server
|
||||||
|
'has_connected' : 'wHCn', # eudora has finished talking to a mail server
|
||||||
|
'has_manually_filtered' : 'mFil', # eudora has finished manually filtering messages
|
||||||
|
'opens_filters' : 'wFil', # user has requested Eudora open the filter window
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Indices of types declared in this module
|
||||||
|
#
|
||||||
|
_classdeclarations = {
|
||||||
|
'euMB' : mailbox,
|
||||||
|
'euMS' : message,
|
||||||
|
'euMF' : mail_folder,
|
||||||
|
'ePrf' : setting,
|
||||||
|
'euFd' : field,
|
||||||
|
}
|
||||||
|
|
||||||
|
_propdeclarations = {
|
||||||
|
'eWFh' : will_be_fetched,
|
||||||
|
'euDa' : date,
|
||||||
|
'euSi' : size,
|
||||||
|
'eRRR' : return_receipt,
|
||||||
|
'pnam' : name,
|
||||||
|
'euSe' : sender,
|
||||||
|
'eWrp' : wrap,
|
||||||
|
'eSig' : signature,
|
||||||
|
'euOu' : outgoing,
|
||||||
|
'eMQP' : QP,
|
||||||
|
'eTFS' : toc_location,
|
||||||
|
'eWDl' : will_be_deleted,
|
||||||
|
'eLbl' : label,
|
||||||
|
'eATy' : attachment_encoding,
|
||||||
|
'euSu' : subject,
|
||||||
|
'eBla' : show_all_headers,
|
||||||
|
'eCpy' : keep_copy,
|
||||||
|
'euWS' : space_wasted,
|
||||||
|
'eBod' : body,
|
||||||
|
'euNS' : space_required,
|
||||||
|
'eTab' : tab_expansion,
|
||||||
|
'eTbl' : transliteration_table,
|
||||||
|
'eXTX' : preserve_macintosh_info,
|
||||||
|
'euFS' : location,
|
||||||
|
'euST' : status,
|
||||||
|
'euPY' : priority,
|
||||||
|
}
|
||||||
|
|
||||||
|
_compdeclarations = {
|
||||||
|
}
|
||||||
|
|
||||||
|
_enumdeclarations = {
|
||||||
|
'eAty' : _Enum_eAty,
|
||||||
|
'eNot' : _Enum_eNot,
|
||||||
|
'eSta' : _Enum_eSta,
|
||||||
|
'eSig' : _Enum_eSig,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ import sys
|
||||||
import aetools
|
import aetools
|
||||||
import Eudora_Suite
|
import Eudora_Suite
|
||||||
import Required_Suite
|
import Required_Suite
|
||||||
|
import Standard_Suite
|
||||||
import MacOS
|
import MacOS
|
||||||
|
|
||||||
class Eudora(aetools.TalkTo, Required_Suite.Required_Suite, \
|
class Eudora(Eudora_Suite.Eudora_Suite, Required_Suite.Required_Suite, \
|
||||||
Eudora_Suite.Eudora_Suite):
|
Standard_Suite.Standard_Suite, aetools.TalkTo):
|
||||||
"""A class that can talk to Eudora"""
|
"""A class that can talk to Eudora"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -17,13 +18,19 @@ SIGNATURE="CSOm"
|
||||||
def main():
|
def main():
|
||||||
talker = Eudora(SIGNATURE, start=1)
|
talker = Eudora(SIGNATURE, start=1)
|
||||||
while 1:
|
while 1:
|
||||||
print 'get, put, quit (eudora) or exit (this program) ?'
|
print 'get, put, name (of first folder), list (foldernames), quit (eudora) or exit (this program) ?'
|
||||||
line = sys.stdin.readline()
|
line = sys.stdin.readline()
|
||||||
try:
|
try:
|
||||||
if line[0] == 'g':
|
if line[0] == 'g':
|
||||||
talker.connect(checking=1)
|
talker.connect(checking=1)
|
||||||
elif line[0] == 'p':
|
elif line[0] == 'p':
|
||||||
talker.connect(sending=1)
|
talker.connect(sending=1)
|
||||||
|
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
|
||||||
elif line[0] == 'q':
|
elif line[0] == 'q':
|
||||||
talker.quit()
|
talker.quit()
|
||||||
elif line[0] == 'e':
|
elif line[0] == 'e':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue