guide.py 文件源码

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

项目:mgear 作者: miquelcampos 项目源码 文件源码
def editFile(self, widgetList):
        try:
            filepath = widgetList.selectedItems()[0].text().split("|")[-1][1:]
            if os.environ.get(MGEAR_SHIFTER_CUSTOMSTEP_KEY, ""):
                editPath = os.path.join(
                    os.environ.get(
                        MGEAR_SHIFTER_CUSTOMSTEP_KEY, ""), filepath)
            else:
                editPath = filepath
            if filepath:
                if sys.platform.startswith('darwin'):
                    subprocess.call(('open', editPath))
                elif os.name == 'nt':
                    os.startfile(editPath)
                elif os.name == 'posix':
                    subprocess.call(('xdg-open', editPath))
            else:
                pm.displayWarning("Please select one item from the list")
        except Exception:
            pm.displayError("The step can't be find or does't exists")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号