Skip to content

Commit 77a2583

Browse files
authored
Merge pull request #47 from gpilab/develop
Windows bugfixes - node library generator, gpi_make
2 parents 24b7059 + f7eacdc commit 77a2583

File tree

6 files changed

+43
-22
lines changed

6 files changed

+43
-22
lines changed

launch/GPI.desktop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# No longer in use - deprecate at some point
12
[Desktop Entry]
23
Version=1.0
34
Name=GPI

launch/gpi.app

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
# MAKES NO WARRANTY AND HAS NO LIABILITY ARISING FROM ANY USE OF THE
2525
# SOFTWARE IN ANY HIGH RISK OR STRICT LIABILITY ACTIVITIES.
2626

27+
# No longer in use - deprecate at some point
28+
2729
# The GPI launcher script for the app.
2830
ANACONDA=/opt/anaconda1anaconda2anaconda3
2931
# The launcher must point to a script with the ".command" suffix so that 'open'

launch/gpi.command

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ ANACONDA=/opt/anaconda1anaconda2anaconda3
3636
PYTHON=${ANACONDA}/bin/python
3737
GPI_LAUNCH=${ANACONDA}/bin/gpi_launch
3838

39-
BINDIR="$ANACONDA/bin"
40-
if ! echo $PATH | grep -q $BINDIR ; then
41-
PATH="${BINDIR}:${PATH}"
42-
fi
43-
4439
GPI_LINK=/tmp/GPI
4540

4641
# OSX

launch/gpi_cmd.bat

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,5 @@ set ANACONDA=/opt/anaconda1anaconda2anaconda3
3030
set PYTHON=%ANACONDA%\python
3131
set GPI_LAUNCH=%ANACONDA%\Scripts\gpi_launch
3232

33-
:: Add needed folders to the path if launching from outside an active conda
34-
set ANACONDA_WIN=%ANACONDA:/=\%
35-
echo %PATH% | findstr %ANACONDA_WIN% > NUL
36-
if %ERRORLEVEL% NEQ 0 goto :fixpath
37-
goto :endif
38-
39-
:fixpath
40-
set PATH=%ANACONDA_WIN%\bin;%PATH%
41-
set PATH=%ANACONDA_WIN%\Scripts;%PATH%
42-
set PATH=%ANACONDA_WIN%\Library\bin;%PATH%
43-
set PATH=%ANACONDA_WIN%\Library\usr\bin;%PATH%
44-
set PATH=%ANACONDA_WIN%\Library\mingw-w64\bin;%PATH%
45-
set PATH=%ANACONDA_WIN%;%PATH%
46-
:endif
47-
4833
%PYTHON% %GPI_LAUNCH% -style Windows %*
4934

launch/gpi_make.cmd

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@echo off
2+
setlocal
3+
:: Copyright (C) 2014 Dignity Health
4+
::
5+
:: This program is free software: you can redistribute it and/or modify
6+
:: it under the terms of the GNU Lesser General Public License as published by
7+
:: the Free Software Foundation, either version 3 of the License, or
8+
:: (at your option) any later version.
9+
::
10+
:: This program is distributed in the hope that it will be useful,
11+
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
:: GNU Lesser General Public License for more details.
14+
::
15+
:: You should have received a copy of the GNU Lesser General Public License
16+
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
::
18+
:: NO CLINICAL USE. THE SOFTWARE IS NOT INTENDED FOR COMMERCIAL PURPOSES
19+
:: AND SHOULD BE USED ONLY FOR NON-COMMERCIAL RESEARCH PURPOSES. THE
20+
:: SOFTWARE MAY NOT IN ANY EVENT BE USED FOR ANY CLINICAL OR DIAGNOSTIC
21+
:: PURPOSES. YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE IS NOT INTENDED FOR
22+
:: USE IN ANY HIGH RISK OR STRICT LIABILITY ACTIVITY, INCLUDING BUT NOT
23+
:: LIMITED TO LIFE SUPPORT OR EMERGENCY MEDICAL OPERATIONS OR USES. LICENSOR
24+
:: MAKES NO WARRANTY AND HAS NO LIABILITY ARISING FROM ANY USE OF THE
25+
:: SOFTWARE IN ANY HIGH RISK OR STRICT LIABILITY ACTIVITIES.
26+
27+
:: The GPI make script for Windows installations.
28+
29+
set ANACONDA=/opt/anaconda1anaconda2anaconda3
30+
set PYTHON=%ANACONDA%\python
31+
set GPI_MAKE=%ANACONDA%\Scripts\gpi_make
32+
33+
%PYTHON% %GPI_MAKE% %*
34+

lib/gpi/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@
5050
USER_HOME = os.environ['HOME']
5151

5252
USER_LIB_BASE_PATH_DEFAULT = os.path.join(USER_HOME, 'gpi')
53+
if Specs.inWindows():
54+
userNameKey = 'USERNAME'
55+
else:
56+
userNameKey = 'USER'
5357
try:
54-
USER_LIB_PATH_DEFAULT = os.path.join(USER_LIB_BASE_PATH_DEFAULT, os.environ['USER'])
58+
USER_LIB_PATH_DEFAULT = os.path.join(USER_LIB_BASE_PATH_DEFAULT, os.environ.get(userNameKey))
5559
except KeyError:
56-
USER_LIB_PATH_DEFAULT = ''
60+
USER_LIB_PATH_DEFAULT = os.path.join(USER_LIB_BASE_PATH_DEFAULT, 'UserNodes')
5761

5862
ANACONDA_PREFIX='/opt/anaconda1anaconda2anaconda3' # is this needed?
5963
GPI_PREFIX = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)