\n" % (page, ))
out("\n" % (os.getcwd(), ))
dirlist = glob(".", "%s*.txt" % page)
dirlist += glob(".", "%s*.html" % page)
dirlist += glob(".", "%s-*-%s.txt" % (page, wg))
dirlist += glob(".", "%s-*-%s.html" % (page, wg))
#out("\n" % (dirlist, ))
dirlist = list(set([ file for file in dirlist if ( file[-5:] == ".html" or (file[-4:] == ".txt" and not file[:-4]+".html" in dirlist)) ]))
#out("\n" % (dirlist, ))
def mcmp(x,y):
import re, os
parts = os.path.splitext(x)[0].split('-')
if len(parts) == 4 and parts[1].isdigit() and parts[3].isdigit():
x = int(parts[1]), int(parts[3])
elif len(parts) == 3 and parts[1].isdigit():
x = int(parts[1])
else:
x=re.sub("-","",x)
parts = os.path.splitext(y)[0].split('-')
if len(parts) == 4 and parts[1].isdigit() and parts[3].isdigit():
y = int(parts[1]), int(parts[3])
elif len(parts) == 3 and parts[1].isdigit():
y = int(parts[1])
else:
y=re.sub("-","",y)
return cmp(x,y)
# sort once, before building dict below
dirlist.sort(cmp=mcmp)
#out("\n" % (dirlist, ))
#
def revless(file):
import re, os
name, ext = os.path.splitext(file)
if re.search('-\d\d$', name):
name = name[:-3]
return name+ext
dirdict = dict([ (revless(file),file) for file in dirlist ])
#out("\n" % (dirdict, ))
dirlist = dirdict.values()
# sort again, after extracting
dirlist.sort(cmp=mcmp)
#dirlist.reverse()
for file in dirlist:
if "." in file:
name, ext = file.split(".", 1)
if name.startswith(page+"-"):
prefix, num, rest = file.split("-", 2)
else:
num = name[len(page):]
out("
%s-%s\n" % (file, page, num))
out("
")
jsonlist = glob(".", "ietf-*-details.json")
jsonlist.sort(cmp=mcmp)
for file in jsonlist:
name, ext = file.split(".")
prefix, num, rest = file.split("-", 2)
if int(num) > 82:
meta = get_meta(wg, num)
port = None
if int(num) >= 87 and int(num)<104:
port = "9000"
elif "roomid" in meta:
port = "900%s" % meta["roomid"]
if port:
if int(num) < 104:
out("
etherpad-%s\n" % (port, num, wg, num))
else:
out("
etherpad-%s\n" % (num, wg, num))
out("
")
current_meeting = filetext("../../meta/current-ietf-number.txt").strip()
out("\n" % (current_meeting, ))
out("""
(Materials Upload)"""
% (current_meeting, wg))
?>
\n" % (var, os.environ[var]))
def get_mnum(str, page, default):
if str and "." in str:
name, ext = str.rsplit(".",1)
if name.startswith("%s-"%page):
prefix, num, rest = name.split("-", 2)
else:
num = name[len(page):]
return num
else:
return default
content = ""
item = ""
if dirlist:
item = args.get("item")
if not item:
# Handle urls of the form /wg/wgname/agenda.pyht/64
num = os.environ["PATH_TRANSLATED"].replace(filename, "")[1:]
if num:
for item in [
"%s%s.html" % (page, num),
"%s%s.txt " % (page, num),
"%s-%s-%s.html" % (page, num, wg),
"%s-%s-%s.txt" % (page, num, wg) ]:
if item in dirlist:
break
if not item:
item = dirlist[-1]
out("\n" % (item, ))
if get_mnum(item, page, current_meeting) != current_meeting:
item = ""
if item:
try:
if item[-5:] == ".html" or item[-4:] == ".htm":
file = open(item)
else:
file = urllib.urlopen("https://tools.ietf.org/tools/rfcmarkup/rfcmarkup.cgi?blurb=0&url=%s/%s" % (urlpath, item))
content = file.read()
content = re.sub("(?i)<(!DOCTYPE|/?html|/?body)[^>]*>\n*", "", content)
content = re.sub("(?si).*\n*", "", content)
if re.search("?h1", content):
func = lambda x: "<%sh%s" % (x.group(1),int(x.group(2))+1)
content = re.sub("<(/?)h([1-8])", func , content)
file.close()
except:
content = ""
else:
content = ""
num = get_mnum(item, page, current_meeting)
if page == "charter":
out("
'%s %s
\n" % (num, page))
out(content)
else:
num = num or current_meeting
out("""
IETF-%s %s %s
\n""" % (num, wg, page))
meetingmeta = get_meta(wg, num)
if content:
materialslist = "/www/tools.ietf.org/agenda/%s/slides/slides-%s-%s.html" % (num, num, wg)
if not os.path.exists(materialslist):
materialslist = "/www/tools.ietf.org/agenda/%s/slides/slides-%s.html" % (num, wg)
if os.path.exists(materialslist):
out("
Slides
\n These are also available from the
materials page:
\n" % (num,wg))
for line in filetext(materialslist).splitlines():
slide_link = re.sub('href="[^"]+/slides/([^"]+)"', 'href="/agenda/%s/slides/\g<1>"'%(num,), line)
slide_match = re.search('href="[^"]+/slides/([^"]+)"', line)
if slide_match:
slide_name = slide_match.group(1)
base, ext = os.path.splitext(slide_name)
if ext in [ ".ppt", ".pptx", ]:
pdf_file = "/www/tools.ietf.org/agenda/%s/slides/%s.pdf" % (num, base)
if os.path.exists(pdf_file):
slide_link = re.sub(slide_name, base+".pdf", slide_link)
out(slide_link)
out("
\n")
out("
\n")
for session in meetingmeta["sessions"]:
if ("date" in session
and "time" in session
and "room" in session):
out("Session %(date)s %(time)s: %(room)s" % session)
if "stream" in session:
out(" - Audio stream" % session)
if "jabber" in session:
out(" - %(wg)s chatroom" % session)
out("
")
out("
")
if os.path.exists("ietf-%(num)s-%(wg)s.ics" % meetingmeta):
out("iCal: ietf-%(num)s-%(wg)s.ics
" % meetingmeta)
out("
\n")
out("
%s
\n" % page.capitalize())
out(content)
else:
if page == "minutes" and num==current_meeting and os.path.exists("agenda-%s-%s.html"%(num,wg)) and "roomid" in meetingmeta:
# take the roomid from the stream name. Get rid of the extension, and take the last digit of the stream name.
if int(num) >= 87:
port = "9000"
elif "roomid" in meta:
port = "900%s" % meta["roomid"]
if int(num) < 104:
server = "etherpad.tools.ietf.org"
else:
server = "etherpad.ietf.org"
out("""There are no %(wg)s minutes from IETF-%(num)s yet, but an interactive document
which supports collaborative editing is provided below, for note-taking
during the meeting. This will be replaced by the meeting minutes when
they have been submitted.
\n
\n You can open the document
without embedding
if you prefer that over the embedded version below.
\n
\n""" % {"num":num, "wg":wg, "port":port, "server":server})
out("""