forked from sighthoundinc/SighthoundVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app
executable file
·116 lines (100 loc) · 3.21 KB
/
app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
#*****************************************************************************
#
# app
# Script for launching the app in debug mode
#
#
#*****************************************************************************
#
#
# Copyright 2013-2022 Sighthound, Inc.
#
# Licensed under the GNU GPLv3 license found at
# https://www.gnu.org/licenses/gpl-3.0.txt
#
# Alternative licensing available from Sighthound, Inc.
# by emailing [email protected]
#
# This file is part of the Sighthound Video project which can be found at
# https://github.com/sighthoundinc/SighthoundVideo
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; using version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
#
#
#*****************************************************************************
if [ `uname` == Darwin ]; then
LIBSUB="lib"
else
LIBSUB="bin"
fi
export SV3RDPARTYDIR=`pwd`/build/stagingRoot
export SVINSTALLDIR=$SV3RDPARTYDIR
if [ `uname` == Darwin ]; then
export SV_DEVEL_LIB_FOLDER_CONAN=$SV3RDPARTYDIR/$LIBSUB
export SV_DEVEL_LIB_FOLDER_LOCAL=$SVINSTALLDIR/$LIBSUB
else
export SV_DEVEL_LIB_FOLDER_CONAN=`cygpath -w $SV3RDPARTYDIR/$LIBSUB`
export SV_DEVEL_LIB_FOLDER_LOCAL=`cygpath -w $SVINSTALLDIR/$LIBSUB`
fi
if [ "$1" != "--no-libs" ]; then
conan install . -if `pwd`/build
conan build . -bf `pwd`/build
fi
pyfolderline=`conan info . --package-filter svpython* --paths 2>/dev/null | grep package_folder`
pyfolder=`echo $pyfolderline | sed 's/.*package_folder:[ \t]*//g'`
echo "pyfolder=${pyfolder}"
if [ `uname` == Darwin ]; then
PYLOC="${pyfolder}/Python.framework/Versions/2.7"
PYSUB="/bin"
PYPATH="/lib/python2.7/site-packages"
runCmd=""
else
PYLOC=${pyfolder}
PYSUB=""
PYPATH="\Lib"
runCmd="bash "
export PATH=$PATH:$SV_DEVEL_LIB_FOLDER_CONAN:$SV_DEVEL_LIB_FOLDER_LOCAL
fi
if [[ $PATH == *"${pyfolder}"* ]]; then
echo "Python is already activated!"
else
echo "python activation goes here"
export PATH=$PYLOC$PYSUB:$PATH
echo $PATH
export PYTHONPATH=$PYLOC$PYPATH
echo $PYTHONPATH
fi
echo `which python`
export SVPYTHONROOT=$PYLOC
myPath=`dirname $0`
revNum=`./scripts/getRevision.sh`
runCmd="$runCmd$myPath/run"
if [ "$1" == "--no-libs" ]; then
shift
fi
if [ -e .oldRevNum ]; then
oldRevNum=`cat .oldRevNum`
if [ "$revNum" != "$oldRevNum" ]; then
echo "Detected git update; quitting backend."
${runCmd} python frontEnd/BackEndClient.py quit
fi
fi
echo "$revNum" > .oldRevNum
echo "Running ${runCmd}"
source setupEnvironment
${runCmd} python frontEnd/FrontEnd.py "$@"
#=====================================================
# This can be used for sanity tests when Sentry fails to load
# python `pwd`/scripts/testDetections.py