Skip to content
This repository was archived by the owner on Dec 4, 2021. It is now read-only.

Commit 79491d8

Browse files
authored
changed pylint to flake8 (#64)
1 parent 415a3f1 commit 79491d8

6 files changed

Lines changed: 16 additions & 10 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ node_js:
44
install:
55
- cp client/config/config.example.js client/config/config.js
66
- npm install
7+
- python -m pip install flake8
78
script:
89
- npm run lint
910
- npm run test
11+
- flake8

server/led_sign/led_sign_server.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import grpc
22
import logging
3-
import concurrent
43
from concurrent import futures
54

65
import led_sign_pb2
@@ -24,7 +23,8 @@ def WriteCommandToSign(self, request):
2423
"--set-background-color", request.background_color[1:],
2524
"--set-font-color", request.text_color[1:],
2625
"--set-border-color", request.border_color[1:],
27-
"--set-font-filename", self.CURRENT_DIRECTORY + "fonts/9x18B.bdf",
26+
"--set-font-filename", self.CURRENT_DIRECTORY +
27+
"fonts/9x18B.bdf",
2828
]
2929
print(command)
3030
self.sign_data["text"] = request.text
@@ -33,12 +33,12 @@ def WriteCommandToSign(self, request):
3333
self.sign_data["background-color"] = request.background_color
3434
self.sign_data["font-color"] = request.text_color
3535
self.sign_data["border-color"] = request.border_color
36-
37-
if self.proc != None:
36+
37+
if self.proc is not None:
3838
self.proc.kill()
3939

4040
self.proc = subprocess.Popen(command)
41-
41+
4242
def UpdateSignText(self, request, context):
4343
response = led_sign_pb2.LedSignMessage()
4444
response.message = 'hello from pi'
@@ -60,6 +60,7 @@ def HealthCheck(self, request, context):
6060
print('we got something!')
6161
return response
6262

63+
6364
def serve():
6465
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
6566
led_sign_pb2_grpc.add_LedSignServicer_to_server(LedSignServicer(), server)

server/printing/printing_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def PrintPage(self, request, context):
4949
def HealthCheck(self, request, context):
5050
response = print_pb2.PrinterHealthStatus()
5151
response.message = "Hello from health-check!"
52-
print ('Here is the printer health status!')
52+
print('Here is the printer health status!')
5353
return response
5454

5555

server/printing_3d/byte_to_stl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import base64
22

3+
34
def decodeFile(text):
45
docoded_string = ""
56
with open(text, "rb") as encoded_file:
67
data = encoded_file.read()
78
decoded_string = base64.b64decode(data[2:-1])
8-
with open("decoded.stl","wb") as stl:
9-
stl.write(decoded_string)
9+
if docoded_string:
10+
with open("decoded.stl", "wb") as stl:
11+
stl.write(decoded_string)
12+
1013

1114
def encodeFile(stl):
1215
encoded_string = ""

server/printing_3d/print_3d_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import grpc
22
import logging
3-
import concurrent
43
from concurrent import futures
54

65
import print_3d_pb2
76
import print_3d_pb2_grpc
8-
import subprocess
97
import os
108
from os import sep
119

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
exclude=modules, node_nodules, __pycache__, *pb2*

0 commit comments

Comments
 (0)