summaryrefslogtreecommitdiffstats
path: root/util/bin/uriparse
diff options
context:
space:
mode:
Diffstat (limited to 'util/bin/uriparse')
-rwxr-xr-xutil/bin/uriparse16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/bin/uriparse b/util/bin/uriparse
index 685b1ab1..b16bd9c8 100755
--- a/util/bin/uriparse
+++ b/util/bin/uriparse
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import os
-from sys import argv,exit
+from sys import argv, exit
+
def uri_parser(uri):
try:
@@ -17,12 +17,12 @@ if __name__ == "__main__":
print('usage: %s URI')
exit(1)
u = uri_parser(uri)
-
- print('SCHEME="%s"' % u.scheme)
+
+ print("SCHEME='%s'" % u.scheme.replace("'", "'\\''"))
if u.username:
- print('USERNAME="%s"' % u.username)
+ print("USERNAME='%s'" % u.username.replace("'", "'\\''"))
if u.password:
- print('PASSWORD="%s"' % u.password)
+ print("PASSWORD='%s'" % u.password.replace("'", "'\\''"))
if u.path:
- print('URIPATH="%s"' % u.path)
- print('HOSTNAME="%s"' % u.hostname)
+ print("URIPATH='%s'" % u.path.replace("'", "'\\''"))
+ print("HOSTN='%s'" % u.hostname.replace("'", "'\\''"))