py3 compatibility fixes

This commit is contained in:
Yorik van Havre
2018-10-27 16:04:51 -03:00
parent cacab69204
commit ce0f871cba
18 changed files with 19 additions and 18 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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):

View File

@@ -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):

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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):

View File

@@ -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

View File

@@ -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

View File

@@ -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 = {}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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):

View File

@@ -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