File tree Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -258,15 +258,15 @@ def _update(self, new_state):
258
258
getattr (self , alias )._kill ()
259
259
if 'assert' in new_state .keys () :
260
260
# A node assert, print assert informations
261
- if (('node_id' in new_state . keys () ['assert' ]) and ('file' in new_state . keys () ['assert' ]) and ('line' in new_state . keys () ['assert' ])):
261
+ if (('node_id' in new_state ['assert' ]) and ('file' in new_state ['assert' ]) and ('line' in new_state ['assert' ])):
262
262
s = "************************* ASSERT *************************\n "
263
263
s += "* Node " + str (new_state ['assert' ]['node_id' ]) + " assert in file " + new_state ['assert' ]['file' ] + " line " + str (new_state ['assert' ]['line' ])
264
264
s += "\n **********************************************************"
265
265
print (s )
266
266
if 'services' not in new_state .keys ():
267
267
return
268
268
269
- for alias , mod in new_state . keys () ['services' ].items ():
269
+ for alias , mod in new_state ['services' ].items ():
270
270
if hasattr (self , alias ):
271
271
getattr (self , alias )._update (mod )
272
272
Original file line number Diff line number Diff line change @@ -114,21 +114,14 @@ def extract_line(s):
114
114
return extract_line (s [H + 1 :])
115
115
else :
116
116
# Footer is ok
117
- for _ , search_void in enumerate (s [data_start :6 ]):
118
- if search_void == b'{}\n ' :
119
- # Drop void datas
120
- for index , search_header in enumerate (data ):
121
- if search_header == b'\x7E ' :
122
- return extract_line (s [(data_start + index + 1 ):])
123
- # Return the data
124
117
return s [data_start :data_end ], s [data_end + 1 :]
125
118
126
119
buff = b''
127
120
128
121
while self ._running :
129
122
to_read = self ._serial .in_waiting
130
123
131
- if ( to_read == 0 ) and ( len ( buff ) == 0 ) :
124
+ if to_read == 0 :
132
125
time .sleep (self .period )
133
126
continue
134
127
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ def __repr__(self):
51
51
'id={self.id}>' .format (self = self ))
52
52
53
53
def _update (self , new_state ):
54
+ if not isinstance (new_state , dict ):
55
+ new_state = {new_state : "" }
56
+
54
57
if ((time .time () - self ._last_update ) != 0 ):
55
58
self .refresh_freq = ((200.0 * self .refresh_freq ) + (1.0 / (time .time () - self ._last_update ))) / 201.0
56
59
self ._last_update = time .time ()
Original file line number Diff line number Diff line change 1
- version = '2.2.6 '
1
+ version = '2.2.7 '
You can’t perform that action at this time.
0 commit comments