Skip to content

Commit 857fd45

Browse files
authored
Update main.py with suggestions from pylint
1 parent 83a67bc commit 857fd45

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# We have a sleep later on, so we need time
22
import time
3+
# And an exit
4+
import sys
35

46
# In addition to the classes inside here, you can use the picorpcserver
57
# import itself as a wrapper around the classes inside, the end goal
@@ -27,17 +29,18 @@ def rpc_ping(v):
2729
# This function actually stops the netowrk loop, and shows one of the functions
2830
# exposed by the back end.
2931
def rpc_exit(v):
32+
del v
3033
picorpcserver.stop_listening()
3134
return "Stopping"
3235

3336
# This makes sure that the value passed in is a list of numbers
3437
# and adds them all up, otherwise returns 0
35-
def rpc_add(v):
38+
def rpc_add(v):
3639
if str(type(v)) != "<class 'list'>":
37-
return 0
40+
return 0
3841
rv = 0
3942
for val in v:
40-
rv += val
43+
rv += val
4144
return rv
4245

4346
# By setting verbose, you see most of the internals of the communication
@@ -49,7 +52,7 @@ def rpc_add(v):
4952
# otherwise, it uses DHCP after authenticating with your network
5053
if not picorpcserver.init(WIFI_SSID,WIFI_PASSWD):
5154
print("Network init failed!")
52-
exit(1)
55+
sys.exit(1)
5356

5457
# Bind a few of our functions, the format is "method",function
5558
# there is no reason these cant be functions inside a package

0 commit comments

Comments
 (0)