You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2020/05/20 07:55:06 UTC
[cordova-ios] branch master updated: breaking: add python 3
compatibility to bin/cordova_plist_to_config_xml (#769)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 43e3bbd breaking: add python 3 compatibility to bin/cordova_plist_to_config_xml (#769)
43e3bbd is described below
commit 43e3bbd28bdef80c6dbf615fe732fca273826f69
Author: Christian Clauss <cc...@me.com>
AuthorDate: Wed May 20 09:54:56 2020 +0200
breaking: add python 3 compatibility to bin/cordova_plist_to_config_xml (#769)
---
bin/cordova_plist_to_config_xml | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/bin/cordova_plist_to_config_xml b/bin/cordova_plist_to_config_xml
index e781c63..0d61b3b 100755
--- a/bin/cordova_plist_to_config_xml
+++ b/bin/cordova_plist_to_config_xml
@@ -23,11 +23,12 @@ Converts a project's Cordova.plist file into a config.xml one. This conversion i
Usage:
plist2xml.py path/to/project
"""
+from __future__ import print_function
-import StringIO
import fileinput
-import plistlib
+import io
import os
+import plistlib
import re
import sys
from xml.dom import minidom
@@ -88,10 +89,10 @@ def ConvertPlist(src_path, dst_path):
root.append(ElementTree.Element('access', attrib={'origin':value}))
tree = ElementTree.ElementTree(root)
- s = StringIO.StringIO()
- tree.write(s, encoding='UTF-8')
- mini_dom = minidom.parseString(s.getvalue())
- with open(dst_path, 'w') as out:
+ with io.BytesIO() as s:
+ tree.write(s, encoding='UTF-8')
+ mini_dom = minidom.parseString(s.getvalue())
+ with open(dst_path, 'wb') as out:
out.write(mini_dom.toprettyxml(encoding='UTF-8'))
@@ -101,7 +102,7 @@ def UpdateProjectFile(path):
if 'Cordova.plist' in line:
line = line.replace('Cordova.plist', 'config.xml')
line = line.replace('lastKnownFileType = text.plist.xml', 'lastKnownFileType = text.xml')
- print line,
+ print(line, end=' ')
file_handle.close()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org