add PasteDeploy dependency, remove pudge dependency
* upgrade migrate repository structure (fixes #32, #27) * switch to PasteDeploy (fixes #31) * update for SQLAlchemy 0.5 compatibility * add python-gnutls dependency (addresses #35)
This commit is contained in:
parent
483c1f9038
commit
222b35b033
24 changed files with 247 additions and 177 deletions
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2007, 2008 by Jan Dittberner.
|
||||
# Copyright (C) 2007, 2008, 2009 by Jan Dittberner.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,10 +30,8 @@ from email.MIMEText import MIMEText
|
|||
from pyme import core
|
||||
from pyme.constants.sig import mode
|
||||
|
||||
from gnuviechadmin.backend.settings import config
|
||||
|
||||
|
||||
def send_mail(subject, text):
|
||||
def send_mail(config, subject, text):
|
||||
"""Send a signed and possibly encrypted mail.
|
||||
|
||||
This method sends a mail with the given text and subject and signs
|
||||
|
@ -52,8 +50,8 @@ def send_mail(subject, text):
|
|||
cipher = core.Data()
|
||||
c = core.Context()
|
||||
c.set_armor(1)
|
||||
signer = config.get('common', 'mailfrom')
|
||||
rcpt = config.get('common', 'mailto')
|
||||
signer = config['mailfrom']
|
||||
rcpt = config['mailto']
|
||||
c.signers_clear()
|
||||
for sigkey in [x for x in c.op_keylist_all(signer, 1)]:
|
||||
if sigkey.can_sign:
|
||||
|
@ -64,14 +62,12 @@ def send_mail(subject, text):
|
|||
keylist = []
|
||||
for key in c.op_keylist_all(rcpt, 0):
|
||||
valid = 0
|
||||
subkey = key.subkeys
|
||||
while subkey:
|
||||
for subkey in key.subkeys:
|
||||
keyid = subkey.keyid
|
||||
if keyid == None:
|
||||
break
|
||||
can_encrypt = subkey.can_encrypt
|
||||
valid += can_encrypt
|
||||
subkey = subkey.next
|
||||
if valid:
|
||||
keylist.append(key)
|
||||
if keylist:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue