"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "roundup/cgi/TAL/markupbase.py" between
roundup-1.6.1.tar.gz and roundup-2.0.0.tar.gz

About: Roundup is an highly customisable issue-tracking system with command-line, web and e-mail interfaces (written in Python).

markupbase.py  (roundup-1.6.1):markupbase.py  (roundup-2.0.0)
skipping to change at line 94 skipping to change at line 94
name, j = self._scan_name(j, i) name, j = self._scan_name(j, i)
elif c in self._decl_otherchars: elif c in self._decl_otherchars:
j = j + 1 j = j + 1
elif c == "[": elif c == "[":
if decltype == "doctype": if decltype == "doctype":
j = self._parse_doctype_subset(j + 1, i) j = self._parse_doctype_subset(j + 1, i)
else: else:
self.error("unexpected '[' char in declaration") self.error("unexpected '[' char in declaration")
else: else:
self.error( self.error(
"unexpected %s char in declaration" % `rawdata[j]`) "unexpected %s char in declaration" % repr(rawdata[j]))
if j < 0: if j < 0:
return j return j
return -1 # incomplete return -1 # incomplete
# Internal -- scan past the internal subset in a <!DOCTYPE declaration, # Internal -- scan past the internal subset in a <!DOCTYPE declaration,
# returning the index just past any whitespace following the trailing ']'. # returning the index just past any whitespace following the trailing ']'.
def _parse_doctype_subset(self, i, declstartpos): def _parse_doctype_subset(self, i, declstartpos):
rawdata = self.rawdata rawdata = self.rawdata
n = len(rawdata) n = len(rawdata)
j = i j = i
while j < n: while j < n:
c = rawdata[j] c = rawdata[j]
if c == "<": if c == "<":
s = rawdata[j:j+2] s = rawdata[j:j+2]
if s == "<": if s == "<":
# end of buffer; incomplete # end of buffer; incomplete
return -1 return -1
if s != "<!": if s != "<!":
self.updatepos(declstartpos, j + 1) self.updatepos(declstartpos, j + 1)
self.error("unexpected char in internal subset (in %s)" self.error("unexpected char in internal subset (in %s)"
% `s`) % repr(s))
if (j + 2) == n: if (j + 2) == n:
# end of buffer; incomplete # end of buffer; incomplete
return -1 return -1
if (j + 4) > n: if (j + 4) > n:
# end of buffer; incomplete # end of buffer; incomplete
return -1 return -1
if rawdata[j:j+4] == "<!--": if rawdata[j:j+4] == "<!--":
j = self.parse_comment(j, report=0) j = self.parse_comment(j, report=0)
if j < 0: if j < 0:
return j return j
continue continue
name, j = self._scan_name(j + 2, declstartpos) name, j = self._scan_name(j + 2, declstartpos)
if j == -1: if j == -1:
return -1 return -1
if name not in ("attlist", "element", "entity", "notation"): if name not in ("attlist", "element", "entity", "notation"):
self.updatepos(declstartpos, j + 2) self.updatepos(declstartpos, j + 2)
self.error( self.error(
"unknown declaration %s in internal subset" % `name`) "unknown declaration %s in internal subset" % repr(name) )
# handle the individual names # handle the individual names
meth = getattr(self, "_parse_doctype_" + name) meth = getattr(self, "_parse_doctype_" + name)
j = meth(j, declstartpos) j = meth(j, declstartpos)
if j < 0: if j < 0:
return j return j
elif c == "%": elif c == "%":
# parameter entity reference # parameter entity reference
if (j + 1) == n: if (j + 1) == n:
# end of buffer; incomplete # end of buffer; incomplete
return -1 return -1
skipping to change at line 164 skipping to change at line 164
if rawdata[j] == ">": if rawdata[j] == ">":
return j return j
self.updatepos(declstartpos, j) self.updatepos(declstartpos, j)
self.error("unexpected char after internal subset") self.error("unexpected char after internal subset")
else: else:
return -1 return -1
elif c in string.whitespace: elif c in string.whitespace:
j = j + 1 j = j + 1
else: else:
self.updatepos(declstartpos, j) self.updatepos(declstartpos, j)
self.error("unexpected char %s in internal subset" % `c`) self.error("unexpected char %s in internal subset" % repr(c))
# end of buffer reached # end of buffer reached
return -1 return -1
# Internal -- scan past <!ELEMENT declarations # Internal -- scan past <!ELEMENT declarations
def _parse_doctype_element(self, i, declstartpos): def _parse_doctype_element(self, i, declstartpos):
rawdata = self.rawdata rawdata = self.rawdata
n = len(rawdata) n = len(rawdata)
name, j = self._scan_name(i, declstartpos) name, j = self._scan_name(i, declstartpos)
if j == -1: if j == -1:
return -1 return -1
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)