debug
This commit is contained in:
parent
18528c8cf8
commit
47c1863690
3 changed files with 11 additions and 6 deletions
6
leds.py
6
leds.py
|
@ -65,11 +65,11 @@ def socket_loop():
|
|||
sock, addr = s.accept()
|
||||
with sock:
|
||||
length_data = sock.recv(4)
|
||||
print(length_data)
|
||||
logger.debug(length_data)
|
||||
length = int(length_data.decode())
|
||||
print(length)
|
||||
logger.debug(length)
|
||||
pattern_data = sock.recv(length)
|
||||
print(pattern_data)
|
||||
logger.debug(pattern_data)
|
||||
pattern.parse(pattern_data.decode())
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
debug_statements = False
|
||||
debug_statements = True
|
||||
|
||||
|
||||
def debug(msg):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import sys
|
||||
import json
|
||||
import random
|
||||
import logger
|
||||
|
||||
this = sys.modules[__name__]
|
||||
|
||||
|
@ -38,7 +39,7 @@ def div(target, arg):
|
|||
|
||||
def mod(target, arg):
|
||||
if arg <= 0:
|
||||
return target
|
||||
return target
|
||||
return target % arg
|
||||
|
||||
|
||||
|
@ -62,6 +63,10 @@ def apply(targets, args, func):
|
|||
else:
|
||||
this.values[targets[target]['channel']] = _apply(
|
||||
this.values[targets[target]['channel']], 0, func)
|
||||
logger.debug("{} : {}".format(
|
||||
targets[target]['channel'],
|
||||
this.values[targets[target]['channel']]
|
||||
))
|
||||
|
||||
|
||||
this.instructions = {
|
||||
|
@ -117,5 +122,5 @@ def pat(index, tick, previous_values):
|
|||
|
||||
def parse(str):
|
||||
this.encoded = str
|
||||
print(this.encoded)
|
||||
logger.debug(this.encoded)
|
||||
this.pattern = json.loads(this.encoded)
|
||||
|
|
Loading…
Reference in a new issue