mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Generates u-urlencoded.txt from utf-8.txt
|
||||
#
|
||||
# u-urlencoded.txt is used by Tests_Formatting_UrlEncodedToEntities
|
||||
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
def uurlencode(line):
|
||||
"""Use %u[hexvalue] percent encoding."""
|
||||
line = line.strip()
|
||||
line = ["%%u%04X" % ord(s) for s in line]
|
||||
return "".join(line)
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = sys.argv[1:]
|
||||
if args and args[0] in ("-h", "--help"):
|
||||
print "Usage: python u-urlencode.py < utf-8.txt > u-urlencoded.txt"
|
||||
sys.exit(2)
|
||||
|
||||
sys.stdin = codecs.getreader("utf-8")(sys.stdin)
|
||||
sys.stdout = codecs.getwriter("ascii")(sys.stdout)
|
||||
|
||||
lines = sys.stdin.readlines()
|
||||
sys.stdout.write( "\n".join(map(uurlencode, lines)) )
|
||||
Reference in New Issue
Block a user