Skip to content

Commit

Permalink
py3 qt5 improving compatibility plus AppImage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Mar 13, 2019
1 parent 7758432 commit 209d66b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
6 changes: 4 additions & 2 deletions cadquery/FCAD_script_generator/Inductors_SMD/create_model.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ echo cadquery-freecad-module required
@echo ON
cd %~p0
:: start "" "d:\FreeCAD_015\bin\freecad" main_generator.py 0402
start "" "d:\FreeCAD_015\bin\freecad" main_generator.py %1
::start "" "c:\FreeCAD-daily\bin\freecad" main_generator.py L_Wuerth_MAPI-1610
start "" "c:\FreeCAD\bin\freecad" main_generator.py L_Wuerth_MAPI-1610
::start "" "c:\FreeCAD\bin\freecad" main_generator.py %1

::pause
::pause
26 changes: 20 additions & 6 deletions cadquery/FCAD_script_generator/Inductors_SMD/main_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@
import sys, os
import datetime
from datetime import datetime
sys.path.append("../_tools")
here=os.path.dirname(os.path.abspath(__file__))
#print('here',here)
#print('joined',os.path.join(here[0:here.rfind(os.sep)],"_tools"))
sys.path.append(os.path.join(here[0:here.rfind(os.sep)],"_tools"))
sys.path.append(os.path.join(here[0:here.rfind(os.sep)],"exportVRML"))

#sys.path.append("../_tools")
import exportPartToVRML as expVRML
import shaderColors

Expand Down Expand Up @@ -109,7 +115,14 @@
# Import cad_tools
import cq_cad_tools
# Reload tools
reload(cq_cad_tools)
def reload_lib(lib):
if (sys.version_info > (3, 0)):
import importlib
importlib.reload(lib)
else:
reload (lib)

reload_lib(cq_cad_tools)
# Explicitly load all needed functions
from cq_cad_tools import FuseObjs_wColors, GetListOfObjects, restore_Main_Tools, \
exportSTEP, close_CQ_Example, exportVRML, saveFCdoc, z_RotateObject, Color_Objects, \
Expand All @@ -119,7 +132,8 @@
# from export_x3d import exportX3D, Mesh
try:
# Gui.SendMsgToActiveView("Run")
from Gui.Command import *
#from Gui.Command import *
from CQGui.Command import *
Gui.activateWorkbench("CadQueryWorkbench")
import cadquery as cq
from Helpers import show
Expand All @@ -136,7 +150,7 @@
try:
close_CQ_Example(App, Gui)
except: # catch *all* exceptions
print "CQ 030 doesn't open example file"
print ("CQ 030 doesn't open example file")

import cq_parameters # modules parameters
from cq_parameters import *
Expand Down Expand Up @@ -208,8 +222,8 @@ def make_inductor(params):
#stop

if len(sys.argv) < 3:
FreeCAD.Console.PrintMessage('No variant name is given! building 0402')
model_to_build='0402'
FreeCAD.Console.PrintMessage('No variant name is given! building L_Wuerth_MAPI-1610')
model_to_build='L_Wuerth_MAPI-1610'
else:
model_to_build=sys.argv[2]

Expand Down
5 changes: 4 additions & 1 deletion cadquery/FCAD_script_generator/_tools/cq_cad_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__author__ = "maurice"
__Comment__ = 'CadQuery exporting and fusion libs to generate STEP and VRML models with colors'

___ver___ = "1.2.4 02/12/2017"
___ver___ = "1.2.5 13/13/2019"

import FreeCAD, Draft, FreeCADGui
from cqToolsExceptions import *
Expand Down Expand Up @@ -575,6 +575,9 @@ def checkRequirements(cq):
FreeCAD.Console.PrintMessage(FreeCAD.Version())
FC_majorV=FreeCAD.Version()[0];FC_minorV=FreeCAD.Version()[1]
FreeCAD.Console.PrintMessage('FC Version '+FC_majorV+FC_minorV+'\r\n')
import PySide, sys
FreeCAD.Console.PrintMessage('QtCore Version '+PySide.QtCore.qVersion()+'\n')
FreeCAD.Console.PrintMessage('Python Version '+sys.version+'\n')

if int(FC_majorV) <= 0:
if int(FC_minorV) < 15:
Expand Down

0 comments on commit 209d66b

Please sign in to comment.