summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
Diffstat (limited to 'wallace')
-rw-r--r--wallace/__init__.py6
-rw-r--r--wallace/module_resources.py18
-rw-r--r--wallace/modules.py4
3 files changed, 19 insertions, 9 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 084425e..be23ffa 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -48,6 +48,8 @@ def pickup_message(filepath, *args, **kw):
# Cause the previous modules to be skipped
wallace_modules = wallace_modules[(wallace_modules.index(kw['module'])+1):]
+ log.debug(_("Wallace modules: %r") % (wallace_modules), level=8)
+
# Execute the module
if kw.has_key('stage'):
modules.execute(kw['module'], filepath, stage=kw['stage'])
@@ -55,7 +57,9 @@ def pickup_message(filepath, *args, **kw):
modules.execute(kw['module'], filepath)
for module in wallace_modules:
- filepath = modules.execute(module, filepath)
+ result_filepath = modules.execute(module, filepath)
+ if not result_filepath == None and not result_filepath == False:
+ filepath = result_filepath
def worker_process(*args, **kw):
log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1)
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index f4940ea..bc76dd4 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -127,7 +127,7 @@ def execute(*args, **kw):
)
)
- return
+ return filepath
else:
# Move to incoming
new_filepath = os.path.join(
@@ -187,19 +187,17 @@ def execute(*args, **kw):
if not any_itips:
log.debug(_("Not an iTip message, but sent to resource nonetheless. Reject message"), level=5)
reject(filepath)
- return
+ return False
else:
# Continue. Resources and iTips. We like.
pass
else:
if not any_itips:
log.debug(_("No itips, no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
else:
log.debug(_("iTips, but no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
# A simple list of merely resource entry IDs that hold any relevance to the
# iTip events
@@ -701,6 +699,14 @@ def resource_record_from_email_address(email_address):
resource_records = []
+ local_domains = auth.list_domains()
+
+ if not local_domains == None:
+ local_domains = list(set(local_domains.keys()))
+
+ if not email_address.split('@')[1] in local_domains:
+ return []
+
log.debug(
_("Checking if email address %r belongs to a resource (collection)") % (email_address),
level=8
diff --git a/wallace/modules.py b/wallace/modules.py
index 861da75..b3de82e 100644
--- a/wallace/modules.py
+++ b/wallace/modules.py
@@ -105,12 +105,12 @@ def list_modules(*args, **kw):
def execute(name, *args, **kw):
if not modules.has_key(name):
- log.error(_("No such module."))
+ log.error(_("No such module %r in modules %r (1).") % (name, modules))
sys.exit(1)
if not modules[name].has_key('function') and \
not modules[name].has_key('group'):
- log.error(_("No such module."))
+ log.error(_("No such module %r in modules %r (2).") %(name, modules))
sys.exit(1)
modules[name]['function'](*args, **kw)