Aggiornamneto del main (non del tutto funzionante)
parent
7045dee32e
commit
82d18aee26
564231
MkpWIFI/log/dimelog.log
564231
MkpWIFI/log/dimelog.log
File diff suppressed because it is too large
Load Diff
182
MkpWIFI/main.py
182
MkpWIFI/main.py
|
|
@ -1,91 +1,91 @@
|
|||
'''
|
||||
Created on 8 apr 2019
|
||||
|
||||
@author: Emanuele Trabattoni
|
||||
'''
|
||||
|
||||
import sys
|
||||
import datetime
|
||||
import PyQt5.QtWidgets
|
||||
from MKPrint_GUI import Ui_MainWindow
|
||||
from printer import MarkoPrinter
|
||||
|
||||
|
||||
class MainWindow(PyQt5.QtWidgets.QMainWindow):
|
||||
def __init__(self, configFilePath):
|
||||
try:
|
||||
self.printer = MarkoPrinter(configFilePath)
|
||||
except FileNotFoundError as e:
|
||||
print("Configuration file error: {}".format(e))
|
||||
sys.exit(1)
|
||||
|
||||
PyQt5.QtWidgets.QMainWindow.__init__(self)
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.setFixedSize(self.maximumSize())
|
||||
self.setWindowTitle("Manda Etichette a Marcatrice")
|
||||
self.timer = PyQt5.QtCore.QTimer()
|
||||
self.ui.btn_connect.clicked.connect(self.toggla_connessione)
|
||||
self.ui.btn_upload.clicked.connect(self.upload)
|
||||
self.ui.btn_upload.setEnabled(False)
|
||||
self.ui.rad_dataOn.setChecked(True)
|
||||
self.ui.prg_inkLevel.setTextVisible(True)
|
||||
|
||||
def updateStatusView(self):
|
||||
connessa = self.printer.connected
|
||||
self.ui.btn_upload.setEnabled(connessa)
|
||||
if connessa:
|
||||
self.ui.prg_inkLevel.setValue(self.printer.headStatus["iuse"])
|
||||
self.ui.lcd_printCount.display(
|
||||
str(self.printer.headStatus["labelCnt"]))
|
||||
else:
|
||||
self.ui.prg_inkLevel.setValue(0)
|
||||
self.ui.lcd_printCount.display('0')
|
||||
|
||||
def toggla_connessione(self):
|
||||
connessa = self.printer.connected
|
||||
if connessa:
|
||||
connessa = self.printer.disconnetti()
|
||||
else:
|
||||
connessa = self.printer.connetti()
|
||||
if connessa:
|
||||
self.ui.btn_connect.setText("DISCONNETTI")
|
||||
self.ui.lbl_stat.setText("Connesso")
|
||||
self.timer.start(self.printer.settings["keepalive"])
|
||||
self.timer.timeout.connect(self.keepalive)
|
||||
else:
|
||||
self.timer.stop()
|
||||
self.ui.lbl_stat.setText("Disconnesso")
|
||||
self.ui.btn_connect.setText("CONNETTI")
|
||||
self.updateStatusView()
|
||||
|
||||
def keepalive(self):
|
||||
# TODO: usare il primo argomento di keepalive (stato connessione) per aggiornare la ui
|
||||
_, statusUpdated = self.printer.keepalive()
|
||||
if statusUpdated:
|
||||
self.updateStatusView()
|
||||
|
||||
def upload(self):
|
||||
if self.ui.rad_dataOn.isChecked():
|
||||
date = datetime.datetime.now()
|
||||
date = date.strftime(self.printer.data["dateformat"])
|
||||
else:
|
||||
date = ""
|
||||
descr = str(self.ui.txt_descr.toPlainText()).capitalize()
|
||||
datastr = str(self.ui.txt_model.text()).upper() + "\r" + \
|
||||
date + descr + "\r"
|
||||
response, statusUpdated = self.printer.upload(descr, datastr)
|
||||
if statusUpdated:
|
||||
self.updateStatusView()
|
||||
self.ui.lbl_stat.setText(response)
|
||||
|
||||
def quit(self):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = PyQt5.QtWidgets.QApplication(sys.argv)
|
||||
configFilePath = "MkpWIFI/conf.json"
|
||||
window = MainWindow(configFilePath)
|
||||
window.show()
|
||||
sys.exit(app.exec_())
|
||||
'''
|
||||
Created on 8 apr 2019
|
||||
|
||||
@author: Emanuele Trabattoni
|
||||
'''
|
||||
|
||||
import sys
|
||||
import datetime
|
||||
import PyQt5.QtWidgets
|
||||
from MKPrint_GUI import Ui_MainWindow
|
||||
from printer import MarkoPrinter
|
||||
|
||||
|
||||
class MainWindow(PyQt5.QtWidgets.QMainWindow):
|
||||
def __init__(self, configFilePath):
|
||||
try:
|
||||
self.printer = MarkoPrinter(configFilePath)
|
||||
except FileNotFoundError as e:
|
||||
print("Configuration file error: {}".format(e))
|
||||
sys.exit(1)
|
||||
|
||||
PyQt5.QtWidgets.QMainWindow.__init__(self)
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.setFixedSize(self.maximumSize())
|
||||
self.setWindowTitle("Manda Etichette a Marcatrice")
|
||||
self.timer = PyQt5.QtCore.QTimer()
|
||||
self.ui.btn_connect.clicked.connect(self.toggla_connessione)
|
||||
self.ui.btn_upload.clicked.connect(self.upload)
|
||||
self.ui.btn_upload.setEnabled(False)
|
||||
self.ui.rad_dataOn.setChecked(True)
|
||||
self.ui.prg_inkLevel.setTextVisible(True)
|
||||
|
||||
def updateStatusView(self):
|
||||
connessa = self.printer.connected
|
||||
self.ui.btn_upload.setEnabled(connessa)
|
||||
if connessa:
|
||||
self.ui.prg_inkLevel.setValue(self.printer.headStatus["iuse"])
|
||||
self.ui.lcd_printCount.display(
|
||||
str(self.printer.headStatus["labelCnt"]))
|
||||
else:
|
||||
self.ui.prg_inkLevel.setValue(0)
|
||||
self.ui.lcd_printCount.display('0')
|
||||
|
||||
def toggla_connessione(self):
|
||||
connessa = self.printer.connected
|
||||
if connessa:
|
||||
connessa = self.printer.disconnetti()
|
||||
else:
|
||||
connessa = self.printer.connetti()
|
||||
if connessa:
|
||||
self.ui.btn_connect.setText("DISCONNETTI")
|
||||
self.ui.lbl_stat.setText("Connesso")
|
||||
self.timer.start(self.printer.settings["keepalive"])
|
||||
self.timer.timeout.connect(self.keepalive)
|
||||
else:
|
||||
self.timer.stop()
|
||||
self.ui.lbl_stat.setText("Disconnesso")
|
||||
self.ui.btn_connect.setText("CONNETTI")
|
||||
self.updateStatusView()
|
||||
|
||||
def keepalive(self):
|
||||
# TODO: usare il primo argomento di keepalive (stato connessione) per aggiornare la ui
|
||||
_, statusUpdated = self.printer.keepalive()
|
||||
if statusUpdated:
|
||||
self.updateStatusView()
|
||||
|
||||
def upload(self):
|
||||
if self.ui.rad_dataOn.isChecked():
|
||||
date = datetime.datetime.now()
|
||||
date = date.strftime(self.printer.data["dateformat"])
|
||||
else:
|
||||
date = ""
|
||||
descr = str(self.ui.txt_descr.toPlainText()).capitalize()
|
||||
datastr = str(self.ui.txt_model.text()).upper() + "\r" + \
|
||||
date + descr + "\r"
|
||||
response, statusUpdated = self.printer.upload(descr, datastr)
|
||||
if statusUpdated:
|
||||
self.updateStatusView()
|
||||
self.ui.lbl_stat.setText(response)
|
||||
|
||||
def quit(self):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = PyQt5.QtWidgets.QApplication(sys.argv)
|
||||
configFilePath = "MkpWIFI/conf.json"
|
||||
window = MainWindow(configFilePath)
|
||||
window.show()
|
||||
sys.exit(app.exec_())
|
||||
|
|
|
|||
|
|
@ -6,48 +6,50 @@ Created on 27 set 2019
|
|||
import time
|
||||
import sys
|
||||
import printer as p
|
||||
import commands
|
||||
import logging
|
||||
import test
|
||||
import protocol
|
||||
|
||||
def main():
|
||||
isRunning = True
|
||||
while isRunning:
|
||||
connessa=True
|
||||
#printer = p.MarkoPrinter('./conf.json', LOGGER)
|
||||
#connessa = printer.connetti()
|
||||
while connessa:
|
||||
lastTimestamp = int(time.time()*100)
|
||||
commandString = test.cmdString('callPrintImage', {'imageName': 'TM2.00I',
|
||||
'printMode': '10',
|
||||
'fieldContent': '{0}\r{0}\r'.format(lastTimestamp)
|
||||
}
|
||||
)
|
||||
LOGGER.debug(commandString)
|
||||
#printer.sendCommand(commandString)
|
||||
pass
|
||||
pass
|
||||
pass
|
||||
isRunning = True
|
||||
while isRunning:
|
||||
printer = p.MarkoPrinter('./conf.json', LOGGER)
|
||||
connessa = printer.connetti()
|
||||
while connessa:
|
||||
lastTimestamp = int(time.time()*100)
|
||||
commandString = protocol.callPrintImage(imageName='TM2.00I',
|
||||
printMode='10',
|
||||
fieldContent='{0}\r{0}'.format(lastTimestamp))
|
||||
try:
|
||||
printer.sendCommand(commandString)
|
||||
LOGGER.debug('SENT: {}'.format(commandString))
|
||||
r=printer.readResponse('callPrintImage')
|
||||
LOGGER.debug('RECEIVED: {}'.format(r))
|
||||
protocol.checkResponse('callPrintImage',r)
|
||||
except Exception as e:
|
||||
LOGGER.error(str(e))
|
||||
pass
|
||||
pass
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Setup Logger
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
LOGGER.setLevel(logging.DEBUG)
|
||||
LOGGER.propagate = False
|
||||
FORMATTER = logging.Formatter(("%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s"),
|
||||
("%m-%d %H:%M:%S"))
|
||||
# File Logging
|
||||
fh = logging.FileHandler(("./log/dimelog.log"))
|
||||
fh.setLevel(logging.WARNING)
|
||||
fh.setFormatter(FORMATTER)
|
||||
LOGGER.addHandler(fh)
|
||||
# Console Logging
|
||||
cl= logging.StreamHandler(sys.stdout)
|
||||
cl.setLevel(logging.INFO)
|
||||
cl.setFormatter(FORMATTER)
|
||||
LOGGER.addHandler(cl)
|
||||
|
||||
LOGGER.warning("MarcaturaDime Started!")
|
||||
|
||||
sys.exit(main())
|
||||
pass
|
||||
# Setup Logger
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
LOGGER.setLevel(logging.DEBUG)
|
||||
LOGGER.propagate = False
|
||||
FORMATTER = logging.Formatter(("%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s"),
|
||||
("%m-%d %H:%M:%S"))
|
||||
# File Logging
|
||||
fh = logging.FileHandler(("./log/dimelog.log"))
|
||||
fh.setLevel(logging.DEBUG)
|
||||
fh.setFormatter(FORMATTER)
|
||||
LOGGER.addHandler(fh)
|
||||
# Console Logging
|
||||
cl= logging.StreamHandler(sys.stdout)
|
||||
cl.setLevel(logging.DEBUG)
|
||||
cl.setFormatter(FORMATTER)
|
||||
LOGGER.addHandler(cl)
|
||||
|
||||
LOGGER.warning("MarcaturaDime Started!")
|
||||
|
||||
sys.exit(main())
|
||||
pass
|
||||
|
|
@ -1,147 +1,172 @@
|
|||
import socket
|
||||
import json
|
||||
import time
|
||||
import test
|
||||
import protocol
|
||||
import commands as cmd
|
||||
|
||||
class MarkoPrinter:
|
||||
def __init__(self, configFilePath, LOGGER):
|
||||
self.LOGGER = LOGGER
|
||||
self.inkStatCounter = 0
|
||||
self.printSock = None
|
||||
self.headStatus = dict()
|
||||
self.connected = False
|
||||
self.sending = False
|
||||
with open(configFilePath, "r") as setFile:
|
||||
self.settings = json.load(setFile)
|
||||
self.data = self.settings["printcmd"]
|
||||
self.debug = True
|
||||
def __init__(self, configFilePath, LOGGER):
|
||||
self.LOGGER = LOGGER
|
||||
self.inkStatCounter = 0
|
||||
self.printSock = None
|
||||
self.headStatus = dict()
|
||||
self.connected = False
|
||||
self.sending = False
|
||||
self.reading = False
|
||||
with open(configFilePath, "r") as setFile:
|
||||
self.settings = json.load(setFile)
|
||||
self.data = self.settings["printcmd"]
|
||||
self.debug = True
|
||||
|
||||
def log(self, *logtxt):
|
||||
if self.debug:
|
||||
print(*logtxt)
|
||||
def log(self, *logtxt):
|
||||
if self.debug:
|
||||
print(*logtxt)
|
||||
|
||||
def connetti(self):
|
||||
if not self.connected:
|
||||
if self.printSock is None:
|
||||
try:
|
||||
self.printSock = socket.socket(
|
||||
socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.printSock.connect(
|
||||
(self.settings["ip"], self.settings["port"]))
|
||||
self.connected = True
|
||||
self.printSock.settimeout(0.5)
|
||||
self.checkStatus()
|
||||
except socket.error as e:
|
||||
self.printSock = None
|
||||
self.connected = False
|
||||
self.log("Connessione Fallita: {}".format(e))
|
||||
else:
|
||||
self.printSock.close()
|
||||
self.printSock = None
|
||||
self.connetti()
|
||||
return self.connected
|
||||
def connetti(self):
|
||||
if not self.connected:
|
||||
if self.printSock is None:
|
||||
try:
|
||||
self.printSock = socket.socket(
|
||||
socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.printSock.connect(
|
||||
(self.settings["ip"], self.settings["port"]))
|
||||
self.connected = True
|
||||
self.printSock.settimeout(0.5)
|
||||
self.checkStatus()
|
||||
except socket.error as e:
|
||||
self.printSock = None
|
||||
self.connected = False
|
||||
self.log("Connessione Fallita: {}".format(e))
|
||||
else:
|
||||
self.printSock.close()
|
||||
self.printSock = None
|
||||
self.connetti()
|
||||
return self.connected
|
||||
|
||||
def disconnetti(self):
|
||||
if self.connected:
|
||||
self.printSock.close()
|
||||
self.printSock = None
|
||||
self.connected = False
|
||||
return self.connected
|
||||
def disconnetti(self):
|
||||
if self.connected:
|
||||
self.printSock.close()
|
||||
self.printSock = None
|
||||
self.connected = False
|
||||
return self.connected
|
||||
|
||||
def checkStatus(self):
|
||||
statusUpdated = False
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.send(b"\x1BS1\r")
|
||||
time.sleep(1)
|
||||
c = self.printSock.recv(1)
|
||||
inData = b""
|
||||
while c != b"\r":
|
||||
inData += c
|
||||
if len(inData) > 200:
|
||||
self.log("Status Message Length Error")
|
||||
raise IOError
|
||||
c = self.printSock.recv(1)
|
||||
inData = str(inData, "ascii")
|
||||
inData = inData.split(":")
|
||||
for index, key in enumerate(self.data["headstatus"]):
|
||||
if key != "txt":
|
||||
self.headStatus[key] = int(inData[index])
|
||||
else:
|
||||
self.headStatus[key] = str(inData[index])
|
||||
self.log("Status: {}".format(self.headStatus))
|
||||
statusUpdated = True
|
||||
except:
|
||||
self.log("Status retreive error!")
|
||||
return statusUpdated
|
||||
def checkStatus(self):
|
||||
statusUpdated = False
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.send(b"\x1BS1\r")
|
||||
time.sleep(1)
|
||||
c = self.printSock.recv(1)
|
||||
inData = b""
|
||||
while c != b"\r":
|
||||
inData += c
|
||||
if len(inData) > 200:
|
||||
self.log("Status Message Length Error")
|
||||
raise IOError
|
||||
c = self.printSock.recv(1)
|
||||
inData = str(inData, "ascii")
|
||||
inData = inData.split(":")
|
||||
for index, key in enumerate(self.data["headstatus"]):
|
||||
if key != "txt":
|
||||
self.headStatus[key] = int(inData[index])
|
||||
else:
|
||||
self.headStatus[key] = str(inData[index])
|
||||
self.log("Status: {}".format(self.headStatus))
|
||||
statusUpdated = True
|
||||
except:
|
||||
self.log("Status retreive error!")
|
||||
return statusUpdated
|
||||
|
||||
def upload(self, descr, datastr):
|
||||
self.sending = True
|
||||
response = ""
|
||||
if self.connected:
|
||||
cmdstr = "\x02TZ" + self.data["filename"] + \
|
||||
";" + self.data["printmode"] + "\r"
|
||||
self.log(bytearray(descr, "ascii"))
|
||||
descr = descr.replace("\n", "\t")
|
||||
outstr = cmdstr + datastr + "\03\r"
|
||||
self.printSock.settimeout(1.0)
|
||||
try:
|
||||
self.printSock.send(bytearray(outstr, "ascii"))
|
||||
retval = self.printSock.recv(1)
|
||||
self.log("ACK: ", retval)
|
||||
if retval == b'\x06':
|
||||
retval = self.printSock.recv(6)
|
||||
if retval == b'\x021OK\x03':
|
||||
self.log("RESP: ", retval)
|
||||
response = "Invio Riuscito!"
|
||||
self.log("Printer OK")
|
||||
else:
|
||||
response = "Invio Fallito!"
|
||||
self.log("Printer Error")
|
||||
else:
|
||||
self.log("Send Error")
|
||||
self.printSock.settimeout(0.5)
|
||||
statusUpdated = self.checkStatus()
|
||||
if self.headStatus["ink"] == 2:
|
||||
response = "CARTUCCIA ESAURITA\nSostituire!"
|
||||
elif self.headStatus["ink"] == 1:
|
||||
response = "Cartuccia in Esaurimento"
|
||||
except socket.error as e:
|
||||
self.log("Socket error: ", e)
|
||||
self.printSock.settimeout(0.5)
|
||||
response = "Invio Fallito!"
|
||||
self.printSock.sendall(b"\r"*5)
|
||||
self.printSock.recv(5)
|
||||
self.sending = False
|
||||
return response, statusUpdated
|
||||
|
||||
def sendCommand(self, c):
|
||||
self.sending = True
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.settimeout(1.0)
|
||||
self.printSock.send(bytearray(test.cmdString(c, "ascii")))
|
||||
self.printSock.settimeout(0.5)
|
||||
return True
|
||||
except socket.error as e:
|
||||
self.LOGGER.error('Socket Error: {}'.format(e))
|
||||
return False
|
||||
self.sending = False
|
||||
pass
|
||||
def upload(self, descr, datastr):
|
||||
self.sending = True
|
||||
response = ""
|
||||
if self.connected:
|
||||
cmdstr = "\x02TZ" + self.data["filename"] + \
|
||||
";" + self.data["printmode"] + "\r"
|
||||
self.log(bytearray(descr, "ascii"))
|
||||
descr = descr.replace("\n", "\t")
|
||||
outstr = cmdstr + datastr + "\03\r"
|
||||
self.printSock.settimeout(1.0)
|
||||
try:
|
||||
self.printSock.send(bytearray(outstr, "ascii"))
|
||||
retval = self.printSock.recv(1)
|
||||
self.log("ACK: ", retval)
|
||||
if retval == b'\x06':
|
||||
retval = self.printSock.recv(6)
|
||||
if retval == b'\x021OK\x03':
|
||||
self.log("RESP: ", retval)
|
||||
response = "Invio Riuscito!"
|
||||
self.log("Printer OK")
|
||||
else:
|
||||
response = "Invio Fallito!"
|
||||
self.log("Printer Error")
|
||||
else:
|
||||
self.log("Send Error")
|
||||
self.printSock.settimeout(0.5)
|
||||
statusUpdated = self.checkStatus()
|
||||
if self.headStatus["ink"] == 2:
|
||||
response = "CARTUCCIA ESAURITA\nSostituire!"
|
||||
elif self.headStatus["ink"] == 1:
|
||||
response = "Cartuccia in Esaurimento"
|
||||
except socket.error as e:
|
||||
self.log("Socket error: ", e)
|
||||
self.printSock.settimeout(0.5)
|
||||
response = "Invio Fallito!"
|
||||
self.printSock.sendall(b"\r"*5)
|
||||
self.printSock.recv(5)
|
||||
self.sending = False
|
||||
return response, statusUpdated
|
||||
|
||||
def sendCommand(self, c):
|
||||
self.sending = True
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.settimeout(1.0)
|
||||
self.printSock.send(bytearray(c,'ascii'))
|
||||
self.printSock.settimeout(0.5)
|
||||
return True
|
||||
except socket.error as e:
|
||||
self.LOGGER.error('Socket Error: {}'.format(e))
|
||||
return False
|
||||
self.sending = False
|
||||
pass
|
||||
|
||||
def keepalive(self):
|
||||
statusUpdated = False
|
||||
if not self.sending:
|
||||
self.log("Keepalive")
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.send(b"\x1B*\r")
|
||||
self.log(str(self.printSock.recv(5)))
|
||||
if self.inkStatCounter <= self.settings["inkstat"]:
|
||||
self.inkStatCounter += 1
|
||||
else:
|
||||
statusUpdated = self.checkStatus()
|
||||
self.inkStatCounter = 0
|
||||
except:
|
||||
self.disconnetti()
|
||||
return self.connected, statusUpdated
|
||||
def readResponse(self, c):
|
||||
self.reading = True
|
||||
buf = bytearray()
|
||||
respTerm = cmd.DEFprefix['end'] if cmd.MKPcommands[c]['defPrefix'] else cmd.MKPcommands[c]['end']
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.settimeout(1.0)
|
||||
self.printSock.setblocking(True)
|
||||
c = self.printSock.recv(1)
|
||||
while c != respTerm:
|
||||
buf += c
|
||||
if str(c, 'ascii') == respTerm:
|
||||
break
|
||||
c = self.printSock.recv(1)
|
||||
self.printSock.settimeout(0.5)
|
||||
self.printSock.setblocking(False)
|
||||
return str(buf, 'ascii')
|
||||
except socket.error as e:
|
||||
self.LOGGER.error('Socket Error: {}'.format(e))
|
||||
return False
|
||||
self.reading = False
|
||||
pass
|
||||
|
||||
def keepalive(self):
|
||||
statusUpdated = False
|
||||
if not self.sending:
|
||||
self.log("Keepalive")
|
||||
if self.connected:
|
||||
try:
|
||||
self.printSock.send(b"\x1B*\r")
|
||||
self.log(str(self.printSock.recv(5)))
|
||||
if self.inkStatCounter <= self.settings["inkstat"]:
|
||||
self.inkStatCounter += 1
|
||||
else:
|
||||
statusUpdated = self.checkStatus()
|
||||
self.inkStatCounter = 0
|
||||
except:
|
||||
self.disconnetti()
|
||||
return self.connected, statusUpdated
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ def _checkError(cmdName, response):
|
|||
return error_codes.groups()
|
||||
return None
|
||||
|
||||
def _checkResponse(cmdName, response):
|
||||
def checkResponse(cmdName, response):
|
||||
sucKey = 'success'
|
||||
cmdDict = cmd.MKPcommands[cmdName]
|
||||
if sucKey in cmdDict and cmdDict[sucKey] is not None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue