incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [03/50] git commit: [#3154] ticket:388 Add not exported tools to notification email
Date Wed, 21 Aug 2013 15:26:45 GMT
[#3154] ticket:388 Add not exported tools to notification email


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e4f7cf54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e4f7cf54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e4f7cf54

Branch: refs/heads/db/3154b
Commit: e4f7cf540e246bd52be0ab6d74362571b9863cb9
Parents: 5beb58e
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Jul 5 13:35:34 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Aug 21 15:25:54 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/export_tasks.py           | 7 ++++++-
 Allura/allura/templates/mail/bulk_export.html | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e4f7cf54/Allura/allura/tasks/export_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py
index d097205..672f51b 100644
--- a/Allura/allura/tasks/export_tasks.py
+++ b/Allura/allura/tasks/export_tasks.py
@@ -41,13 +41,16 @@ def bulk_export(project_shortname, tools, username):
     if project.bulk_export_status() == 'busy':
         log.info('Another export is running for project %s. Skipping.' % project_shortname)
         return
+    not_exported_tools = []
     for tool in tools or []:
         app = project.app_instance(tool)
         if not app:
             log.info('Can not load app for %s mount point. Skipping.' % tool)
+            not_exported_tools.append(tool)
             continue
         if not app.exportable:
             log.info('Tool %s is not exportable. Skipping.' % tool)
+            not_exported_tools.append(tool)
             continue
         log.info('Exporting %s...' % tool)
         try:
@@ -56,6 +59,7 @@ def bulk_export(project_shortname, tools, username):
                 app.bulk_export(f)
         except:
             log.error('Something went wrong during export of %s' % tool, exc_info=True)
+            not_exported_tools.append(tool)
             continue
 
     try:
@@ -73,7 +77,8 @@ def bulk_export(project_shortname, tools, username):
     tmpl_context = {
         'instructions': instructions,
         'project': project,
-        'tools': tools,
+        'tools': list(set(tools) - set(not_exported_tools)),
+        'not_exported_tools': not_exported_tools,
     }
     email = {
         'fromaddr': unicode(user.email_address_header()),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e4f7cf54/Allura/allura/templates/mail/bulk_export.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/mail/bulk_export.html b/Allura/allura/templates/mail/bulk_export.html
index 420848f..95ade78 100644
--- a/Allura/allura/templates/mail/bulk_export.html
+++ b/Allura/allura/templates/mail/bulk_export.html
@@ -24,6 +24,13 @@ Following tools was exported:
 - {{ tool }}
 {% endfor %}
 
+{% if not_exported_tools %}
+Following tools was not exported:
+{% for tool in not_exported_tools %}
+- {{ tool }}
+{% endfor %}
+{% endif %}
+
 Follow instructions below to get exported data.
 
 {{ instructions }}


Mime
View raw message