Auto optimize imports

* Remove unused
* Rearrange imports (module > partial > project)
This commit is contained in:
Rotzbua 2022-12-31 15:52:55 +01:00 committed by Florian Festi
parent 20032e50be
commit ad38bb1eaf
60 changed files with 102 additions and 102 deletions

View File

@ -14,27 +14,29 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import math
import sys
import argparse
from argparse import ArgumentParser
import re
from functools import wraps
from xml.sax.saxutils import quoteattr
from contextlib import contextmanager
import copy
import math
import random
import re
import sys
from argparse import ArgumentParser
from contextlib import contextmanager
from functools import wraps
from shlex import quote
from xml.sax.saxutils import quoteattr
from shapely.geometry import *
from shapely.ops import split
import random
from boxes import edges
from boxes import formats
from boxes import svgutil
from boxes import gears
from boxes import pulley
from boxes import parts
from boxes.Color import *
from boxes import pulley
from boxes import svgutil
from boxes.Color import *
### Helpers

View File

@ -1,10 +1,11 @@
import math
import datetime
from affine import Affine
from boxes.extents import Extents
from boxes.Color import Color as bColor
import math
from xml.etree import ElementTree as ET
from affine import Affine
from boxes.extents import Extents
EPS = 1e-4
PADDING = 10

View File

@ -14,14 +14,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import math
import inspect
import argparse
import re
import abc
import argparse
import inspect
import math
import re
from boxes import gears
def argparseSections(s):
"""
Parse sections parameter

View File

@ -15,12 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import subprocess
import tempfile
import os
import shutil
import subprocess
import tempfile
from boxes.drawing import SVGSurface, PSSurface, LBRN2Surface, Context
class Formats:
pstoedit_candidates = ["/usr/bin/pstoedit", "pstoedit", "pstoedit.exe"]

View File

@ -40,8 +40,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Fixed https://github.com/jnweiger/inkscape-gears-dev
'''
from os import devnull # for debugging
from math import pi, cos, sin, tan, radians, degrees, ceil, asin, acos, sqrt
from os import devnull # for debugging
two_pi = 2 * pi
import argparse
from boxes.vectors import kerf, vdiff, vlength

View File

@ -1,6 +1,7 @@
import pkgutil
import inspect
import importlib
import inspect
import pkgutil
import boxes
ui_groups_by_name = {}

View File

@ -16,6 +16,7 @@
import math
from functools import partial
from boxes import Boxes, edges
from .dividertray import (
SlotDescriptionsGenerator,

View File

@ -15,8 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
import copy
class AngledBox(Boxes):
"""Box with both ends cornered"""

View File

@ -1,9 +1,6 @@
"""Generator for a split atreus keyboard."""
from copy import deepcopy
from boxes import Boxes, Color, holeCol, restore, boolarg
from boxes.edges import FingerJointSettings
from boxes import Boxes, restore
from .keyboard import Keyboard

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math, copy
class BinFrontEdge(edges.BaseEdge):
char = "B"

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class FrontEdge(edges.BaseEdge):
char = "a"

View File

@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import math
from boxes import Boxes, boolarg

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Display(Boxes):
"""Diplay for flyers or leaflets"""

View File

@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from functools import partial
from boxes import Boxes, edges, boolarg
import math
from functools import partial
from boxes import Boxes, edges, boolarg
class NotchSettings(edges.Settings):

View File

@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import boxes
import math
import boxes
class DoubleFlexDoorBox(boxes.Boxes):
"""Box with two part lid with living hinges and round corners"""

View File

@ -14,8 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import boxes
from boxes import *
class DrillStand(Boxes):
"""Box for drills with each compartment of a different height"""

View File

@ -14,11 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from shapely.geometry import *
import random
import time
from boxes import *
class FillTest(Boxes): # Change class name!
"""Piece for testing different settings for hole filling"""

View File

@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import boxes
import math
import boxes
class FlexBox(boxes.Boxes):
"""Box with living hinge and round corners"""

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class FlexBox2(Boxes):
"""Box with living hinge and top corners rounded"""

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class FlexBox3(Boxes):

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class FlexBox4(Boxes):

View File

@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import boxes
import math
import boxes
class FlexBox5(boxes.Boxes):
"""Box with living hinge and round corners"""

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Folder(Boxes):

View File

@ -15,9 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from shapely.geometry import *
import random
import time
class HolePattern(Boxes):
"""Generate hole patterns in different simple shapes"""

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Hook(Boxes):
"""A hook wit a rectangular mouth to mount at the wall"""

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import random
class JigsawPuzzle(Boxes): # change class name here and below

View File

@ -14,9 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
import argparse
from boxes import Boxes, boolarg
import re
from boxes import boolarg
class Keyboard:
"""

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
"""
22x7.5x7cm

View File

@ -14,9 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from math import *
from boxes import *
class LaptopStand(Boxes): # Change class name!
"""A simple X shaped frame to support a laptop on a given angle"""

View File

@ -13,7 +13,6 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import decimal
from boxes import Boxes, edges, boolarg

View File

@ -17,8 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from math import *
from boxes import *
from math import *
pitches = ['c', 'c#', 'd', 'd#', 'e', 'f', 'f#', 'g', 'g#', 'a', 'a#' ,'b']

View File

@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import math
from boxes import Boxes

View File

@ -16,6 +16,7 @@
import math
from functools import partial
from boxes import Boxes, edges

View File

@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Planetary(Boxes):

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Planetary2(Boxes):

View File

@ -15,9 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.edges import FingerJointBase, FingerJointEdge
from boxes.edges import FingerJointEdge
from math import sin, pi
class UnevenFingerJointEdge(FingerJointEdge):
"""Uneven finger joint edge """

View File

@ -16,7 +16,6 @@
from boxes import *
from boxes import pulley
import math
class Pulley(Boxes):

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.generators.rack19box import Rack19Box
class Rack10Box(Rack19Box):

View File

@ -1,7 +1,7 @@
"""Half 19inch rack unit for musical equipment."""
from boxes import Boxes
from boxes.edges import Edge
class Rack19HalfWidth(Boxes):
"""Half width 19inch rack unit for musical equipment."""

View File

@ -16,7 +16,7 @@
from boxes import *
from boxes.generators.bayonetbox import BayonetBox
import copy
class RegularBox(BayonetBox):
"""Box with regular polygon as base"""

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import copy
class SlotEdge(edges.Edge):

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class Stachel(Boxes):
"""Bass Recorder Endpin"""

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
import math
class ShadyEdge(edges.BaseEdge):
char = "s"

View File

@ -14,10 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, re
from boxes import *
import boxes
import argparse
from boxes import *
class TrayLayout(Boxes):

View File

@ -16,7 +16,7 @@
from boxes import *
from boxes.lids import _TopEdge, _ChestLid
import math
class UBox(_TopEdge, _ChestLid):
"""Box various options for different stypes and lids"""

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.walledges import _WallMountedBox
class WallCaliper(_WallMountedBox):

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.walledges import _WallMountedBox
class WallConsole(_WallMountedBox):

View File

@ -15,8 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from .drillstand import DrillStand
from boxes.walledges import _WallMountedBox
from .drillstand import DrillStand
class WallDrillBox(DrillStand, _WallMountedBox):
"""Box for drills with each compartment with a different height"""

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.walledges import _WallMountedBox
class WallEdges(_WallMountedBox):

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.walledges import _WallMountedBox
class WallPlaneHolder(_WallMountedBox):

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from boxes import *
from boxes.walledges import _WallMountedBox
class WallStairs(_WallMountedBox):

View File

@ -1,6 +1,8 @@
from math import *
from boxes import vectors
def arcOnCircle(spanning_angle, outgoing_angle, r=1.0):
angle = spanning_angle + 2 * outgoing_angle
radius = r * sin(radians(0.5 * spanning_angle)) / sin(radians(180 - outgoing_angle - 0.5 * spanning_angle))

View File

@ -12,6 +12,7 @@
// pulley diameter checked and modelled from data at http://www.sdp-si.com/D265/HTML/D265T016.html
"""
from math import *
from boxes.vectors import *

View File

@ -1,5 +1,3 @@
import boxes
__all__ = [
"RobotArg",
"RobotArmMM",

View File

@ -1,6 +1,8 @@
import boxes.vectors
import math
import boxes.vectors
class EyeEdge(boxes.edges.FingerHoleEdge):
char = "m"

View File

@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re, datetime
import re
from xml.etree import ElementTree
ElementTree.register_namespace("","http://www.w3.org/2000/svg")
@ -76,7 +76,6 @@ def svgMerge(box, inkscape, output):
off_y = (src_view[1]+src_view[3]) * -scale_y + dest_height * scale_y
for el in src_tree.getroot():
import sys
dest_root.append(el)
if el.tag.endswith("g"):
el.set("transform", "matrix(%f,0,0,%f, %f, %f)" % (

View File

@ -1,7 +1,9 @@
from .edges import Settings, BaseEdge
from boxes import Boxes, edges
import math
from boxes import Boxes, edges
from .edges import Settings, BaseEdge
class _WallMountedBox(Boxes):
ui_group = "WallMounted"

View File

@ -14,11 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import argparse
import os.path
import sys
from xml.sax.saxutils import quoteattr
from urllib.parse import unquote_plus
try:
import boxes.generators

View File

@ -14,9 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import os.path
import argparse
import os.path
import sys
try:
import boxes.generators

View File

@ -14,25 +14,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import argparse
import html
import tempfile
import os.path
import threading
import time
import codecs
import mimetypes
import re
import markdown
import gettext
import glob
import html
import mimetypes
import os.path
import re
import sys
import tempfile
import threading
import time
import traceback
from urllib.parse import unquote_plus, quote
from urllib.parse import parse_qs
from wsgiref.util import setup_testing_defaults
from urllib.parse import unquote_plus, quote
from wsgiref.simple_server import make_server
import wsgiref.util
import markdown
try:
import boxes.generators