Fix python3 compability issues in miniedit (#1059)

This commit is contained in:
toblu302
2021-03-28 14:33:39 -07:00
committed by GitHub
parent 1b55f09c4e
commit bfb6b9f4c4
+3 -3
View File
@@ -1449,7 +1449,7 @@ class MiniEdit( Frame ):
# Load application preferences # Load application preferences
if 'application' in loadedTopology: if 'application' in loadedTopology:
self.appPrefs = dict(self.appPrefs.items() + loadedTopology['application'].items()) self.appPrefs.update(loadedTopology['application'])
if "ovsOf10" not in self.appPrefs["openFlowVersions"]: if "ovsOf10" not in self.appPrefs["openFlowVersions"]:
self.appPrefs["openFlowVersions"]["ovsOf10"] = '0' self.appPrefs["openFlowVersions"]["ovsOf10"] = '0'
if "ovsOf11" not in self.appPrefs["openFlowVersions"]: if "ovsOf11" not in self.appPrefs["openFlowVersions"]:
@@ -1683,7 +1683,7 @@ class MiniEdit( Frame ):
savingDictionary['application'] = self.appPrefs savingDictionary['application'] = self.appPrefs
try: try:
f = open(fileName, 'wb') f = open(fileName, 'w')
f.write(json.dumps(savingDictionary, sort_keys=True, indent=4, separators=(',', ': '))) f.write(json.dumps(savingDictionary, sort_keys=True, indent=4, separators=(',', ': ')))
# pylint: disable=broad-except # pylint: disable=broad-except
except Exception as er: except Exception as er:
@@ -1702,7 +1702,7 @@ class MiniEdit( Frame ):
fileName = tkFileDialog.asksaveasfilename(filetypes=myFormats ,title="Export the topology as...") fileName = tkFileDialog.asksaveasfilename(filetypes=myFormats ,title="Export the topology as...")
if len(fileName ) > 0: if len(fileName ) > 0:
# debug( "Now saving under %s\n" % fileName ) # debug( "Now saving under %s\n" % fileName )
f = open(fileName, 'wb') f = open(fileName, 'w')
f.write("#!/usr/bin/env python\n") f.write("#!/usr/bin/env python\n")
f.write("\n") f.write("\n")