dialogs_legacy.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:inter 作者: rsms 项目源码 文件源码
def GetFolder(message=None):
    """
    Select folder dialog. Returns path if one is selected. Otherwise it returns None.
    Availability: FontLab, Macintosh, PC
    """
    path = None
    if MAC:
        if haveMacfs:
            fss, ok = macfs.GetDirectory(message)
            if ok:
                path = fss.as_pathname()
        else:
            from robofab.interface.mac.getFileOrFolder import GetFileOrFolder
            # This _also_ allows the user to select _files_, but given the
            # package/folder dichotomy, I think we have no other choice.
            path = GetFileOrFolder(message)
    elif PC:
        if inFontLab:
            if not message:
                message = ''
            path = fl.GetPathName('', message)
        else:
            myTuple = shell.SHBrowseForFolder(0, None, message, 64)
            try:
                path = shell.SHGetPathFromIDList(myTuple[0])
            except:
                pass
    else:
        _raisePlatformError('GetFile')
    return path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号