Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pyMKcam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
pyMKcam
Commits
aca4bf3c
Commit
aca4bf3c
authored
Jan 23, 2012
by
Lars Kruse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup of directory handling for in-place execution
parent
de0d3d72
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
locations.py
pycam/Utils/locations.py
+12
-9
pycam
scripts/pycam
+4
-3
No files found.
pycam/Utils/locations.py
View file @
aca4bf3c
...
...
@@ -28,20 +28,23 @@ import pycam.Utils.log
DATA_DIR_ENVIRON_KEY
=
"PYCAM_DATA_DIR"
FONT_DIR_ENVIRON_KEY
=
"PYCAM_FONT_DIR"
DATA_BASE_DIRS
=
[
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
os
.
pardir
,
os
.
pardir
,
"share"
)),
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
os
.
pardir
,
os
.
pardir
,
"share"
,
"pycam"
)),
# this directory represents the base of the development tree
PROJECT_BASE_DIR
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
os
.
pardir
,
os
.
pardir
))
# necessary for "pyinstaller"
if
"_MEIPASS2"
in
os
.
environ
:
PROJECT_BASE_DIR
=
os
.
path
.
normpath
(
os
.
environ
[
"_MEIPASS2"
])
# lookup list of directories for UI files, fonts, ...
DATA_BASE_DIRS
=
[
os
.
path
.
join
(
PROJECT_BASE_DIR
,
"share"
),
os
.
path
.
join
(
PROJECT_BASE_DIR
,
"share"
,
"pycam"
),
os
.
path
.
join
(
sys
.
prefix
,
"local"
,
"share"
,
"pycam"
),
os
.
path
.
join
(
sys
.
prefix
,
"share"
,
"pycam"
)]
FONTS_SUBDIR
=
"fonts"
UI_SUBDIR
=
"ui"
# necessary for "pyinstaller"
if
"_MEIPASS2"
in
os
.
environ
:
DATA_BASE_DIRS
.
insert
(
0
,
os
.
path
.
join
(
os
.
path
.
normpath
(
os
.
environ
[
"_MEIPASS2"
]),
"share"
))
# respect an override via an environment setting
# respect an override via environment settings
if
DATA_DIR_ENVIRON_KEY
in
os
.
environ
:
DATA_BASE_DIRS
.
insert
(
0
,
os
.
path
.
normpath
(
os
.
environ
[
DATA_DIR_ENVIRON_KEY
]))
if
FONT_DIR_ENVIRON_KEY
in
os
.
environ
:
...
...
scripts/pycam
View file @
aca4bf3c
...
...
@@ -22,11 +22,12 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
#
extend
the
PYTHONPATH
to
include
the
"src"
directory
#
extend
the
PYTHONPATH
to
include
the
package
directory
import
sys
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
BASE_DIR
,
"src"
))
BASE_DIR
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
os
.
pardir
))
sys
.
path
.
insert
(
0
,
BASE_DIR
)
#
register
the
glut32
.
dll
manually
for
the
pyinstaller
standalone
executable
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
and
"_MEIPASS2"
in
os
.
environ
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment