Skip to content

Commit 7f9a5e0

Browse files
author
Rena kim
authored
Issue#21 (#22)
* #21 Modify split function * Update version
1 parent 2420633 commit 7f9a5e0

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

WIZMSGHandler.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def run(self):
173173
if sock == self.sock.sock:
174174
data = self.sock.recvfrom()
175175
self.searched_data.emit(data)
176-
replylists = data.splitlines()
176+
# replylists = data.splitlines()
177+
replylists = data.split(b"\r\n")
177178
# print('replylists', replylists)
178179
self.getreply = replylists
179180
else:
@@ -190,8 +191,10 @@ def run(self):
190191
replylists = []
191192
else:
192193
self.rcv_list.append(data) # received data backup
193-
replylists = data.splitlines()
194-
# print('replylists', replylists)
194+
# replylists = data.splitlines()
195+
replylists = data.split(b"\r\n")
196+
197+
print('replylists', replylists)
195198
self.getreply = replylists
196199

197200
if self.opcode is OP_SEARCHALL:
@@ -213,8 +216,7 @@ def run(self):
213216
if self.check_parameter(replylists[i]):
214217
self.st_list.append(replylists[i][2:])
215218
except Exception as e:
216-
print(
217-
'[ERROR] WIZMSGHandler makecommands(): %r' % e)
219+
print('[ERROR] WIZMSGHandler makecommands(): %r' % e)
218220
elif self.opcode is OP_FWUP:
219221
for i in range(0, len(replylists)):
220222
if b'MA' in replylists[i][:2]:
@@ -341,7 +343,8 @@ def run(self):
341343
if sock == self.sock.sock:
342344
data = self.sock.recvfrom()
343345
self.rcv_list.append(data) # 수신 데이터 저장
344-
replylists = data.splitlines()
346+
# replylists = data.splitlines()
347+
replylists = data.split(b"\r\n")
345348
# print('replylists', replylists)
346349

347350
checknum += 1

main_gui.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
SOCK_CONNECTTRY_STATE = 4
5454
SOCK_CONNECT_STATE = 5
5555

56-
VERSION = 'V1.2.0'
56+
VERSION = 'V1.3.0'
5757

5858

5959
def resource_path(relative_path):
@@ -790,7 +790,8 @@ def gpio_update(self, num):
790790
pass
791791
else:
792792
resp = self.datarefresh.rcv_list[0]
793-
cmdset_list = resp.splitlines()
793+
# cmdset_list = resp.splitlines()
794+
cmdset_list = resp.split(b"\r\n")
794795

795796
try:
796797
# Expansion GPIO
@@ -942,7 +943,9 @@ def getsearch_each_dev(self, dev_data):
942943
self.eachdev_info.append(dev_data)
943944
# print('eachdev_info', len(self.eachdev_info), self.eachdev_info)
944945
for i in range(len(self.eachdev_info)):
945-
cmdsets = self.eachdev_info[i].splitlines()
946+
# cmdsets = self.eachdev_info[i].splitlines()
947+
cmdsets = self.eachdev_info[i].split(b"\r\n")
948+
946949
for i in range(len(cmdsets)):
947950
# print('cmdsets', i, cmdsets[i], cmdsets[i][:2], cmdsets[i][2:])
948951
if cmdsets[i][:2] == b'MA':
@@ -1946,7 +1949,9 @@ def get_setting_result(self, resp_len):
19461949
# get setting result
19471950
self.set_reponse = self.wizmsghandler.rcv_list[0]
19481951

1949-
cmdsets = self.set_reponse.splitlines()
1952+
# cmdsets = self.set_reponse.splitlines()
1953+
cmdsets = self.set_reponse.split(b"\r\n")
1954+
19501955
for i in range(len(cmdsets)):
19511956
if cmdsets[i][:2] == b'MA':
19521957
pass

0 commit comments

Comments
 (0)