Changeset View
Changeset View
Standalone View
Standalone View
wallace/module_optout.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | def execute(*args, **kw): | ||||
for stage in ['incoming', 'ACCEPT', 'REJECT', 'HOLD', 'DEFER' ]: | for stage in ['incoming', 'ACCEPT', 'REJECT', 'HOLD', 'DEFER' ]: | ||||
if not os.path.isdir(os.path.join(mybasepath, stage)): | if not os.path.isdir(os.path.join(mybasepath, stage)): | ||||
os.makedirs(os.path.join(mybasepath, stage)) | os.makedirs(os.path.join(mybasepath, stage)) | ||||
# TODO: Test for correct call. | # TODO: Test for correct call. | ||||
filepath = args[0] | filepath = args[0] | ||||
if kw.has_key('stage'): | if 'stage' in kw: | ||||
log.debug(_("Issuing callback after processing to stage %s") % (kw['stage']), level=8) | log.debug(_("Issuing callback after processing to stage %s") % (kw['stage']), level=8) | ||||
log.debug(_("Testing cb_action_%s()") % (kw['stage']), level=8) | log.debug(_("Testing cb_action_%s()") % (kw['stage']), level=8) | ||||
if hasattr(modules, 'cb_action_%s' % (kw['stage'])): | if hasattr(modules, 'cb_action_%s' % (kw['stage'])): | ||||
log.debug(_("Attempting to execute cb_action_%s()") % (kw['stage']), level=8) | log.debug(_("Attempting to execute cb_action_%s()") % (kw['stage']), level=8) | ||||
exec('modules.cb_action_%s(%r, %r)' % (kw['stage'],'optout',filepath)) | exec('modules.cb_action_%s(%r, %r)' % (kw['stage'],'optout',filepath)) | ||||
return | return | ||||
#modules.next_module('optout') | #modules.next_module('optout') | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |