Changeset 473 for trunk/scanCCD.py


Ignore:
Timestamp:
Feb 7, 2012 12:54:11 PM (10 years ago)
Author:
vondreele
Message:

Add FileDlgFixExt? to fix linux problem in FileDialog? where the extension is not taken from the wildcard choice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scanCCD.py

    r451 r473  
    2727] = [wx.NewId() for _init_coll_File_Items in range(4)]
    2828
     29def FileDlgFixExt(dlg,file):            #this is needed to fix a problem in linux wx.FileDialog
     30    ext = dlg.GetWildcard().split('|')[2*dlg.GetFilterIndex()+1].strip('*')
     31    if ext not in file:
     32        file += ext
     33    return file
     34   
    2935class scanCCD(wx.Frame):
    3036
     
    265271        try:
    266272            if dlg.ShowModal() == wx.ID_OK:
     273                print dlg.GetFilename()
    267274                powderfile = dlg.GetPath()
    268275                if 'fxye' in powderfile:
Note: See TracChangeset for help on using the changeset viewer.