summaryrefslogtreecommitdiffstats
path: root/wallace/module_optout.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-09 10:38:13 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-09 10:38:13 +0000
commit107f91157704dbc5b6b7054cf420da5ef651027f (patch)
tree70be96f61a844b145d92ffbad1b58519cf768b35 /wallace/module_optout.py
parent61714a5e0d99ba1bc08eeac7f0ead106d72abae3 (diff)
downloadpykolab-107f91157704dbc5b6b7054cf420da5ef651027f.tar.gz
Correct some pylint conventions
Diffstat (limited to 'wallace/module_optout.py')
-rw-r--r--wallace/module_optout.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/wallace/module_optout.py b/wallace/module_optout.py
index 3e2fd09..79cafb7 100644
--- a/wallace/module_optout.py
+++ b/wallace/module_optout.py
@@ -49,16 +49,16 @@ def execute(*args, **kw):
filepath = args[0]
if kw.has_key('stage'):
- log.debug(_("Issuing callback after processing to stage %s") %(kw['stage']), level=8)
- log.debug(_("Testing cb_action_%s()") %(kw['stage']), level=8)
- if hasattr(modules, 'cb_action_%s' %(kw['stage'])):
- log.debug(_("Attempting to execute cb_action_%s()") %(kw['stage']), level=8)
- exec('modules.cb_action_%s(%r, %r)' %(kw['stage'],'optout',filepath))
+ log.debug(_("Issuing callback after processing to stage %s") % (kw['stage']), level=8)
+ log.debug(_("Testing cb_action_%s()") % (kw['stage']), level=8)
+ if hasattr(modules, 'cb_action_%s' % (kw['stage'])):
+ log.debug(_("Attempting to execute cb_action_%s()") % (kw['stage']), level=8)
+ exec('modules.cb_action_%s(%r, %r)' % (kw['stage'],'optout',filepath))
return
#modules.next_module('optout')
- log.debug(_("Consulting opt-out service for %r, %r") %(args, kw), level=8)
+ log.debug(_("Consulting opt-out service for %r, %r") % (args, kw), level=8)
import email
message = email.message_from_file(open(filepath, 'r'))
@@ -86,7 +86,7 @@ def execute(*args, **kw):
for recipient in recipients[recipient_type]:
log.debug(
_("Running opt-out consult from envelope sender '%s " + \
- "<%s>' to recipient %s <%s>") %(
+ "<%s>' to recipient %s <%s>") % (
envelope_sender[0][0],
envelope_sender[0][1],
recipient[0],
@@ -143,23 +143,23 @@ def execute(*args, **kw):
if use_this:
# TODO: Do not set items with an empty list.
- (fp, filename) = tempfile.mkstemp(dir="/var/spool/pykolab/wallace/optout/%s" %(answer))
+ (fp, filename) = tempfile.mkstemp(dir="/var/spool/pykolab/wallace/optout/%s" % (answer))
os.write(fp, _message.__str__())
os.close(fp)
# Callback with new filename
- if hasattr(modules, 'cb_action_%s' %(answer)):
- log.debug(_("Attempting to execute cb_action_%s(%r, %r)") %(answer, 'optout', filename), level=8)
- exec('modules.cb_action_%s(%r, %r)' %(answer,'optout', filename))
+ if hasattr(modules, 'cb_action_%s' % (answer)):
+ log.debug(_("Attempting to execute cb_action_%s(%r, %r)") % (answer, 'optout', filename), level=8)
+ exec('modules.cb_action_%s(%r, %r)' % (answer,'optout', filename))
os.unlink(filepath)
- #print "Moving filepath %s to new_filepath %s" %(filepath, new_filepath)
+ #print "Moving filepath %s to new_filepath %s" % (filepath, new_filepath)
#os.rename(filepath, new_filepath)
- #if hasattr(modules, 'cb_action_%s' %(optout_answer)):
- #log.debug(_("Attempting to execute cb_action_%s()") %(optout_answer), level=8)
- #exec('modules.cb_action_%s(%r, %r)' %(optout_answer,'optout', new_filepath))
+ #if hasattr(modules, 'cb_action_%s' % (optout_answer)):
+ #log.debug(_("Attempting to execute cb_action_%s()") % (optout_answer), level=8)
+ #exec('modules.cb_action_%s(%r, %r)' % (optout_answer,'optout', new_filepath))
#return
def request(params=None):
@@ -170,7 +170,7 @@ def request(params=None):
try:
f = urllib.urlopen(optout_url, params)
except Exception, e:
- log.error(_("Could not send request to optout_url %s") %(optout_url))
+ log.error(_("Could not send request to optout_url %s") % (optout_url))
return "DEFER"
response = f.read()