[xiph-commits] r13865 - websites/validator.xspf.org
sping at svn.xiph.org
sping at svn.xiph.org
Thu Sep 20 15:22:29 PDT 2007
Author: sping
Date: 2007-09-20 15:22:28 -0700 (Thu, 20 Sep 2007)
New Revision: 13865
Added:
websites/validator.xspf.org/hello_uri.py
Log:
First URI validation test
Added: websites/validator.xspf.org/hello_uri.py
===================================================================
--- websites/validator.xspf.org/hello_uri.py (rev 0)
+++ websites/validator.xspf.org/hello_uri.py 2007-09-20 22:22:28 UTC (rev 13865)
@@ -0,0 +1,36 @@
+# Online XSPF Validator
+# Copyright (C) 2007, Sebastian Pipping / Xiph.Org Foundation
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Sebastian Pipping, sping at xiph.org
+
+try:
+ from Ft.Lib import Uri
+except ImportError:
+ print "Package 'Ft.Lib' is missing.\n" \
+ "On Debian run 'sudo apt-get install python-4suite-xml'."
+ exit
+
+
+def checkUri(candidate):
+ print "* validUri(\"" + candidate + "\") == " \
+ + str(Uri.MatchesUriRefSyntax(candidate))
+
+
+checkUri("http://www.xiph.org/")
+checkUri("abc%20def")
+checkUri("abc def")
+
More information about the commits
mailing list