:pedobear a des bonbons
This commit is contained in:
parent
5719da74fd
commit
28a4442f00
239
client/start.py
239
client/start.py
@ -11,13 +11,13 @@ import configparser
|
||||
|
||||
class MySignal(QObject):
|
||||
sig = Signal(str)
|
||||
|
||||
|
||||
class MyLongThread(QThread):
|
||||
def __init__(self, parent = None):
|
||||
QThread.__init__(self, parent)
|
||||
self.exiting = False
|
||||
self.signal = MySignal()
|
||||
|
||||
|
||||
def run(self):
|
||||
end = time.time()+10
|
||||
while self.exiting==False:
|
||||
@ -28,26 +28,26 @@ class MyLongThread(QThread):
|
||||
if now>=end:
|
||||
self.exiting=True
|
||||
self.signal.sig.emit('OK')
|
||||
|
||||
|
||||
class MyThread(QThread):
|
||||
def __init__(self, parent = None):
|
||||
QThread.__init__(self, parent)
|
||||
|
||||
|
||||
self.exiting = False
|
||||
|
||||
|
||||
def run(self):
|
||||
self.s.settimeout(None)
|
||||
data = self.s.recv(4096)
|
||||
messgServeur = (data.decode())
|
||||
self.gui.setNewMsg(messgServeur)
|
||||
|
||||
|
||||
def setConfig(self,s,gui):
|
||||
self.s = s
|
||||
self.gui = gui
|
||||
|
||||
|
||||
class privateMessage () :
|
||||
def __init__(self,main,s, pmPerson, pmPerso):
|
||||
|
||||
|
||||
self.main = main
|
||||
self.s = s
|
||||
self.pmPerso = pmPerso
|
||||
@ -61,7 +61,7 @@ class privateMessage () :
|
||||
|
||||
self.g.setWindowState(self.g.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
|
||||
self.g.activateWindow()
|
||||
|
||||
|
||||
Qt.WindowStaysOnTopHint
|
||||
|
||||
self.queueMsg2= []
|
||||
@ -70,7 +70,7 @@ class privateMessage () :
|
||||
|
||||
self.ui.pushButton.clicked.connect(self.send)
|
||||
self.ui.lineEdit.returnPressed.connect(self.send)
|
||||
|
||||
|
||||
self.ui.pushButton_4.clicked.connect(self.reject)
|
||||
self.ui.pushButton_3.clicked.connect(self.accept)
|
||||
self.ui.pushButton_2.clicked.connect(self.selectFile)
|
||||
@ -86,7 +86,7 @@ class privateMessage () :
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
def accept(self):
|
||||
self.cmAcc = "/acceptpm "+self.pmPerson
|
||||
try:
|
||||
@ -98,7 +98,7 @@ class privateMessage () :
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
def selectFile(self):
|
||||
self.ui.lineEdit.setText('/pmfile '+self.pmPerson+ ' '.join(QFileDialog.getOpenFileName()))
|
||||
|
||||
@ -140,7 +140,7 @@ class privateMessage () :
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
def UpdateChatP(self) :
|
||||
if self.queueMsg2 :
|
||||
m = self.queueMsg2.pop(0)
|
||||
@ -157,14 +157,14 @@ class privateMessage () :
|
||||
def ShowMessageAsTextPm(self, txt) :
|
||||
|
||||
self.message_buffer2 += '<br><span style="color : grey">'+txt+'</span>'
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REFUSED":
|
||||
self.g.close()
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REJECTED":
|
||||
self.g.close()
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PM_SENDED":
|
||||
self.message_buffer2 += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+self.pmPerso +' > </span> ' + self.htmlToText(self.cmdP) + ''
|
||||
|
||||
@ -174,7 +174,7 @@ class privateMessage () :
|
||||
self.ui.pushButton_4.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_OK":
|
||||
self.message_buffer2 += '<br> <span style="color : green"> Private discussion with '+txt.split(" ")[1]+' accepted ! </span>'
|
||||
self.ui.pushButton_4.setDisabled(True)
|
||||
@ -195,16 +195,16 @@ class start(QtGui.QMainWindow):
|
||||
self.queueMsg= []
|
||||
self.thread = MyThread()
|
||||
self.thread.finished.connect(self.UpdateChat)
|
||||
|
||||
|
||||
|
||||
|
||||
self.createWidgets()
|
||||
|
||||
|
||||
def setNewMsg (self,msg) :
|
||||
self.queueMsg.append(msg)
|
||||
|
||||
|
||||
def getTimeStamp(self):
|
||||
return ('[%s] ' % str(datetime.datetime.fromtimestamp(int(time.time())).strftime('%H:%M')))
|
||||
|
||||
|
||||
def htmlToText( self, html ):
|
||||
|
||||
html = html.replace('<', '<')
|
||||
@ -221,44 +221,44 @@ class start(QtGui.QMainWindow):
|
||||
html = html.replace('3:)', '<img src="img/hell.png" alt="hell face">')
|
||||
html = html.replace(':pedobear', '<img src="img/pedo.gif" alt="hell face">')
|
||||
html = html.replace(':homer', '<img src="img/homer.gif" alt="homer face">')
|
||||
|
||||
|
||||
|
||||
return html
|
||||
|
||||
def ShowMessageErreur(self, txt):
|
||||
self.message_buffer += '<br> <span style="color : red; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
|
||||
def ShowMessageOK(self, txt):
|
||||
self.message_buffer += '<br> <span style="color : green; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
def ShowMessageInfo (self, txt) :
|
||||
|
||||
def ShowMessageInfo (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
|
||||
|
||||
def ShowMessageAsText(self, txt):
|
||||
|
||||
|
||||
if re.match("^ERR_", txt):
|
||||
self.ShowMessageErreur("Erreur ! : " + txt)
|
||||
|
||||
|
||||
self.message_buffer += '<br> <span style="color : #E6E6E6"> '+ txt +' </span>'
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "IS_NOW_DISABLE":
|
||||
self.ShowMessageInfo(txt.split(" ")[1]+" is Away From Keyboard")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "IS_NOW_ENABLE":
|
||||
self.ShowMessageInfo(txt.split(" ")[1]+" is Back !!")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_ACCEPTED":
|
||||
self.message_buffer += '<br> <span style="color : green"> PRIVATE DISCUSSION ? challenge accepted ! '
|
||||
self.private2.ShowMessageAsTextPm("SUCC_PRIVATE_DISCUSSION_ACCEPTED")
|
||||
@ -269,11 +269,11 @@ class start(QtGui.QMainWindow):
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_INVITED" :
|
||||
if txt.split(" ")[0] == "SUCC_INVITED" :
|
||||
self.ShowMessageOK("invitation requested")
|
||||
self.private2 = privateMessage(self,self.s,self.demande,self.pseudo)
|
||||
|
||||
if txt.split(" ")[0] == "ASKING_FOR_PM" :
|
||||
|
||||
if txt.split(" ")[0] == "ASKING_FOR_PM" :
|
||||
self.ShowMessageOK("private discution from "+ txt.split(" ")[1] )
|
||||
self.private2 = privateMessage(self,self.s,txt.split(" ")[1],self.pseudo)
|
||||
|
||||
@ -282,102 +282,102 @@ class start(QtGui.QMainWindow):
|
||||
if txt.split(" ")[0] == "SUCC_PM_SENDED" :
|
||||
self.private2.ShowMessageAsTextPm(txt.split(" ")[0])
|
||||
|
||||
if txt.split(" ")[0] == "NEW_PM" :
|
||||
if txt.split(" ")[0] == "NEW_PM" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REFUSED" :
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REFUSED" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
self.ShowMessageOK("Private discussion refused !!")
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REJECTED" :
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REJECTED" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
self.ShowMessageOK(txt.split(" ")[1]+" Rejected your Private discussion !!")
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" :
|
||||
|
||||
if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" :
|
||||
self.ShowMessageOK("You have logged out of the DNC !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_DISABLED" :
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_DISABLED" :
|
||||
self.ShowMessageOK("You are AFK !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_ENABLED" :
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_ENABLED" :
|
||||
self.ShowMessageOK("You are back !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_VALID_NICKNAME" :
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_VALID_NICKNAME" :
|
||||
self.ShowMessageOK("Sucessful nickname change !")
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "ERR_INVALID_NICKNAME" :
|
||||
self.pseudo = "INVALID_NICKNAME"
|
||||
|
||||
#HAS_LEFT anonymous52
|
||||
if txt.split(" ")[0] == "NAME_CHANGED" :
|
||||
if txt.split(" ")[0] == "NAME_CHANGED" :
|
||||
self.ShowMessageNameChange(txt.split(" ")[1], txt.split(" ")[2])
|
||||
self.ui.listNames.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
|
||||
if txt.split(" ")[0] == "HAS_JOIN" :
|
||||
|
||||
if txt.split(" ")[0] == "HAS_JOIN" :
|
||||
self.ShowMessageHasJoin(txt.split(" ")[1])
|
||||
self.ui.listNames.addItem(txt.split(" ")[1])
|
||||
|
||||
if txt.split(" ")[0] == "HAS_LEFT" :
|
||||
|
||||
if txt.split(" ")[0] == "HAS_LEFT" :
|
||||
self.ShowMessageHasLeft(txt.split(" ")[1])
|
||||
self.ui.listNames.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_CHANNEL_JOINED" or txt.split(" ")[0] == "SUCC_CHANNEL_JOINEDUSERLIST" :
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_CHANNEL_JOINED" or txt.split(" ")[0] == "SUCC_CHANNEL_JOINEDUSERLIST" :
|
||||
self.ShowMessageHasJoin(self.pseudo)
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
#self.s.send("/userlist".encode())
|
||||
#self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "ERR_NICKNAME_ALREADY_USED" :
|
||||
|
||||
if txt.split(" ")[0] == "ERR_NICKNAME_ALREADY_USED" :
|
||||
self.deco()
|
||||
|
||||
|
||||
if re.compile('USERLIST').search(txt.split(" ")[0] ) :
|
||||
|
||||
|
||||
if re.compile('USERLIST').search(txt.split(" ")[0] ) :
|
||||
n = len(txt.split(" ")[1:]) +1
|
||||
for i in range(1,n) :
|
||||
self.ui.listNames.addItem(str(txt.split(" ")[i]).replace("USERAWAY",""))
|
||||
print(str(txt.split(" ")[1:]))
|
||||
|
||||
if re.compile('USERAWAY').search(txt.split(" ")[0] ) :
|
||||
if re.compile('USERAWAY').search(txt.split(" ")[0] ) :
|
||||
n = len(txt.split(" ")[1:]) +1
|
||||
for i in range(1,n) :
|
||||
self.ui.listNames_2.addItem(str(txt.split(" ")[i]))
|
||||
print(str(txt.split(" ")[1:]))
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "NEW_MSG" :
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "NEW_MSG" :
|
||||
self.message_buffer += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+txt.split(" ")[1] +' > </span> <span style="color : black">' + self.htmlToText(' '.join(txt.split(" ")[2:])) + '</span>'
|
||||
|
||||
if txt == "SUCC_MESSAGE_SENDED" :
|
||||
if txt == "SUCC_MESSAGE_SENDED" :
|
||||
self.message_buffer += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+ self.pseudo +' > </span><span style="color : black"> ' + self.htmlToText(self.cmd) + '</span>'
|
||||
|
||||
|
||||
def ShowMessageHasJoin (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has joined DNC </span>'
|
||||
|
||||
def ShowMessageHasLeft (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has left DNC </span>'
|
||||
|
||||
def ShowMessageNameChange (self, txt, txt2) :
|
||||
|
||||
def ShowMessageHasJoin (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has joined DNC </span>'
|
||||
|
||||
def ShowMessageHasLeft (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has left DNC </span>'
|
||||
|
||||
def ShowMessageNameChange (self, txt, txt2) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' is now : '+self.htmlToText(txt2)+' </span>'
|
||||
|
||||
def UpdateChat(self) :
|
||||
@ -389,7 +389,7 @@ class start(QtGui.QMainWindow):
|
||||
self.ui.txtOutput.setText(self.message_buffer)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
|
||||
|
||||
def connectActions(self):
|
||||
@ -398,14 +398,36 @@ class start(QtGui.QMainWindow):
|
||||
self.ui.pushButton.clicked.connect(self.client)
|
||||
self.ui.pushButton_6.clicked.connect(self.changeN)
|
||||
self.ui.pushButton_5.clicked.connect(self.away)
|
||||
|
||||
|
||||
self.ui.lineEdit.returnPressed.connect(self.client)
|
||||
|
||||
#self.connect(self.ui.listNames,
|
||||
# QtCore.SIGNAL("itemDoubleClicked(QListWidgetItem *)"),
|
||||
# self.someMethod)
|
||||
self.ui.listNames.itemActivated.connect(self.someMethod)
|
||||
|
||||
|
||||
|
||||
#self.ui.listNames.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
|
||||
|
||||
self.ui.listNames.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
self.ui.listNames.customContextMenuRequested.connect(self.buttonAMenu)
|
||||
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def on_buttonA_released(self):
|
||||
print ('Doing Stuff when clicking on Button A')
|
||||
|
||||
def buttonAMenu(self, pos):
|
||||
menu = QtGui.QMenu()
|
||||
menu.addAction('Private discussion', lambda:self.SecondActionButtonA(self.ui.listNames.itemActivated))
|
||||
menu.addAction('Send file', lambda:self.FirstActionButtonA("au revoir"))
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
|
||||
def FirstActionButtonA(self, txt):
|
||||
print(txt)
|
||||
|
||||
def SecondActionButtonA(self, txt):
|
||||
txt = self.ui.listNames.itemActivated.emit(self.ui.listNames.currentItem())
|
||||
#print(txt)
|
||||
|
||||
|
||||
def someMethod(self,item):
|
||||
nom = item.text().replace("SUCC_INVITED","")
|
||||
cmdPM = "/askpm "+nom
|
||||
@ -422,7 +444,7 @@ class start(QtGui.QMainWindow):
|
||||
|
||||
def away(self):
|
||||
|
||||
if self.bouton == "disable" :
|
||||
if self.bouton == "disable" :
|
||||
cmdAway = "/disable "
|
||||
try:
|
||||
self.s.send(cmdAway.encode())
|
||||
@ -434,7 +456,7 @@ class start(QtGui.QMainWindow):
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
self.bouton = "enable"
|
||||
|
||||
|
||||
elif self.bouton == "enable" :
|
||||
self.bouton = "disable"
|
||||
cmdAway = "/enable "
|
||||
@ -448,7 +470,7 @@ class start(QtGui.QMainWindow):
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
|
||||
def changeN(self):
|
||||
changePseudo = self.ui.lineEdit_2.text()
|
||||
cmdChange = "/name "+changePseudo
|
||||
@ -465,17 +487,14 @@ class start(QtGui.QMainWindow):
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def connecter(self):
|
||||
|
||||
ip= self.ui.lineEdit_4.text()
|
||||
port = int(self.ui.lineEdit_3.text())
|
||||
if ip is None or port is None :
|
||||
Addr = (Host, Port)
|
||||
else :
|
||||
Addr = (ip,port)
|
||||
|
||||
Addr = (ip,port)
|
||||
|
||||
|
||||
self.s = socket(AF_INET, SOCK_STREAM)
|
||||
self.s.connect(Addr)
|
||||
@ -487,7 +506,7 @@ class start(QtGui.QMainWindow):
|
||||
self.ui.lineEdit_4.setDisabled(True)
|
||||
self.ui.lineEdit_3.setDisabled(True)
|
||||
self.thread.start()
|
||||
|
||||
|
||||
|
||||
cmd2 = self.ui.lineEdit_2.text()
|
||||
if cmd2 != "":
|
||||
@ -497,7 +516,7 @@ class start(QtGui.QMainWindow):
|
||||
self.s.send(cmdPseudo.encode())
|
||||
self.pseudo = cmd2
|
||||
self.ui.pushButton_6.setDisabled(False)
|
||||
|
||||
|
||||
|
||||
except timeout:
|
||||
self.ShowMessageErreur("Erreur : Timeout. Le serveur ne repond pas")
|
||||
@ -505,7 +524,7 @@ class start(QtGui.QMainWindow):
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
|
||||
def deco(self):
|
||||
quitter = "/quit"
|
||||
self.s.send(quitter.encode())
|
||||
@ -515,31 +534,31 @@ class start(QtGui.QMainWindow):
|
||||
self.ui.pushButton_2.setDisabled(False)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
self.ui.pushButton_6.setDisabled(True)
|
||||
|
||||
|
||||
self.ui.lineEdit_4.setDisabled(False)
|
||||
self.ui.lineEdit_3.setDisabled(False)
|
||||
|
||||
|
||||
def ecoute(self):
|
||||
while 1 :
|
||||
data = self.s.recv(4096)
|
||||
if not data :
|
||||
break
|
||||
messgServeur = (data.decode())
|
||||
|
||||
|
||||
|
||||
|
||||
if messgServeur == "ERR_INVALID_NICKNAME" :
|
||||
self.pseudo = "INVALID_NICKNAME"
|
||||
|
||||
|
||||
|
||||
|
||||
self.UpdateChat(messgServeur)
|
||||
|
||||
|
||||
def createWidgets(self):
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
|
||||
ano = "anonymous" + ''.join(str(random.randint(1,9)) for _ in range(2))
|
||||
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
config.read("dncClient.conf")
|
||||
@ -556,13 +575,13 @@ class start(QtGui.QMainWindow):
|
||||
if ip is not None :
|
||||
self.ui.lineEdit_4.setText(ip)
|
||||
|
||||
|
||||
|
||||
if port is not None :
|
||||
self.ui.lineEdit_3.setText(port)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
self.ui.lineEdit.setDisabled(True)
|
||||
self.ui.pushButton.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
@ -582,13 +601,13 @@ class start(QtGui.QMainWindow):
|
||||
self.s.settimeout(5.0)
|
||||
try:
|
||||
self.s.send(self.cmd.encode())
|
||||
|
||||
|
||||
if self.cmd.split(" ")[0] == "/newname":
|
||||
self.pseudo = self.cmd.split(" ")[1]
|
||||
|
||||
|
||||
if self.cmd.split(" ")[0] == "/name":
|
||||
self.pseudo = self.cmd.split(" ")[1]
|
||||
|
||||
|
||||
if self.cmd.split(" ")[0]=="/askpm":
|
||||
self.demande = self.cmd.split(" ")[1]
|
||||
|
||||
|
Reference in New Issue
Block a user