Parcel Loading Mechanism
Chandler now supports loading parcels from an external directory in addition to the default "internal" parcels directory. If you set the PARCELPATH environment variable to point to a directory (make sure it is an absolute path), all parcel subdirectories of PARCELPATH will be loaded after the default parcels.
(For information on how parcels work, see
ParcelManager.)
Inside a parcel, if you ever need to know your parcel's absolute file system path, use "self.model.path".
This feature was added for a few reasons:
- It makes it easier for third-party developers, who can now keep their parcel code wherever they want
- It let's us move parcels around without having to change any paths in the code
- Eventually, end users sharing a single Chandler installation will be able to add their own parcels without affecting the other users
--
MorgenSagen - 18 Jul 2003
Loading your account info from a parcel
Create a ~/parcels/personal/ directory, and create a file named _ _ init _ _.py inside it, using the following as an example:
import application.schema as schema
from osaf.pim.mail import IMAPAccount, IMAPFolder, POPAccount, SMTPAccount,EmailAddress
from osaf.sharing import WebDAVAccount
from osaf.framework import password
from osaf.framework.twisted import waitForDeferred
def installParcel(parcel, oldVersion=None):
pim_ns = schema.ns('osaf.pim', parcel)
sharing_ns = schema.ns('osaf.sharing', parcel)
dav = WebDAVAccount.update(parcel, 'ExampleDAVAccount',
title=u'Example Sharing',
host=u'host.example.com',
path=u'/example/path',
username=u'example',
password=password.Password.update(parcel, 'ExampleDAVAccount password'),
useSSL=False,
port=80,
references=[sharing_ns.currentSharingAccount] # Make this account default
)
waitForDeferred(dav.password.encryptPassword('example'))
myEmailAddress = EmailAddress.update(parcel, 'ExampleEmailAddress',
title=u'Example Email Address',
emailAddress=u'example@example.com',
fullName=u'Example Name',
)
smtp = mySMTPAccount = SMTPAccount.update(parcel, 'ExampleSMTPAccount',
title=u'Example SMTP Account',
host=u'host.example.com',
username=u'example',
password=password.Password.update(parcel, 'ExampleSMTPAccount password'),
connectionSecurity='NONE',
useAuth=True,
port=25,
references=[pim_ns.currentOutgoingAccount] # Make this account default
)
waitForDeferred(smtp.password.encryptPassword('example'))
imap = IMAPAccount.update(parcel, 'ExampleIMAPAccount',
title=u'Example IMAP Account',
host=u'host.example.com',
username=u'example',
password=password.Password.update(parcel, 'ExampleIMAPAccount password'),
port=143,
connectionSecurity='NONE',
replyToAddress=myEmailAddress,
references=[pim_ns.currentIncomingAccount] # Make this account default
)
waitForDeferred(imap.password.encryptPassword('example'))
# Uncomment the following lines if you've already created "Chandler folders"
# for this IMAP account, and want mail/events/tasks read from them
#IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Tasks",
#folderName = u"Chandler Tasks", folderType = "TASK",
#parentAccount = imap)
#IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Mail",
#folderName = u"Chandler Mail", folderType = "MAIL",
#parentAccount = imap)
#IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Events",
#folderName = u"Chandler Events", folderType = "EVENT",
#parentAccount = imap)
# Uncomment the following lines if you want to load additional
# certificates from a .pem file:
#
#from osaf.framework.certstore.data import loadCerts
#loadCerts(parcel,__name__,"certs.pem")
Set your PARCELPATH environment variable to ~/parcels and run Chandler.