本文整理匯總了Python中OpenSCADUtils.workaroundforissue128needed方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenSCADUtils.workaroundforissue128needed方法的具體用法?Python OpenSCADUtils.workaroundforissue128needed怎麽用?Python OpenSCADUtils.workaroundforissue128needed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenSCADUtils
的用法示例。
在下文中一共展示了OpenSCADUtils.workaroundforissue128needed方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: readfile
# 需要導入模塊: import OpenSCADUtils [as 別名]
# 或者: from OpenSCADUtils import workaroundforissue128needed [as 別名]
def readfile(filename):
import os
global lastimportpath
lastimportpath,relname = os.path.split(filename)
isopenscad = relname.lower().endswith('.scad')
if isopenscad:
tmpfile=callopenscad(filename)
if OpenSCADUtils.workaroundforissue128needed():
lastimportpath = os.getcwd() #https://github.com/openscad/openscad/issues/128
f = pythonopen(tmpfile)
else:
f = pythonopen(filename)
rootnode=parsenode(f.read())[0]
f.close()
if isopenscad and tmpfile:
try:
os.unlink(tmpfile)
except OSError:
pass
return rootnode.flattengroups()