Merge pull request #8626 from yorikvanhavre/remove-six

Arch, Draft: Remove use of six module
This commit is contained in:
Yorik van Havre
2023-02-28 09:35:52 +01:00
committed by GitHub
11 changed files with 24 additions and 29 deletions

View File

@@ -19,7 +19,6 @@
#* *
#***************************************************************************
import six
import FreeCAD, Part, Draft, math, ArchCommands
from FreeCAD import Vector

View File

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

View File

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

View File

@@ -21,7 +21,6 @@
"""Helper functions that are used by IFC importer and exporter."""
import sys
import math
import six
import FreeCAD
import Arch

View File

@@ -23,7 +23,6 @@
import FreeCAD, Mesh, Draft, Part
import json
import six
if FreeCAD.GuiUp:
import FreeCADGui

View File

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

View File

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

View File

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

View File

@@ -34,7 +34,6 @@ using the QtCore module.
# @{
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
import six
Qtranslate = QtCore.QCoreApplication.translate

View File

@@ -44,7 +44,6 @@ https://knowledge.autodesk.com/support/autocad/downloads/
# * *
# ***************************************************************************
import six
import FreeCAD
from FreeCAD import Console as FCC

View File

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