mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 04:44:59 +00:00
setup.py: fix for issue #96
This commit is contained in:
parent
a686f556e3
commit
ac404b34f6
8
setup.py
8
setup.py
@ -4,8 +4,9 @@ from setuptools.command.build_py import build_py as _build
|
||||
|
||||
import os.path
|
||||
import subprocess
|
||||
import shutil
|
||||
|
||||
PROTOC_BIN = "/usr/bin/protoc"
|
||||
PROTOC_EXEC = "protoc"
|
||||
|
||||
CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )
|
||||
|
||||
@ -13,11 +14,12 @@ class ProtobufBuilder(_build):
|
||||
|
||||
def run(self):
|
||||
# check if protobuf is installed
|
||||
if not os.path.isfile(PROTOC_BIN):
|
||||
exec_path = shutil.which(PROTOC_EXEC)
|
||||
if exec_path is None:
|
||||
raise Exception("You should install protobuf compiler")
|
||||
|
||||
print("Building protobuf file")
|
||||
subprocess.run([PROTOC_BIN,
|
||||
subprocess.run([exec_path,
|
||||
"--proto_path=" + CURRENT_DIR,
|
||||
"--python_out=" + CURRENT_DIR + "/gpapi/",
|
||||
CURRENT_DIR + "/googleplay.proto"])
|
||||
|
Loading…
Reference in New Issue
Block a user