Merge pull request #8626 from yorikvanhavre/remove-six
Arch, Draft: Remove use of six module
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
import six
|
||||
|
||||
import FreeCAD, Part, Draft, math, ArchCommands
|
||||
from FreeCAD import Vector
|
||||
|
||||
@@ -30,7 +30,6 @@ Internally it uses IfcOpenShell, which must be installed before using.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
import os
|
||||
import time
|
||||
import tempfile
|
||||
|
||||
@@ -30,7 +30,6 @@ Internally it uses IfcOpenShell, which must be installed before using.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
import os
|
||||
import math
|
||||
import time
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
"""Helper functions that are used by IFC importer and exporter."""
|
||||
import sys
|
||||
import math
|
||||
import six
|
||||
|
||||
import FreeCAD
|
||||
import Arch
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
import FreeCAD, Mesh, Draft, Part
|
||||
import json
|
||||
import six
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
|
||||
@@ -37,7 +37,12 @@
|
||||
|
||||
"""FreeCAD WebGL Exporter"""
|
||||
|
||||
import FreeCAD,Mesh,Draft,Part,OfflineRenderingUtils,json,six
|
||||
import FreeCAD
|
||||
import Mesh
|
||||
import Draft
|
||||
import Part
|
||||
import OfflineRenderingUtils
|
||||
import json
|
||||
import textwrap
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
# \brief Provides functions to return the SVG representation of text elements.
|
||||
|
||||
import math
|
||||
import six
|
||||
|
||||
import FreeCAD as App
|
||||
import draftutils.utils as utils
|
||||
|
||||
@@ -34,8 +34,6 @@ to execute the instructions stored in internal lists.
|
||||
# \ingroup draftutils
|
||||
# \brief Provides the ToDo static class to run commands with a time delay.
|
||||
|
||||
import six
|
||||
import sys
|
||||
import traceback
|
||||
import PySide.QtCore as QtCore
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ using the QtCore module.
|
||||
# @{
|
||||
import PySide.QtCore as QtCore
|
||||
import PySide.QtGui as QtGui
|
||||
import six
|
||||
|
||||
Qtranslate = QtCore.QCoreApplication.translate
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ https://knowledge.autodesk.com/support/autocad/downloads/
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import six
|
||||
import FreeCAD
|
||||
from FreeCAD import Console as FCC
|
||||
|
||||
|
||||
@@ -50,11 +50,17 @@ texts, colors,layers (from groups)
|
||||
TEXTSCALING = 1.35
|
||||
CURRENTDXFLIB = 1.40
|
||||
|
||||
import sys, os, math, re
|
||||
import six
|
||||
import sys
|
||||
import os
|
||||
import math
|
||||
import re
|
||||
import FreeCAD
|
||||
import Part, Draft, Mesh
|
||||
import DraftVecUtils, DraftGeomUtils, WorkingPlane
|
||||
import Part
|
||||
import Draft
|
||||
import Mesh
|
||||
import DraftVecUtils
|
||||
import DraftGeomUtils
|
||||
import WorkingPlane
|
||||
from Draft import _Dimension
|
||||
from FreeCAD import Vector
|
||||
from FreeCAD import Console as FCC
|
||||
@@ -263,22 +269,16 @@ def deformat(text):
|
||||
sts = re.split("\\\\(U\+....)", t)
|
||||
ns = u""
|
||||
for ss in sts:
|
||||
# print(ss, type(ss))
|
||||
if ss.startswith("U+"):
|
||||
ucode = "0x" + ss[2:]
|
||||
# In Python3 unichr doesn't exist anymore
|
||||
ns += six.unichr(eval(ucode))
|
||||
else:
|
||||
try:
|
||||
ns += ss.decode("utf8")
|
||||
except UnicodeError:
|
||||
try:
|
||||
ns += ss.decode("utf8")
|
||||
ns += ss.decode("latin1")
|
||||
except UnicodeError:
|
||||
try:
|
||||
ns += ss.decode("latin1")
|
||||
except UnicodeError:
|
||||
print("unable to decode text: ", text)
|
||||
except AttributeError:
|
||||
# this is python3 (nothing to do)
|
||||
ns += ss
|
||||
print("unable to decode text: ", text)
|
||||
except AttributeError:
|
||||
# this is python3 (nothing to do)
|
||||
ns += ss
|
||||
t = ns
|
||||
# replace degrees, diameters chars
|
||||
t = re.sub('%%d', u'°', t)
|
||||
|
||||
Reference in New Issue
Block a user