contrib: add generate_payreqpb2.sh script
This commit is contained in:
13
contrib/generate_payreqpb2.sh
Executable file
13
contrib/generate_payreqpb2.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Generates the file paymentrequest_pb2.py
|
||||||
|
|
||||||
|
CONTRIB="$(dirname "$(readlink -e "$0")")"
|
||||||
|
EL="$CONTRIB"/../electrum
|
||||||
|
|
||||||
|
if ! which protoc > /dev/null 2>&1; then
|
||||||
|
echo "Please install 'protoc'"
|
||||||
|
echo "If you're on Debian, try 'sudo apt install protobuf-compiler'?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
protoc --proto_path="$EL" --python_out="$EL" "$EL"/paymentrequest.proto
|
||||||
@@ -36,8 +36,7 @@ import aiohttp
|
|||||||
try:
|
try:
|
||||||
from . import paymentrequest_pb2 as pb2
|
from . import paymentrequest_pb2 as pb2
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# sudo apt-get install protobuf-compiler
|
sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'contrib/generate_payreqpb2.sh'")
|
||||||
sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=electrum/ --python_out=electrum/ electrum/paymentrequest.proto'")
|
|
||||||
|
|
||||||
from . import bitcoin, constants, ecc, util, transaction, x509, rsakey
|
from . import bitcoin, constants, ecc, util, transaction, x509, rsakey
|
||||||
from .util import bh2u, bfh, make_aiohttp_session
|
from .util import bh2u, bfh, make_aiohttp_session
|
||||||
|
|||||||
Reference in New Issue
Block a user