[xiph-commits] r15253 - websites/validator.xspf.org
sping at svn.xiph.org
sping at svn.xiph.org
Thu Sep 4 09:15:38 PDT 2008
Author: sping
Date: 2008-09-04 09:15:37 -0700 (Thu, 04 Sep 2008)
New Revision: 15253
Modified:
websites/validator.xspf.org/check.py
Log:
Reduce whitespace
Modified: websites/validator.xspf.org/check.py
===================================================================
--- websites/validator.xspf.org/check.py 2008-09-04 16:06:27 UTC (rev 15252)
+++ websites/validator.xspf.org/check.py 2008-09-04 16:15:37 UTC (rev 15253)
@@ -123,7 +123,6 @@
print # blank line, end of headers
-
# Get the basename of this script
# co = sys._getframe().f_code
# SELFBASE = co.co_filename
@@ -251,7 +250,6 @@
<!-- BORDER -->"""
-
valid = False
intro = ""
input = ""
@@ -307,7 +305,6 @@
+ "\" class=\"blackLink\">" + cgi.escape(url) + "</a></i></b><br><br>"
-
lineHeads = [0]
if input != "":
index = -1
@@ -319,7 +316,6 @@
-
if input == "":
# Formular 600
print """
@@ -333,7 +329,6 @@
<tr>"""
-
if input == "":
# Formular centered
print """
@@ -350,14 +345,12 @@
<table style="width:100%;">"""
-
print """
<tr>
<td style="padding-bottom: 20px;" align="center"><img src="xspflogo-1.5.gif" style="width:297px; height:83px; border:0;" alt=""></td>
</tr>"""
-
if input == "":
if intro != "":
print """
@@ -484,24 +477,20 @@
checker = xml.parsers.expat.ParserCreate(None, SPIFF_NS_SEP_CHAR)
-
#############################################################################################
errorTable = ""
-
def nsXspf(localName):
return SPIFF_NS_HOME + SPIFF_NS_SEP_CHAR + localName
-
def nsXml(localName):
return XML_NS_HOME + SPIFF_NS_SEP_CHAR + localName
-
def startErrorTable():
if globals()["errorTable"] == "":
globals()["errorTable"] += """
@@ -511,13 +500,11 @@
<tr height="1"><td class="horz"> </td><td class="horz"> </td><td class="horz"> </td><td class="horz"> </td></tr>"""
-
# line is one-based
def addError(line, col, error):
globals()["errorTable"] += "<tr><td class=\"number\"><a href=\"#bad_" + str(line) + "\" class=\"number\">" + str(line) + "</a></td><td class=\"number\">" + str(col) + "</td><td class=\"vert\"> </td><td class=\"error\">" + error + "</td></tr>"
-
def stopErrorTable():
if globals()["errorTable"] != "":
globals()["errorTable"] += """
@@ -530,12 +517,10 @@
<br>"""
-
sourceTable = ""
lastLine = -1
-
def startSourceTable():
if globals()["sourceTable"] == "":
globals()["sourceTable"] = """
@@ -543,7 +528,6 @@
<table cellspacing="0">"""
-
def stopSourceTable():
startSourceTable()
@@ -603,7 +587,6 @@
globals()["lastLine"] = lineNumber
-
def fail(text):
globals()["valid"] = False
@@ -614,7 +597,6 @@
moreSourceLinesIncluding(checker.CurrentLineNumber - 1, True)
-
def handlePlaylistAttribs(atts):
versionFound = False
@@ -642,7 +624,6 @@
fail("Attribute <i>version</i> missing.")
-
def handleNoAttribsExceptXmlBase(atts):
keys = atts.keys()
for i in range(len(atts)):
@@ -655,7 +636,6 @@
fail("Attribute '" + keys[i] + "' not allowed.")
-
def handleExtensionAttribs(atts):
size = len(atts)
if size == 0:
@@ -674,7 +654,6 @@
fail("Attribute '" + name + "' not allowed.")
-
def handleMetaLinkAttribs(atts):
size = len(atts)
if size == 0:
@@ -693,7 +672,6 @@
fail("Attribute '" + name + "' not allowed.")
-
def handleStartOne(name, atts):
if name != nsXspf("playlist"):
# fail("Element '" + name + "' not allowed.")
@@ -703,7 +681,6 @@
globals()["stack"].append(TAG_PLAYLIST)
-
def handleStartTwo(name, atts):
if name == nsXspf("annotation"):
if not globals()["firstPlaylistAnnotation"]:
@@ -819,7 +796,6 @@
globals()["skipAbove"] = 2
-
def handleStartThree(name, atts):
stackTop = globals()["stack"][len(globals()["stack"]) - 1]
if stackTop == TAG_PLAYLIST_ATTRIBUTION:
@@ -859,7 +835,6 @@
globals()["skipAbove"] = 3
-
def handleStartFour(name, atts):
if name == nsXspf("album"):
if not globals()["firstTrackAlbum"]:
@@ -957,7 +932,6 @@
globals()["skipAbove"] = 4
-
def handleStart(name, atts):
newLevel = len(globals()["stack"]) + 1
if (globals()["skipAbove"] != -1) and (newLevel > globals()["skipAbove"]):
@@ -979,13 +953,11 @@
globals()["skipAbove"] = 4
-
def handleEndOne(name):
if globals()["firstPlaylistTrackList"]:
fail("Element <i>trackList</i> missing.")
-
def handleEndTwo(name):
stackTop = globals()["stack"][len(globals()["stack"]) - 1]
@@ -1033,7 +1005,6 @@
globals()["accum"] = ""
-
def handleEndThree(name):
stackTop = globals()["stack"][len(globals()["stack"]) - 1]
@@ -1066,7 +1037,6 @@
globals()["accum"] = ""
-
def handleEndFour(name):
stackTop = globals()["stack"][len(globals()["stack"]) - 1]
@@ -1115,7 +1085,6 @@
globals()["accum"] = ""
-
def handleEnd(name):
level = len(globals()["stack"])
if globals()["skipAbove"] == level:
@@ -1136,7 +1105,6 @@
globals()["stack"].pop()
-
def handleCharacters(s):
level = len(globals()["stack"])
if (globals()["skipAbove"] != -1) and (level > globals()["skipAbove"]):
@@ -1169,12 +1137,10 @@
globals()["accum"] += s
-
def isUri(text):
return Uri.MatchesUriRefSyntax(text)
-
def isDateTime(text):
match = globals()["dateRegex"].match(text)
if not match:
@@ -1200,11 +1166,9 @@
return True
-
#############################################################################################
-
if input != "":
# Results
checker.StartElementHandler = handleStart
@@ -1280,7 +1244,6 @@
print sourceTable
-
print """
</td>
</tr>
@@ -1293,7 +1256,6 @@
</form>"""
-
print """
</td>
</tr>
@@ -1322,7 +1284,6 @@
</html>"""
-
if shellMode:
if valid:
sys.exit(0)
More information about the commits
mailing list