mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
bugfix: assert not null
This commit is contained in:
parent
233d8b6f82
commit
c81223fe5b
@ -18,6 +18,7 @@ def display_text():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# receive client data
|
||||
data = request.form
|
||||
@ -43,6 +44,7 @@ def set_pixel():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# receive client data
|
||||
data = request.form
|
||||
@ -67,6 +69,7 @@ def draw_circle():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# receive client data
|
||||
data = request.form
|
||||
@ -92,6 +95,7 @@ def draw_rectangle():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# receive client data
|
||||
data = request.form
|
||||
@ -119,6 +123,7 @@ def set_color():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# receive client data
|
||||
data = request.form
|
||||
@ -144,6 +149,7 @@ def clear_canvas():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# clear matrix canvas
|
||||
matrix.clear()
|
||||
@ -152,6 +158,7 @@ def clear_canvas():
|
||||
print(e)
|
||||
response['success'] = False
|
||||
|
||||
# respond to client
|
||||
return jsonify(response)
|
||||
|
||||
@api.route('/update', methods=['GET'])
|
||||
@ -160,6 +167,7 @@ def update_matrix():
|
||||
response = { 'success': True }
|
||||
try:
|
||||
global matrix
|
||||
assert matrix is not None
|
||||
|
||||
# swap matrix canvas
|
||||
matrix.update()
|
||||
|
Loading…
Reference in New Issue
Block a user