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