Skip to content

Commit f7f7199

Browse files
Restyled by autopep8
1 parent 5bcfdde commit f7f7199

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

run_example_service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ def main():
3838
required=False)
3939
args = parser.parse_args()
4040
root_path = pathlib.Path(__file__).absolute().parent
41-
41+
4242
# All services modules go here
4343
service_modules = ["service.example_service"]
44-
44+
4545
# Call for all the services listed in service_modules
4646
all_p = start_all_services(root_path,
4747
service_modules,
4848
args.run_daemon,
4949
args.daemon_config,
5050
args.run_ssl,
5151
args.mp)
52-
52+
5353
# Continuous checking all subprocess
5454
try:
5555
while True:
@@ -85,7 +85,7 @@ def start_service(cwd, service_module, run_daemon, daemon_config, run_ssl, mp):
8585
Starts SNET Daemon ("snetd") and the python module of the service
8686
at the passed gRPC port.
8787
"""
88-
88+
8989
def add_ssl_configs(conf):
9090
"""Add SSL keys to snetd.config.json"""
9191
with open(conf, "r") as f:
@@ -94,7 +94,7 @@ def add_ssl_configs(conf):
9494
snetd_configs["ssl_key"] = "/opt/singnet/.certs/privkey.pem"
9595
with open(conf, "w") as f:
9696
json.dump(snetd_configs, f, sort_keys=True, indent=4)
97-
97+
9898
all_p = []
9999
if run_daemon:
100100
if daemon_config:

service/example_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555
# Create a class to be added to the gRPC server
5656
# derived from the protobuf codes.
57+
58+
5759
class CalculatorServicer(grpc_bt_grpc.CalculatorServicer):
5860
def __init__(self):
5961
self.pid = os.getpid()
@@ -158,6 +160,7 @@ def reserve_port(grpc_port=7777):
158160
finally:
159161
sock.close()
160162

163+
161164
def main():
162165
""" Runs the gRPC server to communicate with the SNET Daemon. """
163166
parser = argparse.ArgumentParser(prog=__file__)

test_example_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
endpoint = "localhost:{}".format(
2323
registry["example_service"]["grpc"])
2424

25-
grpc_method = input("Method (add|sub|mul|div): ") if not test_flag else "mul"
25+
grpc_method = input(
26+
"Method (add|sub|mul|div): ") if not test_flag else "mul"
2627
a = float(input("Number 1: ") if not test_flag else "12")
2728
b = float(input("Number 2: ") if not test_flag else "7")
2829

0 commit comments

Comments
 (0)