Refactor and cleanup codes. No functional changes.
This commit is contained in:
34
provisioning_sdk/public/python/setup_common.py
Normal file
34
provisioning_sdk/public/python/setup_common.py
Normal file
@@ -0,0 +1,34 @@
|
||||
################################################################################
|
||||
# Copyright 2018 Google LLC.
|
||||
#
|
||||
# This software is licensed under the terms defined in the Widevine Master
|
||||
# License Agreement. For a copy of this agreement, please contact
|
||||
# widevine-licensing@google.com.
|
||||
################################################################################
|
||||
"""Common definitions for Provisioning SDK python setup files."""
|
||||
|
||||
import os
|
||||
|
||||
GEN_DIRNAME = 'test_genfiles'
|
||||
|
||||
|
||||
def _GetSdkRootDir():
|
||||
"""Obtains folder containing |GEN_DIRNAME| that is considered as root dir."""
|
||||
current_dir = os.path.realpath(os.path.dirname(__file__))
|
||||
while not os.path.isdir(os.path.join(current_dir, GEN_DIRNAME)):
|
||||
current_dir = os.path.dirname(current_dir)
|
||||
|
||||
os.chdir(current_dir)
|
||||
return current_dir
|
||||
|
||||
|
||||
SDK_ROOT_DIR = _GetSdkRootDir()
|
||||
GEN_DIR = '%s/%s' % (SDK_ROOT_DIR, GEN_DIRNAME)
|
||||
SDK_LIBRARY_DIR = os.path.join(SDK_ROOT_DIR, 'bazel-bin', 'provisioning_sdk',
|
||||
'public')
|
||||
CLIF_PREFIX = os.environ['CLIF_PREFIX']
|
||||
BUILD_DIR = os.environ['PYEXT_BUILD_DIR']
|
||||
|
||||
WVCOMMON_SRC_DIR = '%s/common/python' % GEN_DIR
|
||||
WVPROTO_SRC_DIR = '%s/protos/public' % GEN_DIR
|
||||
SDK_SRC_DIR = '%s/provisioning_sdk/public/python' % GEN_DIR
|
||||
Reference in New Issue
Block a user