Skip to content

Commit 7441215

Browse files
authored
Merge pull request #69 from dragonyanglong/py3_ddp_filename
Change project filename extension for py3
2 parents 20e4cce + 05488be commit 7441215

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ installed using ::
4848
To install the remaining packages see the installation instructions
4949
at their respective web pages.
5050

51+
Please note that the Python3 PDFgui will read .ddp3 files. It is also
52+
possible for it to read .ddp files that were saved by the Python2 PDFgui
53+
but it will sometimes fail to read these. We are working on a solution
54+
that will be available in a future version.
5155

5256
INSTALLATION
5357
------------------------------------------------------------------------

src/diffpy/pdfgui/gui/mainframe.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ def onOpen(self, event):
21222122
dir, filename = os.path.split(self.fullpath)
21232123
if not dir:
21242124
dir = self.workpath
2125-
matchstring = "PDFgui project files (*.ddp)|*.ddp"
2125+
matchstring = "PDFgui project files (*.ddp)|*.ddp;*.ddp3"
21262126
d = wx.FileDialog(None, "Choose a file", dir, "", matchstring)
21272127
if d.ShowModal() == wx.ID_OK:
21282128
fullpath = d.GetPath()
@@ -2167,17 +2167,17 @@ def onSaveAs(self, event):
21672167
# events of the other panels.
21682168
self.treeCtrlMain.SetFocus()
21692169

2170-
matchstring = "PDFgui project files (*.ddp)|*.ddp|All Files|*"
2170+
matchstring = "PDFgui project files (*.ddp3)|*.ddp3|All Files|*"
21712171
dir, filename = os.path.split(self.fullpath)
21722172
if not dir:
21732173
dir = self.workpath
2174-
d = wx.FileDialog(None, "Save as...", dir, filename or "project.ddp",
2174+
d = wx.FileDialog(None, "Save as...", dir, filename or "project.ddp3",
21752175
matchstring, wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
21762176
code = d.ShowModal()
21772177
if code == wx.ID_OK:
21782178
self.fullpath = d.GetPath()
2179-
if len(self.fullpath) < 4 or self.fullpath[-4:] != '.ddp':
2180-
self.fullpath += '.ddp'
2179+
if len(self.fullpath) < 5 or self.fullpath[-5:] != '.ddp3':
2180+
self.fullpath += '.ddp3'
21812181
self.workpath = os.path.dirname(self.fullpath)
21822182
self.fileHistory.AddFileToHistory(self.fullpath)
21832183
# Save the file

0 commit comments

Comments
 (0)