From 3ec0930f5292424f13c39f2b3c4fc99275da93ae Mon Sep 17 00:00:00 2001 From: j Date: Tue, 29 Jan 2019 16:11:35 +0530 Subject: [PATCH] update shared path, add unrar --- ctl | 8 +++++++- oml/__main__.py | 3 +++ requirements-shared.txt | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ctl b/ctl index 4c05511..c45e82b 100755 --- a/ctl +++ b/ctl @@ -37,7 +37,7 @@ if [ ! -e "$PID" ]; then fi PLATFORM_PYTHON=3.4 -SHARED_PYTHON=3.4 +SHARED_PYTHON=3.7 if [ -e "$BASE/platform_local" ]; then export PLATFORM_ENV="$BASE/platform_local" else @@ -56,10 +56,16 @@ else ARCH="_armv7l" fi PLATFORM="linux$ARCH" + if [ -e $BASE/platform_${PLATFORM}/lib/libunrar.so ]; then + export UNRAR_LIB_PATH="$BASE/platform_${PLATFORM}/lib/libunrar.so" + fi fi if [ $SYSTEM == "Darwin" ]; then PLATFORM="darwin64" PLATFORM_PYTHON=3.7 + if [ -e $BASE/platform_${PLATFORM}/lib/libunrar.dylib ]; then + export UNRAR_LIB_PATH="$BASE/platform_${PLATFORM}/lib/libunrar.dylib" + fi fi export PLATFORM_ENV="$BASE/platform_${PLATFORM}" fi diff --git a/oml/__main__.py b/oml/__main__.py index f5e2b5e..3c54ef6 100644 --- a/oml/__main__.py +++ b/oml/__main__.py @@ -17,6 +17,9 @@ if sys.platform == 'win32': site.addsitedir(site_packages) sys.path.append(join(base, 'platform_win32')) os.environ['oxCACHE'] = join(base, 'data', 'ox') + unrar_dll = join(base, 'platform_win32', 'unrar.dll') + if os.path.exists(unrar_dll): + os.environ['UNRAR_LIB_PATH'] = unrar_dll import api import commands diff --git a/requirements-shared.txt b/requirements-shared.txt index 2edce59..ced1c73 100644 --- a/requirements-shared.txt +++ b/requirements-shared.txt @@ -10,3 +10,4 @@ pysocks stem sqlitedict==1.6.0 zeroconf +unrar