CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 10:33:48 GMT
content-type: text/x-python
content-length: 1847
cf-ray: 98cdb3890fa53e92-BLR
last-modified: Wed, 30 Apr 2003 10:19:40 GMT
etag: "737-3bc8384824700"
cache-control: max-age=21600
expires: Sat, 11 Oct 2025 16:33:48 GMT
x-backend: www-mirrors
x-request-id: 98cdb3890fa53e92
strict-transport-security: max-age=15552000; includeSubdomains; preload
content-security-policy: frame-ancestors 'self' https://cms.w3.org/ https://cms-dev.w3.org/; upgrade-insecure-requests
cf-cache-status: BYPASS
accept-ranges: bytes
set-cookie: __cf_bm=xLdZO2wbNz0hj2X5xxD5_9PdHCPLRQ8FoGtQ6w2mQyg-1760178828-1.0.1.1-EgAEZd0ysSdK_BO_fvEVjLrcbYoUDll8cz_g2Y7SitO9FYS6gziHNSk.ko3BK7dASxNC3kS8y27DOIfsc50r9ErRiANuYxd0RT0ATcxAGs0; path=/; expires=Sat, 11-Oct-25 11:03:48 GMT; domain=.w3.org; HttpOnly; Secure; SameSite=None
vary: Accept-Encoding
server: cloudflare
alt-svc: h3=":443"; ma=86400
#!/usr/bin/python
import sys
import re
def makeGoodString(string):
i = 0
while i < len(string):
if string[i] == '"':
string = string[0:i] + '\\"' + string[i+1:len(string)]
i = i + 1
i= i + 1
return string
def printAction(id, who, what):
print newBNode() + '\n'
print ' bmcb:label "' + id + '";\n'
print ' bmcb:assignee [ bmcb:name "' + who + '"];\n'
print ' bmcb:shortDesc "' + makeGoodString(what) + '".\n'
bnodeCount = 0
def newBNode():
global bnodeCount
bnodeCount = bnodeCount + 1
return '_:a' + str(bnodeCount)
actionCount = 0
dateRe = re.compile('^date:\s*(2\S+)')
action1Re = re.compile('^ACTION:?\s+(\d\S+)\s+(\S+)\s*(.*)\r?$')
action2Re = re.compile('^ACTION:?\s+(\S*)\s+(.*)\r?$')
data = sys.stdin.readline()
while data != '':
# there is a persistent \r on the end of the strings
# looks like a regexp bug to me
# so get rid if it the hard way
length = len(data)
while length > 0 and (data[length-1]=='\r' or data[length-1] == '\n'):
data = data[0:length-1]
length = (length - 1)
# check for a date
match = dateRe.findall(data)
if len(match) > 0:
date = match[0]
dateChecker = re.compile(date + '\#\d+')
match = action1Re.findall(data)
if len(match) > 0:
action1Re.findall(data)
if len(match) > 0:
id = match[0][0]
who = match[0][1]
what = match[0][2]
if dateChecker.match(id):
printAction(id, who, what)
else:
match = action2Re.findall(data)
if len(match) > 0:
actionCount = actionCount + 1
id = date + '#' + str(actionCount)
who = match[0][0]
what = match[0][1]
printAction(id, who, what)
data = sys.stdin.readline()