py3 compatibility fixes
This commit is contained in:
@@ -35,7 +35,8 @@ else:
|
||||
def translate(ctxt, txt): return txt
|
||||
|
||||
|
||||
if open.__module__ == '__builtin__': pythonopen = open
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
def export(exportList, filename):
|
||||
|
||||
@@ -36,7 +36,7 @@ __url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from OpenSCADFeatures import *
|
||||
from OpenSCAD2Dgeom import *
|
||||
from OpenSCADUtils import *
|
||||
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open # to distinguish python built-in open function from the one declared here
|
||||
|
||||
def openscadmesh(doc,scadstr,objname):
|
||||
|
||||
@@ -113,7 +113,7 @@ TOOL_CHANGE = ''''''
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
def processArguments(argstring):
|
||||
|
||||
@@ -35,7 +35,7 @@ now = datetime.datetime.now()
|
||||
SHOW_EDITOR = True
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ TOOL_CHANGE = ''''''
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ now = datetime.datetime.now()
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ else:
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ TOOL_CHANGE = ''''''
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
def processArguments(argstring):
|
||||
|
||||
@@ -99,7 +99,7 @@ SUPPRESS_TOOL_CHANGE=0
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ POST_OPERATION = ''''''
|
||||
TOOL_CHANGE = ''''''
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ POST_OPERATION = ''''''
|
||||
TOOL_CHANGE = ''''''
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
CurrentState = {}
|
||||
|
||||
@@ -55,7 +55,7 @@ AXIS = 'X','Y','Z','A','B' #OpenSBP always puts multiaxis move parameters in th
|
||||
SPEEDS = 'XY','Z','A','B'
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ GCODE_FOOTER = "M30"
|
||||
|
||||
linenr = 0 # variable has to be global because it is used by linenumberify and export
|
||||
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import Part
|
||||
import PathScripts.PostUtils as PostUtils
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import Path
|
||||
import FreeCAD
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ TOOL_CHANGE = ''''''
|
||||
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
def processArguments(argstring):
|
||||
|
||||
@@ -62,7 +62,7 @@ try: import FreeCADGui
|
||||
except ValueError: gui = False
|
||||
else: gui = True
|
||||
|
||||
if open.__module__ == '__builtin__':
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user