Get the defaultpath of the ImagePy
(title, filt, k, para=None)
| 120 | return dic[rst] |
| 121 | |
| 122 | def getpath(title, filt, k, para=None): |
| 123 | """Get the defaultpath of the ImagePy""" |
| 124 | from .core import manager |
| 125 | dpath = manager.ConfigManager.get('defaultpath') |
| 126 | if dpath ==None: |
| 127 | dpath = root_dir # './' |
| 128 | dic = {'open':wx.FD_OPEN, 'save':wx.FD_SAVE} |
| 129 | dialog = wx.FileDialog(curapp, title, dpath, '', filt, dic[k]) |
| 130 | rst = dialog.ShowModal() |
| 131 | path = None |
| 132 | if rst == wx.ID_OK: |
| 133 | path = dialog.GetPath() |
| 134 | dpath = osp.split(path)[0] |
| 135 | manager.ConfigManager.set('defaultpath', dpath) |
| 136 | if para!=None:para['path'] = path |
| 137 | dialog.Destroy() |
| 138 | |
| 139 | return rst == wx.ID_OK if para!=None else path |
| 140 | |
| 141 | def getdir(title, filt, para=None): |
| 142 | from .core import manager |