Commit 18a32320 authored by sumpfralle's avatar sumpfralle

append the default extension even if there is a dot in the start of the...

append the default extension even if there is a dot in the start of the filename (not within the last five characters)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@542 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6172c29a
......@@ -1537,13 +1537,14 @@ class ProjectGui:
else:
filter_ext = filter_ext[1:]
basename = os.path.basename(filename)
splitted = basename.split(".")
if len(splitted) > 1:
if (basename.rfind(".") == -1) or (basename[-5:].rfind(".") == -1):
# The filename does not contain a dot or the dot is not within the
# last five characters. Dots within the start of the filename are
# ignored.
return filename + filter_ext
else:
# contains at least one dot
return filename
else:
# the filename does not contain a dot
return filename + filter_ext
@gui_activity_guard
def save_model(self, widget=None, filename=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment