Commit 2e835cd7 authored by sumpfralle's avatar sumpfralle

moved stl example files from Samples/STL/ to samples/

changed installation directory names from python-pycam to pycam


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@592 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent adc0d783
......@@ -7,11 +7,11 @@ Build-Depends-Indep: python-support
Standards-Version: 3.8.4
Homepage: http://sourceforge.net/projects/pycam/
Package: python-pycam
Package: pycam
Architecture: all
Depends: python-gtk2, python-opengl (>>3.0.0~b6-3), python-gtkglext1,
${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
Recommends: python-pyode (>>1.2.0-3)
Recommends: python-pyode (>>1.2.0-3), python-psyco
Description: CAM program & library written in Python
This is a set of Python modules for toolpath generation for 3-Axis
CNC machining, and a GUI program that uses them.
......
......@@ -7,6 +7,6 @@ diff -Nur -x '*.orig' -x '*~' pycam-0.2.2//setup.py pycam-0.2.2.new//setup.py
],
- scripts = ['pycam', 'pycam_win32_postinstall.py'],
+ scripts = ['pycam'],
data_files=[("share/doc/python-pycam",[
data_files=[("share/doc/pycam",[
"COPYING.TXT",
"HOWTO.TXT",
......@@ -5,7 +5,7 @@ index 3046304..9f66f6d 100755
@@ -45,13 +45,9 @@ setup(
],
scripts = ['pycam', 'pycam_win32_postinstall.py'],
data_files=[("share/doc/python-pycam",[
data_files=[("share/doc/pycam",[
- "COPYING.TXT",
"HOWTO.TXT",
- "INSTALL.TXT",
......@@ -14,6 +14,6 @@ index 3046304..9f66f6d 100755
- "Changelog",
- "release_info.txt"]),
+ "Changelog"]),
("share/python-pycam/ui", [
("share/pycam/ui", [
os.path.join("share", "gtk-interface", "pycam-project.ui"),
os.path.join("share", "gtk-interface", "menubar.xml"),
......@@ -19,6 +19,6 @@ include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
# install the .desktop file
install/python-pycam::
cp -v desktop/pycam.desktop `pwd`/debian/python-pycam/usr/share/applications/
install/pycam::
cp -v desktop/pycam.desktop `pwd`/debian/pycam/usr/share/applications/
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
$Id$
......@@ -40,8 +40,9 @@ import pycam.Utils.log
log = pycam.Utils.log.get_logger()
EXAMPLE_MODEL_LOCATIONS = (
os.path.join(os.path.dirname(__file__), "Samples", "STL"),
"/usr/share/pycam/Samples/STL")
os.path.join(os.path.dirname(__file__), "samples"),
os.path.join(sys.prefix, "share", "pycam", "samples"),
os.path.join("usr", "share", "pycam", "samples"))
DEFAULT_MODEL_FILE = "pycam.stl"
......
......@@ -46,7 +46,7 @@ START_MENU_SUBDIR = os.path.join(START_MENU_BASEDIR, "PyCAM")
PYTHON_EXE = os.path.join(distutils.sysconfig.EXEC_PREFIX, "pythonw.exe")
START_SCRIPT = os.path.join(distutils.sysconfig.EXEC_PREFIX, "Scripts", "pycam")
PYTHON_DATA_DIR = os.path.join(distutils.sysconfig.PREFIX, "share", "python-pycam")
PYTHON_DATA_DIR = os.path.join(distutils.sysconfig.PREFIX, "share", "pycam")
# add some more doc files
DOC_FILES = [
......
......@@ -77,7 +77,7 @@ Basically you will need Python, GTK and OpenGL.
"pycam.Physics",
],
scripts = ['pycam', 'pycam_win32_postinstall.py'],
data_files=[("share/doc/python-pycam",[
data_files=[("share/doc/pycam",[
"COPYING.TXT",
"HOWTO.TXT",
"INSTALL.TXT",
......@@ -85,13 +85,13 @@ Basically you will need Python, GTK and OpenGL.
"README.TXT",
"Changelog",
"release_info.txt"]),
("share/python-pycam/ui", [
("share/pycam/ui", [
os.path.join("share", "gtk-interface", "pycam-project.ui"),
os.path.join("share", "gtk-interface", "menubar.xml"),
os.path.join("share", "gtk-interface", "logo_gui.png"),
]),
("share/python-pycam/samples",
glob.glob(os.path.join("Samples","STL","*.stl"))),
("share/pycam/samples",
glob.glob(os.path.join("samples", "*"))),
],
)
......
......@@ -51,7 +51,7 @@ import sys
DATA_DIR_ENVIRON_KEY = "PYCAM_DATA_DIR"
DATA_BASE_DIRS = [os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
os.pardir, "share", "gtk-interface"),
os.path.join(sys.prefix, "share", "python-pycam", "ui")]
os.path.join(sys.prefix, "share", "pycam", "ui")]
if DATA_DIR_ENVIRON_KEY in os.environ:
DATA_BASE_DIRS.insert(0, os.environ[DATA_DIR_ENVIRON_KEY])
......@@ -858,7 +858,7 @@ class ProjectGui:
def _locate_external_program(self, widget=None, key=None):
# the button was just activated
location = pycam.Utils.get_external_program_location(key)
if location is None:
if not location:
log.error("Failed to locate the external program '%s'. " % key \
+ "Please install the program and try again.\nOr maybe" \
+ "you need to specify the location manually.")
......
......@@ -24,7 +24,8 @@ __all__ = [ "iterators", "polynomials", "ProgressCounter"]
import os
# this is imported below on demand
#import win32.com
#import win32com
#import win32api
def get_external_program_location(key):
......@@ -32,6 +33,16 @@ def get_external_program_location(key):
potential_names = ["%s%s" % (key, ext) for ext in extensions]
windows_program_directories = {'inkscape': ['Inkscape'],
'pstoedit': ['pstoedit']}
# check the windows path via win32api
try:
import win32api
handle, location = win32api.FindExecutable(key)
if location:
return location
except:
# Wildcard exeception to match "ImportError" and "pywintypes.error"
# (for "not found").
pass
# go through the PATH environment variable
if "PATH" in os.environ:
path_env = os.environ["PATH"]
......
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