[Checkins] SVN: zopyx.smartprintng.server/trunk/ updated
Andreas Jung
andreas at andreas-jung.com
Sun Jul 19 05:06:41 EDT 2009
Log message for revision 101996:
updated
Changed:
U zopyx.smartprintng.server/trunk/README.txt
U zopyx.smartprintng.server/trunk/server.ini
U zopyx.smartprintng.server/trunk/setup.py
U zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/mail_util.py
U zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/run.py
-=-
Modified: zopyx.smartprintng.server/trunk/README.txt
===================================================================
--- zopyx.smartprintng.server/trunk/README.txt 2009-07-19 08:45:37 UTC (rev 101995)
+++ zopyx.smartprintng.server/trunk/README.txt 2009-07-19 09:06:41 UTC (rev 101996)
@@ -61,7 +61,8 @@
def convertZIPEmail(context, zip_archive, converter_name='pdf-prince',
sender=None, recipient=None, subject=None, body=None):
""" Similar to convertZIP() except that this method will send the
- converted output document to a recipient by email.
+ converted output document to a recipient by email. 'subject' and
+ 'body' parameters *must* be utf-8 encoded.
"""
def availableConverters():
@@ -72,6 +73,26 @@
def ping():
""" says 'pong' - or something similar """
+Email configuration
+===================
+
+For using the email support through the ``convertZIPEmail()`` the email server must be
+configured through a dedicated configuration file. An ``email.ini`` may look like this::
+
+ [mail]
+ hostname = smtp.gmail.com
+ username = some_username
+ password = some_password
+ force_tls = False
+ no_tls = False
+
+You have to pass the name of the email configuration file to ``paster`` when starting
+then server::
+
+ bin/paster serve server.ini mail_config=/path/to/email.ini
+
+
+
Support
=======
Modified: zopyx.smartprintng.server/trunk/server.ini
===================================================================
--- zopyx.smartprintng.server/trunk/server.ini 2009-07-19 08:45:37 UTC (rev 101995)
+++ zopyx.smartprintng.server/trunk/server.ini 2009-07-19 09:06:41 UTC (rev 101996)
@@ -11,3 +11,7 @@
use = egg:Paste#http
host = 0.0.0.0
port = 6543
+
+[foo:bar]
+bar=2
+
Modified: zopyx.smartprintng.server/trunk/setup.py
===================================================================
--- zopyx.smartprintng.server/trunk/setup.py 2009-07-19 08:45:37 UTC (rev 101995)
+++ zopyx.smartprintng.server/trunk/setup.py 2009-07-19 09:06:41 UTC (rev 101996)
@@ -28,6 +28,7 @@
'uuid',
'zopyx.convert2',
'repoze.sendmail',
+ 'nose',
# -*- Extra requirements: -*-
],
entry_points="""\
Modified: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/mail_util.py
===================================================================
--- zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/mail_util.py 2009-07-19 08:45:37 UTC (rev 101995)
+++ zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/mail_util.py 2009-07-19 09:06:41 UTC (rev 101996)
@@ -14,6 +14,12 @@
def makeMailer():
+ mail_config = os.environ.get('EMAIL_CONFIG')
+ if not mail_config:
+ raise RuntimeError('No email configuration found')
+ if not os.path.exists(mail_config):
+ raise RuntimeError('Configured email configuration file not available')
+
CP = ConfigParser()
CP.read('email.ini')
Modified: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/run.py
===================================================================
--- zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/run.py 2009-07-19 08:45:37 UTC (rev 101995)
+++ zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/run.py 2009-07-19 09:06:41 UTC (rev 101996)
@@ -3,17 +3,22 @@
# (C) 2008, 2009, ZOPYX Ltd & Co. KG, Tuebingen, Germany
##########################################################################
-
+import os
from repoze.bfg.router import make_app
def app(global_config, **kw):
""" This function returns a repoze.bfg.router.Router object. It
is usually called by the PasteDeploy framework during ``paster
serve``"""
+
# paster app config callback
from zopyx.smartprintng.server.models import get_root
import zopyx.smartprintng.server
from logger import LOG
+ if 'mail_config' in global_config:
+ mail_config = os.path.abspath(global_config['mail_config'])
+ LOG.info('Using email configuration at %s' % mail_config)
+ os.environ['EMAIL_CONFIG'] = mail_config
LOG.info('SmartPrintNG server started')
return make_app(get_root, zopyx.smartprintng.server, options=kw)
More information about the Checkins
mailing list