From 91d0c7efd77ae9bdbd2a1d682ec06567851e403b Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 24 Jul 2010 15:23:45 +0000 Subject: [PATCH] IETF 78 Sprint code from Robert Sparks: provide a downloadable tarball of the documents on the IESG agenda of a given date. - Legacy-Id: 2409 --- ietf/iesg/urls.py | 1 + ietf/iesg/views.py | 14 ++++++++++++++ ietf/templates/iesg/agenda_documents.html | 2 ++ 3 files changed, 17 insertions(+) diff --git a/ietf/iesg/urls.py b/ietf/iesg/urls.py index c03f07710..298a72bf2 100644 --- a/ietf/iesg/urls.py +++ b/ietf/iesg/urls.py @@ -57,6 +57,7 @@ urlpatterns += patterns('', (r'^agenda/agenda_package.txt$', views.agenda_package), (r'^agenda/documents.txt$', views.agenda_documents_txt), (r'^agenda/documents/$', views.agenda_documents), + (r'^agenda/telechat-(?P\d+)-(?P\d+)-(?P\d+)-docs.tgz', views.agenda_downloaddocstgz), (r'^discusses/$', views.discusses), (r'^telechatdates/$', views.telechat_dates), url(r'^wgactions/$', views.working_group_actions, name="iesg_working_group_actions"), diff --git a/ietf/iesg/views.py b/ietf/iesg/views.py index eae9d62a8..4e913ec1b 100644 --- a/ietf/iesg/views.py +++ b/ietf/iesg/views.py @@ -50,6 +50,7 @@ from ietf.idrfc.utils import update_telechat from ietf.ietfauth.decorators import group_required from ietf.idtracker.templatetags.ietf_filters import in_group import datetime +import tarfile def date_threshold(): """Return the first day of the month that is 185 days ago.""" @@ -296,6 +297,19 @@ def agenda_documents(request): telechats.append({'date':date, 'docs':res}) return direct_to_template(request, 'iesg/agenda_documents.html', {'telechats':telechats, 'hide_telechat_date':True}) +def agenda_downloaddocstgz(request,year,month,day): + date=datetime.date(int(year),int(month),int(day)) + docs= IDInternal.objects.filter(telechat_date=date, primary_flag=1, agenda=1) + response = HttpResponse(mimetype='application/octet-stream') + response['Content-Disposition'] = 'attachment; filename=telechat-%s-%s-%s-docs.tgz'%(year, month, day) + tarstream = tarfile.open('','w:gz',response) + for doc in docs: + tarstream.add(os.path.join(settings.INTERNET_DRAFT_PATH, doc.draft.filename+"-"+doc.draft.revision_display()+".txt"), + doc.draft.filename+"-"+doc.draft.revision_display()+".txt") + tarstream.close() + return response + + def discusses(request): positions = Position.objects.filter(discuss=1) res = [] diff --git a/ietf/templates/iesg/agenda_documents.html b/ietf/templates/iesg/agenda_documents.html index 9ae0c5e26..a64b7f346 100644 --- a/ietf/templates/iesg/agenda_documents.html +++ b/ietf/templates/iesg/agenda_documents.html @@ -82,6 +82,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Full IESG Agenda {% endif %} +Download Documents + 2. Protocol Actions 2.1 WG Submissions