Commit 3da0e550 authored by sumpfralle's avatar sumpfralle

fixed a compatibility issue with Python2.5

don't add the windows installer script for default packages on other platforms


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1068 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 126e6bb9
......@@ -27,10 +27,25 @@ import distutils.sysconfig
import glob
import os.path
import sys
import shutil
# add the local pycam source directory to the PYTHONPATH
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
BASE_DIR = os.path.realpath(os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, os.path.join(BASE_DIR, "src"))
from pycam import VERSION
WINDOWS_START_SCRIPT = "pycam-loader.py"
DEFAULT_START_SCRIPT = "pycam"
# we don't want to include the windows postinstall script in other installers
is_windows_installer = "bdist_wininst" in sys.argv
if is_windows_installer:
shutil.copy2(os.path.join(BASE_DIR, DEFAULT_START_SCRIPT),
os.path.join(BASE_DIR, WINDOWS_START_SCRIPT))
PLATFORM_SCRIPTS = [WINDOWS_START_SCRIPT, "pycam_win32_postinstall.py"]
else:
PLATFORM_SCRIPTS = [DEFAULT_START_SCRIPT]
setup(
name="pycam",
......@@ -80,7 +95,7 @@ Windows: select Python 2.5 in the following dialog.
"pycam.Toolpath",
"pycam.Utils",
],
scripts = ['pycam-loader.py', 'pycam_win32_postinstall.py'],
scripts = PLATFORM_SCRIPTS,
data_files=[("share/pycam/doc", [
"COPYING.TXT",
"INSTALL.TXT",
......@@ -95,4 +110,7 @@ Windows: select Python 2.5 in the following dialog.
],
)
if is_windows_installer:
os.remove(os.path.join(BASE_DIR, WINDOWS_START_SCRIPT))
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -1084,11 +1084,15 @@ class Rectangle(TransformableContainer):
if len(unique_vertices) != 2:
log.error("Invalid number of vertices: %s" % unique_vertices)
return None
if abs(unique_vertices[0].sub(unique_vertices[1]).norm - shared_vertices[0].sub(shared_vertices[1]).norm) < epsilon:
if abs(unique_vertices[0].sub(unique_vertices[1]).norm - \
shared_vertices[0].sub(shared_vertices[1]).norm) < epsilon:
try:
return Rectangle(unique_vertices[0], unique_vertices[1], shared_vertices[0], shared_vertices[1], normal=t1.normal)
return Rectangle(unique_vertices[0], unique_vertices[1],
shared_vertices[0], shared_vertices[1],
normal=t1.normal)
except ValueError:
log.warn("Triangles not combined: %s, %s" % (unique_vertices, shared_vertices))
log.warn("Triangles not combined: %s, %s" % (unique_vertices,
shared_vertices))
return None
else:
return None
......@@ -1121,7 +1125,8 @@ class Rectangle(TransformableContainer):
log.error("Unexpected corner count: %s / %s / %s" % (r1, r2, corners))
return None
try:
return Rectangle(*corners, normal=r1.normal)
return Rectangle(corners[0], corners[1], corners[2], corners[3],
normal=r1.normal)
except ValueError:
log.error("No valid rectangle found: %s" % corners)
return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment