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")
评论列表
文章目录