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
This commit is contained in:
parent
2a6adae5de
commit
91d0c7efd7
|
@ -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<year>\d+)-(?P<month>\d+)-(?P<day>\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"),
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -82,6 +82,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
<tr class="header"><td colspan="5"><a href="/iesg/agenda/">Full IESG Agenda</a></td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr class="header"><td colspan="5"><a href="/iesg/agenda/telechat-{{t.date|date:"Y"}}-{{t.date|date:"m"}}-{{t.date|date:"d"}}-docs.tgz">Download Documents</a></td></tr>
|
||||
|
||||
<tr class="header"><td colspan="5">2. Protocol Actions</td></tr>
|
||||
|
||||
<tr class="header"><td colspan="5">2.1 WG Submissions</td></tr>
|
||||
|
|
Loading…
Reference in a new issue