diff --git a/dump_dish_status.py b/dump_dish_status.py index 8496c88..3f6cee9 100644 --- a/dump_dish_status.py +++ b/dump_dish_status.py @@ -1,11 +1,19 @@ #!/usr/bin/python3 """Simple example of get_status request using grpc call directly.""" +import sys + import grpc -from spacex.api.device import device_pb2 -from spacex.api.device import device_pb2_grpc -from spacex.api.device import dish_pb2 +try: + from spacex.api.device import device_pb2 + from spacex.api.device import device_pb2_grpc + from spacex.api.device import dish_pb2 +except ModuleNotFoundError: + print("This script requires the generated gRPC protocol modules. " + "See README file for details.", + file=sys.stderr) + sys.exit(1) # Note that if you remove the 'with' clause here, you need to separately # call channel.close() when you're done with the gRPC connection.