Skip to content

Commit 2b22d95

Browse files
committed
more linting
1 parent 5bc6eaf commit 2b22d95

3 files changed

+11
-10
lines changed

examples/nonblocking_serialinput_advanced.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ def userinput_handling(input_string):
5151
global runtime_print_next
5252
global runtime_print_intervall
5353

54-
if "tr" in input_string:
54+
if input_string.startswith("tr"):
5555
runtime_print = not runtime_print
56-
if "time set" in input_string:
56+
elif "time set" in input_string:
5757
my_input.print("time set:")
5858
value = nb_serialin.parse_value(input_string, "time set")
5959
if nb_serialin.is_number(value):
6060
runtime_print_intervall = value
6161
runtime_print_next = time.monotonic() + runtime_print_intervall
62-
if "exit" in input_string:
62+
elif "exit" in input_string:
6363
my_input.print("Stop Program running.")
6464
running = False
6565

@@ -92,7 +92,7 @@ def main_update():
9292
def main():
9393
"""Main."""
9494
# wait some time untill the computer / terminal is ready
95-
for i in range(10):
95+
for _i in range(10):
9696
# my_input.print(".", end="")
9797
my_input.print(".")
9898
time.sleep(0.5 / 10)
@@ -104,6 +104,7 @@ def main():
104104
my_input.print(42 * "*")
105105
my_input.print("run")
106106

107+
# pylint: disable=global-statement
107108
global running
108109
running = True
109110
while running:

examples/nonblocking_serialinput_advanced_class.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ def run(self):
104104
def main():
105105
"""Main."""
106106
# wait some time untill the computer / terminal is ready
107-
# for i in range(10):
108-
# self.my_input.print(".", end="")
109-
# time.sleep(0.5 / 10)
107+
for _i in range(10):
108+
print(".", end="")
109+
time.sleep(0.5 / 10)
110110
print("")
111111
print(42 * "*")
112112
print("nonblocking_serialinput_advanced_class.py")

examples/nonblocking_serialinput_advanced_statusline.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ def run(self):
120120
def main():
121121
"""Main."""
122122
# wait some time untill the computer / terminal is ready
123-
# for i in range(10):
124-
# self.my_input.print(".", end="")
125-
# time.sleep(0.5 / 10)
123+
for _i in range(10):
124+
print(".", end="")
125+
time.sleep(0.5 / 10)
126126
print("")
127127
print(42 * "*")
128128
print("nonblocking_serialinput_advanced_class.py")

0 commit comments

Comments
 (0)