fixing code snippet - open even if contentNotSaved

This commit is contained in:
Matt Clapp
2017-08-01 21:09:53 -07:00
parent b4c62f8e2e
commit 0f94be4e68

View File

@@ -7,21 +7,21 @@
wx.ICON_QUESTION | wx.YES_NO, self) == wx.NO:
return
# else: proceed asking to the user the new file to open
# else: proceed asking to the user the new file to open
openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
"XYZ files (*.xyz)|*.xyz", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
if openFileDialog.ShowModal() == wx.ID_CANCEL:
return # the user changed idea...
openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
"XYZ files (*.xyz)|*.xyz", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
if openFileDialog.ShowModal() == wx.ID_CANCEL:
return # the user changed idea...
# proceed loading the file chosen by the user
# this can be done with e.g. wxPython input streams:
input_stream = wx.FileInputStream(openFileDialog.GetPath())
if not input_stream.IsOk():
wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
return
# proceed loading the file chosen by the user
# this can be done with e.g. wxPython input streams:
input_stream = wx.FileInputStream(openFileDialog.GetPath())
if not input_stream.IsOk():
wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
return